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.

164 lines
5.5 KiB

  1. type: overpass
  2. name:
  3. ca: Velocitat màxima de la via fèrria
  4. cs: Maximální rychlost železnice
  5. de: Eisenbahn Höchstgeschwindigkeiten
  6. en: Railway Maxspeed
  7. es: Velocidad máxima del ferrocarril
  8. fr: Limites de vitesse
  9. gl: Velocidade máxima do ferrocarril
  10. hu: Sebességkorlátozás
  11. it: Velocità ferroviaria massima
  12. ja: 鉄道の最高速度
  13. nb: Jernbane-fartsgrense
  14. nl: Spoorweg snelheidslimiet
  15. oc: Limits de velocitat
  16. pl: Prędkość maksymalna kolei
  17. pt: Velocidade máxima
  18. pt-br: Velocidade máxima
  19. ru: Максимальная скорость
  20. tr: Demiryolu Maksimum Hızı
  21. query:
  22. 11: way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'][usage~'^(main|branch)$'];
  23. 14: way[railway~'^(disused|construction|funicular|light_rail|miniature|monorail|narrow_gauge|preserved|rail|subway|tram)$'];
  24. feature:
  25. pre: |-
  26. {% set maxspeedKmh = null %}
  27. {% set maxspeed = null %}
  28. {% set unit = null %}
  29. {% if tags.maxspeed is defined %}
  30. {% if tags.maxspeed|matches("^[0-9]+$") %}
  31. {% set maxspeedKmh = tags.maxspeed %}
  32. {% set maxspeed = tags.maxspeed %}
  33. {% set unit = "km/h" %}
  34. {% elseif tags.maxspeed|matches( "(^[0-9]+) mph$") %}
  35. {% set m = tags.maxspeed|matches("(^[0-9]+) mph$") %}
  36. {% set maxspeedKmh = m[1] * 1.60934 %}
  37. {% set maxspeed = m[1] %}
  38. {% set unit = "mph" %}
  39. {% endif %}
  40. {% endif %}
  41. {% if attribute(tags, 'maxspeed:forward') is defined %}
  42. {% if attribute(tags, 'maxspeed:forward')|matches("^[0-9]+$") %}
  43. {% set maxspeedFKmh = attribute(tags, 'maxspeed:forward') %}
  44. {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}
  45. {% set unit = "km/h" %}
  46. {% elseif attribute(tags, 'maxspeed:forward')|matches("^[0-9]+ mph$") %}
  47. {% set m = attribute(tags, 'maxspeed:forward')|matches("(^[0-9]+) mph$") %}
  48. {% set maxspeedFKmh = m[1] * 1.60934 %}
  49. {% set maxspeedF = m[1] %}
  50. {% set unit = "mph" %}
  51. {% endif %}
  52. {% endif %}
  53. {% if attribute(tags, 'maxspeed:backward') is defined %}
  54. {% if attribute(tags, 'maxspeed:backward')|matches("^[0-9]+$") %}
  55. {% set maxspeedBKmh = attribute(tags, 'maxspeed:backward') %}
  56. {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}
  57. {% set unit = "km/h" %}
  58. {% elseif attribute(tags, 'maxspeed:backward')|matches("^[0-9]+ mph$") %}
  59. {% set m = attribute(tags, 'maxspeed:backward')|matches("(^[0-9]+) mph$") %}
  60. {% set maxspeedBKmh = m[1] * 1.60934 %}
  61. {% set maxspeedB = m[1] %}
  62. {% set unit = "mph" %}
  63. {% endif %}
  64. {% endif %}
  65. {% if not maxspeedKmh %}
  66. {% set color = "#404040" %}
  67. {% else %}
  68. {% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}
  69. {% endif %}
  70. {% if maxspeedFKmh %}
  71. {% set colorF = colorInterpolate(const.colorMap, (maxspeedFKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}
  72. {% endif %}
  73. {% if maxspeedBKmh %}
  74. {% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}
  75. {% endif %}
  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. markerSymbol: null
  87. listMarkerSymbol: line
  88. styles: '{% if maxspeedB or maxspeedF %}left,right,default{% else %}default{% endif %}'
  89. style:
  90. width: '{% if maxspeedB or maxspeedF %}0{% else %}4{% endif %}'
  91. color: '{{ color }}'
  92. text: |-
  93. {% if maxspeedB or maxspeedF %}
  94. {% if maxspeedB %}🡸 {{ maxspeedB }} {% endif %}|{% if maxspeedF %} {{ maxspeedF }} 🡺{% endif %}
  95. {% else %}
  96. {{ maxspeed }}
  97. {% endif %}
  98. textRepeat: '1'
  99. textOffset: '4'
  100. textFontWeight: bold
  101. style:left:
  102. width: '2'
  103. color: '{{ colorB|default(''#404040'') }}'
  104. offset: '-1'
  105. style:right:
  106. width: '2'
  107. color: '{{ colorF|default(''#404040'') }}'
  108. offset: '1'
  109. const:
  110. colorMap:
  111. - '#00af00'
  112. - '#ff7f00'
  113. - '#ff0000'
  114. - '#af00af'
  115. highestColorSpeed: 300
  116. offsetColorSpeed: 20
  117. info: |-
  118. <div style='display: inline-block'>
  119. <table>
  120. <tr>
  121. <td>{{ markerLine(evaluate({}))|raw }}</td>
  122. <td colspan>{{ trans('unknown') }}</td>
  123. </tr>
  124. {% for i in range(25, 280, 25) %}
  125. <tr>
  126. <td>{{ markerLine(evaluate({ "maxspeed": i }))|raw }}</td>
  127. <td>{{ i }}km/h</td>
  128. </tr>
  129. {% endfor %}
  130. <tr>
  131. <td>{{ markerLine(evaluate({ "maxspeed": 300 }))|raw }}</td>
  132. <td>≥300km/h</td>
  133. </tr>
  134. </table>
  135. </div>
  136. <div style='display: inline-block'>
  137. <table>
  138. <tr>
  139. <td>{{ markerLine(evaluate({}))|raw }}</td>
  140. <td colspan>{{ trans('unknown') }}</td>
  141. </tr>
  142. {% for i in range(15, 150, 15) %}
  143. <tr>
  144. <td>{{ markerLine(evaluate({ "maxspeed": (i * 1.60934)|round }))|raw }}</td>
  145. <td>{{ i }}mph</td>
  146. </tr>
  147. {% endfor %}
  148. <tr>
  149. <td>{{ markerLine(evaluate({ "maxspeed": (175 * 1.60934)|round }))|raw }}</td>
  150. <td>175mph</td>
  151. </tr>
  152. <tr>
  153. <td>{{ markerLine(evaluate({ "maxspeed": (200 * 1.60934)|round }))|raw }}</td>
  154. <td>≥200mph</td>
  155. </tr>
  156. </table>
  157. </div>