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.

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