Main categories of OpenStreetBrowser
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.

261 lines
9.1 KiB

  1. type: overpass
  2. name:
  3. ca: Velocitat màxima
  4. cs: Maximální rychlost
  5. de: Höchstgeschwindigkeiten
  6. en: Maxspeed
  7. es: Velocidad máxima
  8. fr: Limites de vitesse
  9. gl: Velocidade máxima
  10. hu: Sebességkorlátozás
  11. it: Velocità massima
  12. ja: 最高速度
  13. nb: Fartsgrense
  14. nl: Snelheidslimiet
  15. oc: Limits de velocitat
  16. pl: Prędkość maksymalna
  17. pt: Velocidade máxima
  18. pt-br: Veloc. máxima
  19. ro: Viteza maximă
  20. ru: Максимальная скорость
  21. sr: Максимална брзина
  22. tr: En yüksek hız
  23. query:
  24. 11: way[highway~"^(motorway|trunk)$"];
  25. 13: way[highway~"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|tertiary)$"];
  26. 15: way[highway~"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified)$"];
  27. 16: |-
  28. (
  29. way[highway~"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified)$"];
  30. node[traffic_sign~"^(|.*;)maxspeed(;.*|)$"];
  31. )
  32. 17: |-
  33. (
  34. 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)$"];
  35. node[traffic_sign~"^(|.*;)maxspeed(;.*|)$"];
  36. )
  37. feature:
  38. pre: |-
  39. {% set maxspeedKmh = null %}
  40. {% set maxspeed = null %}
  41. {% set unit = null %}
  42. {% if tags.maxspeed is defined %}
  43. {% if const.colorOther[tags.maxspeed] %}
  44. {% set maxspeed = tags.maxspeed %}
  45. {% elseif tags.maxspeed|matches("^[0-9]+$") %}
  46. {% set maxspeedKmh = tags.maxspeed %}
  47. {% set maxspeed = tags.maxspeed %}
  48. {% set unit = "km/h" %}
  49. {% elseif tags.maxspeed|matches( "(^[0-9]+) mph$") %}
  50. {% set m = tags.maxspeed|matches("(^[0-9]+) mph$") %}
  51. {% set maxspeedKmh = m[1] * 1.60934 %}
  52. {% set maxspeed = m[1] %}
  53. {% set unit = "mph" %}
  54. {% else %}
  55. {% set maxspeed = 'other' %}
  56. {% endif %}
  57. {% endif %}
  58. {% if attribute(tags, 'maxspeed:forward') is defined %}
  59. {% set x = attribute(tags, 'maxspeed:forward') %}
  60. {% if const.colorOther[x] %}
  61. {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}
  62. {% elseif attribute(tags, 'maxspeed:forward')|matches("^[0-9]+$") %}
  63. {% set maxspeedFKmh = attribute(tags, 'maxspeed:forward') %}
  64. {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}
  65. {% set unit = "km/h" %}
  66. {% elseif attribute(tags, 'maxspeed:forward')|matches("^[0-9]+ mph$") %}
  67. {% set m = attribute(tags, 'maxspeed:forward')|matches("(^[0-9]+) mph$") %}
  68. {% set maxspeedFKmh = m[1] * 1.60934 %}
  69. {% set maxspeedF = m[1] %}
  70. {% set unit = "mph" %}
  71. {% else %}
  72. {% set maxspeedF = 'other' %}
  73. {% endif %}
  74. {% endif %}
  75. {% if attribute(tags, 'maxspeed:backward') is defined %}
  76. {% set x = attribute(tags, 'maxspeed:backward') %}
  77. {% if const.colorOther[x] %}
  78. {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}
  79. {% elseif attribute(tags, 'maxspeed:backward')|matches("^[0-9]+$") %}
  80. {% set maxspeedBKmh = attribute(tags, 'maxspeed:backward') %}
  81. {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}
  82. {% set unit = "km/h" %}
  83. {% elseif attribute(tags, 'maxspeed:backward')|matches("^[0-9]+ mph$") %}
  84. {% set m = attribute(tags, 'maxspeed:backward')|matches("(^[0-9]+) mph$") %}
  85. {% set maxspeedBKmh = m[1] * 1.60934 %}
  86. {% set maxspeedB = m[1] %}
  87. {% set unit = "mph" %}
  88. {% else %}
  89. {% set maxspeedB = 'other' %}
  90. {% endif %}
  91. {% endif %}
  92. {% if const.colorOther[maxspeed] %}
  93. {% set color = const.colorOther[maxspeed] %}
  94. {% elseif not maxspeedKmh %}
  95. {% set color = "#404040" %}
  96. {% else %}
  97. {% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}
  98. {% endif %}
  99. {% if const.colorOther[maxspeedF] %}
  100. {% set colorF = const.colorOther[maxspeedF] %}
  101. {% elseif maxspeedFKmh %}
  102. {% set colorF = colorInterpolate(const.colorMap, (maxspeedFKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}
  103. {% endif %}
  104. {% if const.colorOther[maxspeedB] %}
  105. {% set colorB = const.colorOther[maxspeedB] %}
  106. {% elseif maxspeedBKmh %}
  107. {% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}
  108. {% endif %}
  109. description: |-
  110. {% if tags.highway %}
  111. {{ tagTransList('highway', tags.highway) }}
  112. {% else %}
  113. {{ keyTrans('traffic_sign') }}: {{ tagTransList('traffic_sign', tags.traffic_sign) }}
  114. {% endif %}
  115. details: |-
  116. {% if maxspeedF or maxspeedB %}
  117. <span style='color: {{ colorB }}'>{{ maxspeedB == 'other' ? attribute(tags, 'maxspeed:backward') : const.colorOther[maxspeedB] ? tagTrans('maxspeed', maxspeedB) : maxspeedB|default(trans('unknown')) }}</span> / <span style='color: {{ colorF }}'>{{ maxspeedF == 'other' ? attribute(tags, 'maxspeed:forward') : const.colorOther[maxspeedF] ? tagTrans('maxspeed', maxspeedF) : maxspeedF|default(trans('unknown')) }}</span> {{ unit }}
  118. {% elseif maxspeed %}
  119. <span style='color: {{ color }}'>{{ maxspeed == 'other' ? tags.maxspeed : const.colorOther[maxspeed] ? tagTrans('maxspeed', maxspeed) : maxspeed }} {{ unit }}</span>
  120. {% elseif tags.maxspeed %}
  121. {{ tags.maxspeed }}
  122. {% else %}
  123. {{ trans('unknown') }}
  124. {% endif %}
  125. markerSymbol: |-
  126. {% if not tags.highway %}
  127. {{ markerCircle({ color: 'red', width: 2, fill: true, fillColor: '#ffffff', fillOpacity: 1, radius: 9 }) }}
  128. {% endif %}
  129. listMarkerSymbol: |-
  130. {% if tags.highway %}
  131. line
  132. {% else %}
  133. {{ markerCircle({ color: 'red', width: 2, fill: true, fillColor: '#ffffff', fillOpacity: 1, radius: 9 }) }}
  134. {% endif %}
  135. markerSign: |
  136. {% if not tags.highway %}
  137. <span style='font-size: 8pt;
  138. {% if tags.direction %}
  139. transform: rotate({{ tags.direction|parseDirection|default(0) + 180 }}deg);
  140. {% endif %}
  141. '>{{ tags.maxspeed|default('?') }}</span>
  142. {% endif %}
  143. listMarkerSign: |
  144. {% if not tags.highway %}
  145. <span style='font-size: 8pt;'>{{ tags.maxspeed|default('?') }}</span>
  146. {% endif %}
  147. styles: |-
  148. {% if not tags.highway %}
  149. traffic_sign
  150. {% elseif maxspeedB or maxspeedF %}
  151. left,right,default
  152. {% else %}
  153. default
  154. {% endif %}
  155. style:
  156. width: '{% if maxspeedB or maxspeedF %}0{% else %}4{% endif %}'
  157. color: '{{ color }}'
  158. text: |-
  159. {% if maxspeedB or maxspeedF %}
  160. {% if maxspeedB %}🡸 {{ maxspeedB == 'other' ? attribute(tags, 'maxspeed:backward') : maxspeedB }} {% endif %}|{% if maxspeedF %} {{ maxspeedF == 'other' ? attribute(tags, 'maxspeed:forward') : maxspeedF }} 🡺{% endif %}
  161. {% else %}
  162. {{ maxspeed == 'other' ? tags.maxspeed : maxspeed }}
  163. {% endif %}
  164. textRepeat: '1'
  165. textOffset: '4'
  166. textFontWeight: bold
  167. style:left:
  168. width: '2'
  169. color: |-
  170. {{ colorB|default('#404040') }}
  171. offset: '-1'
  172. style:right:
  173. width: '2'
  174. color: |
  175. {{ colorF|default('#404040') }}
  176. offset: '1'
  177. style:traffic_sign:
  178. width: 0
  179. radius: 0
  180. const:
  181. colorMap:
  182. - '#00af00'
  183. - '#ff7f00'
  184. - '#ff0000'
  185. - '#af00af'
  186. colorOther:
  187. none: '#ff00ff'
  188. walk: '#00afff'
  189. other: '#0000ff'
  190. highestColorSpeed: 150
  191. offsetColorSpeed: 10
  192. info: |-
  193. <table>
  194. <tr>
  195. <td>{{ markerLine(evaluate({}))|raw }}</td>
  196. <td colspan>{{ trans('unknown') }}</td>
  197. </tr>
  198. <tr>
  199. <td>{{ markerLine(evaluate({ "maxspeed": "walk" }))|raw }}</td>
  200. <td colspan>{{ tagTrans('maxspeed', 'walk') }}</td>
  201. </tr>
  202. <tr>
  203. <td>{{ markerLine(evaluate({ "maxspeed": "none" }))|raw }}</td>
  204. <td>{{ tagTrans('maxspeed', 'none') }}</td>
  205. </tr>
  206. <tr>
  207. <td>{{ markerLine(evaluate({ "maxspeed": "other" }))|raw }}</td>
  208. <td>{{ trans('other') }}</td>
  209. </tr>
  210. </table>
  211. <div style='display: inline-block; width: 49%;'>
  212. <table>
  213. {% for i in range(10, 140, 20) %}
  214. <tr>
  215. <td>{{ markerLine(evaluate({ "maxspeed": i }))|raw }}</td>
  216. <td>{{ i }}km/h</td>
  217. </tr>
  218. {% endfor %}
  219. <tr>
  220. <td>{{ markerLine(evaluate({ "maxspeed": 150 }))|raw }}</td>
  221. <td>≥150km/h</td>
  222. </tr>
  223. </table>
  224. </div>
  225. <div style='display: inline-block; width: 49%;'>
  226. <table>
  227. {% for i in range(10, 60, 10) %}
  228. <tr>
  229. <td>{{ markerLine(evaluate({ "maxspeed": (i * 1.60934)|round }))|raw }}</td>
  230. <td>{{ i }}mph</td>
  231. </tr>
  232. {% endfor %}
  233. <tr>
  234. <td>{{ markerLine(evaluate({ "maxspeed": (75 * 1.60934)|round }))|raw }}</td>
  235. <td>75mph</td>
  236. </tr>
  237. <tr>
  238. <td>{{ markerLine(evaluate({ "maxspeed": (95 * 1.60934)|round }))|raw }}</td>
  239. <td>≥95mph</td>
  240. </tr>
  241. </table>
  242. </div>
  243. filter:
  244. type:
  245. name: |
  246. {{ trans('filter:type') }}
  247. type: select
  248. show_default: true
  249. values: |-
  250. <option value='road' query='way[highway]'>{{ keyTrans('highway') }}</option>
  251. <option value='traffic_sign' query='node[traffic_sign]'>{{ keyTrans('traffic_sign') }}</option>