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.

178 lines
7.3 KiB

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