Main categories of OpenStreetBrowser

car_maxspeed.json 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "Höchstgeschwindigkeiten",
  5. "en": "Maxspeed",
  6. "fr": "Limites de vitesse",
  7. "hu": "Sebességkorlátozás",
  8. "pt": "Velocidade máxima",
  9. "pt-br": "Velocidade máxima"
  10. },
  11. "query": {
  12. "11": "way[highway~\"^(motorway|trunk)$\"];",
  13. "13": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|tertiary)$\"];",
  14. "15": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified)$\"];",
  15. "17": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified|service|living_street|pedestrian|track|road)$\"];"
  16. },
  17. "feature": {
  18. "pre": [
  19. "{% set maxspeedKmh = null %}",
  20. "{% set maxspeed = null %}",
  21. "{% set unit = null %}",
  22. "",
  23. "{% if tags.maxspeed is defined %}",
  24. " {% if tags.maxspeed|matches(\"^[0-9]+$\") %}",
  25. " {% set maxspeedKmh = tags.maxspeed %}",
  26. " {% set maxspeed = tags.maxspeed %}",
  27. " {% set unit = \"km/h\" %}",
  28. " {% elseif tags.maxspeed|matches( \"(^[0-9]+) mph$\") %}",
  29. " {% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}",
  30. " {% set maxspeedKmh = m[1] * 1.60934 %}",
  31. " {% set maxspeed = m[1] %}",
  32. " {% set unit = \"mph\" %}",
  33. " {% endif %}",
  34. "{% endif %}",
  35. "",
  36. "{% if attribute(tags, 'maxspeed:forward') is defined %}",
  37. " {% if attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+$\") %}",
  38. " {% set maxspeedFKmh = attribute(tags, 'maxspeed:forward') %}",
  39. " {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}",
  40. " {% set unit = \"km/h\" %}",
  41. " {% elseif attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+ mph$\") %}",
  42. " {% set m = attribute(tags, 'maxspeed:forward')|matches(\"(^[0-9]+) mph$\") %}",
  43. " {% set maxspeedFKmh = m[1] * 1.60934 %}",
  44. " {% set maxspeedF = m[1] %}",
  45. " {% set unit = \"mph\" %}",
  46. " {% endif %}",
  47. "{% endif %}",
  48. "",
  49. "{% if attribute(tags, 'maxspeed:backward') is defined %}",
  50. " {% if attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+$\") %}",
  51. " {% set maxspeedBKmh = attribute(tags, 'maxspeed:backward') %}",
  52. " {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}",
  53. " {% set unit = \"km/h\" %}",
  54. " {% elseif attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+ mph$\") %}",
  55. " {% set m = attribute(tags, 'maxspeed:backward')|matches(\"(^[0-9]+) mph$\") %}",
  56. " {% set maxspeedBKmh = m[1] * 1.60934 %}",
  57. " {% set maxspeedB = m[1] %}",
  58. " {% set unit = \"mph\" %}",
  59. " {% endif %}",
  60. "{% endif %}",
  61. "",
  62. "{% if not maxspeedKmh %}",
  63. "{% set color = \"#404040\" %}",
  64. "{% else %}",
  65. "{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  66. "{% endif %}",
  67. "",
  68. "{% if maxspeedFKmh %}",
  69. "{% set colorF = colorInterpolate(const.colorMap, (maxspeedFKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  70. "{% endif %}",
  71. "",
  72. "{% if maxspeedBKmh %}",
  73. "{% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  74. "{% endif %}"
  75. ],
  76. "description": [
  77. "{% if maxspeedF or maxspeedB %}",
  78. "<span style='color: {{ colorB }}'>{{ maxspeedB|default(trans('unknown')) }}</span> / <span style='color: {{ colorF }}'>{{ maxspeedF|default(trans('unknown')) }}</span> {{ unit }}",
  79. "{% elseif maxspeed %}",
  80. "<span style='color: {{ color }}'>{{ maxspeed }} {{ unit }}</span>",
  81. "{% elseif tags.maxspeed %}",
  82. "{{ tags.maxspeed }}",
  83. "{% else %}",
  84. "{{ trans('unknown') }}",
  85. "{% endif %}"
  86. ],
  87. "markerSymbol": "",
  88. "listMarkerSymbol": "line",
  89. "styles": "{% if maxspeedB or maxspeedF %}left,right,default{% else %}default{% endif %}",
  90. "style": {
  91. "width": "{% if maxspeedB or maxspeedF %}0{% else %}4{% endif %}",
  92. "color": "{{ color }}",
  93. "text": [
  94. "{% if maxspeedB or maxspeedF %}",
  95. " {% if maxspeedB %}🡸 {{ maxspeedB }} {% endif %}|{% if maxspeedF %} {{ maxspeedF }} 🡺{% endif %} ",
  96. "{% else %}",
  97. " {{ maxspeed }} ",
  98. "{% endif %}"
  99. ],
  100. "textRepeat": "1",
  101. "textOffset": "4",
  102. "textFontWeight": "bold"
  103. },
  104. "style:left": {
  105. "width": "2",
  106. "color": "{{ colorB|default('#404040') }}",
  107. "offset": "-1"
  108. },
  109. "style:right": {
  110. "width": "2",
  111. "color": "{{ colorF|default('#404040') }}",
  112. "offset": "1"
  113. }
  114. },
  115. "const": {
  116. "colorMap": [
  117. "#00af00",
  118. "#ff7f00",
  119. "#ff0000",
  120. "#af00af"
  121. ],
  122. "highestColorSpeed": 150,
  123. "offsetColorSpeed": 10
  124. },
  125. "info": [
  126. "<div style='display: inline-block'>",
  127. "<table>",
  128. " <tr>",
  129. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  130. " <td colspan>{{ trans('unknown') }}</td>",
  131. " </tr>",
  132. "{% for i in range(10, 140, 20) %}",
  133. " <tr>",
  134. " <td>{{ markerLine(evaluate({ \"maxspeed\": i }))|raw }}</td>",
  135. " <td>{{ i }}km/h</td>",
  136. " </tr>",
  137. "{% endfor %}",
  138. " <tr>",
  139. " <td>{{ markerLine(evaluate({ \"maxspeed\": 150 }))|raw }}</td>",
  140. " <td>≥150km/h</td>",
  141. " </tr>",
  142. "</table>",
  143. "</div>",
  144. "",
  145. "<div style='display: inline-block'>",
  146. "<table>",
  147. " <tr>",
  148. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  149. " <td colspan>{{ trans('unknown') }}</td>",
  150. " </tr>",
  151. "{% for i in range(10, 60, 10) %}",
  152. " <tr>",
  153. " <td>{{ markerLine(evaluate({ \"maxspeed\": (i * 1.60934)|round }))|raw }}</td>",
  154. " <td>{{ i }}mph</td>",
  155. " </tr>",
  156. "{% endfor %}",
  157. " <tr>",
  158. " <td>{{ markerLine(evaluate({ \"maxspeed\": (75 * 1.60934)|round }))|raw }}</td>",
  159. " <td>75mph</td>",
  160. " </tr>",
  161. " <tr>",
  162. " <td>{{ markerLine(evaluate({ \"maxspeed\": (95 * 1.60934)|round }))|raw }}</td>",
  163. " <td>≥95mph</td>",
  164. " </tr>",
  165. "</table>",
  166. "</div>"
  167. ]
  168. }