Main categories of OpenStreetBrowser with public transport zoom level
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

187 lines
8.1 KiB

  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 == 'none' %}",
  25. " {% set maxspeed = 'none' %}",
  26. " {% elseif tags.maxspeed|matches(\"^[0-9]+$\") %}",
  27. " {% set maxspeedKmh = tags.maxspeed %}",
  28. " {% set maxspeed = tags.maxspeed %}",
  29. " {% set unit = \"km/h\" %}",
  30. " {% elseif tags.maxspeed|matches( \"(^[0-9]+) mph$\") %}",
  31. " {% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}",
  32. " {% set maxspeedKmh = m[1] * 1.60934 %}",
  33. " {% set maxspeed = m[1] %}",
  34. " {% set unit = \"mph\" %}",
  35. " {% endif %}",
  36. "{% endif %}",
  37. "",
  38. "{% if attribute(tags, 'maxspeed:forward') is defined %}",
  39. " {% if attribute(tags, 'maxspeed:forward') == 'none' %}",
  40. " {% set maxspeedF = 'none' %}",
  41. " {% elseif attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+$\") %}",
  42. " {% set maxspeedFKmh = attribute(tags, 'maxspeed:forward') %}",
  43. " {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}",
  44. " {% set unit = \"km/h\" %}",
  45. " {% elseif attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+ mph$\") %}",
  46. " {% set m = attribute(tags, 'maxspeed:forward')|matches(\"(^[0-9]+) mph$\") %}",
  47. " {% set maxspeedFKmh = m[1] * 1.60934 %}",
  48. " {% set maxspeedF = m[1] %}",
  49. " {% set unit = \"mph\" %}",
  50. " {% endif %}",
  51. "{% endif %}",
  52. "",
  53. "{% if attribute(tags, 'maxspeed:backward') is defined %}",
  54. " {% if attribute(tags, 'maxspeed:backward') == 'none' %}",
  55. " {% set maxspeedB = 'none' %}",
  56. " {% elseif attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+$\") %}",
  57. " {% set maxspeedBKmh = attribute(tags, 'maxspeed:backward') %}",
  58. " {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}",
  59. " {% set unit = \"km/h\" %}",
  60. " {% elseif attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+ mph$\") %}",
  61. " {% set m = attribute(tags, 'maxspeed:backward')|matches(\"(^[0-9]+) mph$\") %}",
  62. " {% set maxspeedBKmh = m[1] * 1.60934 %}",
  63. " {% set maxspeedB = m[1] %}",
  64. " {% set unit = \"mph\" %}",
  65. " {% endif %}",
  66. "{% endif %}",
  67. "",
  68. "{% if maxspeed == 'none' %}",
  69. "{% set color = \"#0000ff\" %}",
  70. "{% elseif not maxspeedKmh %}",
  71. "{% set color = \"#404040\" %}",
  72. "{% else %}",
  73. "{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  74. "{% endif %}",
  75. "",
  76. "{% if maxspeedF == 'none' %}",
  77. "{% set colorF = \"#0000ff\" %}",
  78. "{% elseif maxspeedFKmh %}",
  79. "{% set colorF = colorInterpolate(const.colorMap, (maxspeedFKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  80. "{% endif %}",
  81. "",
  82. "{% if maxspeedB == 'none' %}",
  83. "{% set colorB = \"#0000ff\" %}",
  84. "{% elseif maxspeedBKmh %}",
  85. "{% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  86. "{% endif %}"
  87. ],
  88. "description": [
  89. "{% if maxspeedF or maxspeedB %}",
  90. "<span style='color: {{ colorB }}'>{{ maxspeedB == 'none' ? tagTrans('maxspeed', 'none') : maxspeedB|default(trans('unknown')) }}</span> / <span style='color: {{ colorF }}'>{{ maxspeedF == 'none' ? tagTrans('maxspeed', 'none') : maxspeedF|default(trans('unknown')) }}</span> {{ unit }}",
  91. "{% elseif maxspeed %}",
  92. "<span style='color: {{ color }}'>{{ maxspeed == 'none' ? tagTrans('maxspeed', 'none') : maxspeed }} {{ unit }}</span>",
  93. "{% elseif tags.maxspeed %}",
  94. "{{ tags.maxspeed }}",
  95. "{% else %}",
  96. "{{ trans('unknown') }}",
  97. "{% endif %}"
  98. ],
  99. "markerSymbol": "",
  100. "listMarkerSymbol": "line",
  101. "styles": "{% if maxspeedB or maxspeedF %}left,right,default{% else %}default{% endif %}",
  102. "style": {
  103. "width": "{% if maxspeedB or maxspeedF %}0{% else %}4{% endif %}",
  104. "color": "{{ color }}",
  105. "text": [
  106. "{% if maxspeedB or maxspeedF %}",
  107. " {% if maxspeedB %}🡸 {{ maxspeedB }} {% endif %}|{% if maxspeedF %} {{ maxspeedF }} 🡺{% endif %} ",
  108. "{% else %}",
  109. " {{ maxspeed }} ",
  110. "{% endif %}"
  111. ],
  112. "textRepeat": "1",
  113. "textOffset": "4",
  114. "textFontWeight": "bold"
  115. },
  116. "style:left": {
  117. "width": "2",
  118. "color": "{{ colorB|default('#404040') }}",
  119. "offset": "-1"
  120. },
  121. "style:right": {
  122. "width": "2",
  123. "color": "{{ colorF|default('#404040') }}",
  124. "offset": "1"
  125. }
  126. },
  127. "const": {
  128. "colorMap": [
  129. "#00af00",
  130. "#ff7f00",
  131. "#ff0000",
  132. "#af00af"
  133. ],
  134. "highestColorSpeed": 150,
  135. "offsetColorSpeed": 10
  136. },
  137. "info": [
  138. "<div style='display: inline-block; width: 49%;'>",
  139. "<table>",
  140. " <tr>",
  141. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  142. " <td colspan>{{ trans('unknown') }}</td>",
  143. " </tr>",
  144. "{% for i in range(10, 140, 20) %}",
  145. " <tr>",
  146. " <td>{{ markerLine(evaluate({ \"maxspeed\": i }))|raw }}</td>",
  147. " <td>{{ i }}km/h</td>",
  148. " </tr>",
  149. "{% endfor %}",
  150. " <tr>",
  151. " <td>{{ markerLine(evaluate({ \"maxspeed\": 150 }))|raw }}</td>",
  152. " <td>≥150km/h</td>",
  153. " </tr>",
  154. " <tr>",
  155. " <td>{{ markerLine(evaluate({ \"maxspeed\": \"none\" }))|raw }}</td>",
  156. " <td>{{ tagTrans('maxspeed', 'none') }}</td>",
  157. " </tr>",
  158. "</table>",
  159. "</div>",
  160. "<div style='display: inline-block; width: 49%;'>",
  161. "<table>",
  162. " <tr>",
  163. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  164. " <td colspan>{{ trans('unknown') }}</td>",
  165. " </tr>",
  166. "{% for i in range(10, 60, 10) %}",
  167. " <tr>",
  168. " <td>{{ markerLine(evaluate({ \"maxspeed\": (i * 1.60934)|round }))|raw }}</td>",
  169. " <td>{{ i }}mph</td>",
  170. " </tr>",
  171. "{% endfor %}",
  172. " <tr>",
  173. " <td>{{ markerLine(evaluate({ \"maxspeed\": (75 * 1.60934)|round }))|raw }}</td>",
  174. " <td>75mph</td>",
  175. " </tr>",
  176. " <tr>",
  177. " <td>{{ markerLine(evaluate({ \"maxspeed\": (95 * 1.60934)|round }))|raw }}</td>",
  178. " <td>≥95mph</td>",
  179. " </tr>",
  180. " <tr>",
  181. " <td>{{ markerLine(evaluate({ \"maxspeed\": \"none\" }))|raw }}</td>",
  182. " <td>{{ tagTrans('maxspeed', 'none') }}</td>",
  183. " </tr>",
  184. "</table>",
  185. "</div>"
  186. ]
  187. }