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.

117 lines
3.8 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[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'][usage~'^(main|branch)$'];",
  13. "14": "way[railway][railway!~'^(platform|abandoned|disused|station|proposed|subway_entrance)$'];"
  14. },
  15. "feature": {
  16. "pre": [
  17. "{% if tags.maxspeed is not defined %}",
  18. "{% set maxspeedKmh = null %}",
  19. "{% set maxspeed = null %}",
  20. "{% set unit = null %}",
  21. "{% else %}",
  22. "",
  23. "{% if tags.maxspeed|matches(\"^[0-9]+$\") %}",
  24. "{% set maxspeedKmh = tags.maxspeed %}",
  25. "{% set maxspeed = tags.maxspeed %}",
  26. "{% set unit = \"km/h\" %}",
  27. "{% endif %}",
  28. "",
  29. "",
  30. "{% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}",
  31. "{% if m %}",
  32. "{% set maxspeedKmh = m[1] * 1.60934 %}",
  33. "{% set maxspeed = m[1] %}",
  34. "{% set unit = \"mph\" %}",
  35. "{% endif %}",
  36. "",
  37. "{% endif %}",
  38. "",
  39. "{% if not maxspeedKmh %}",
  40. "{% set color = \"#404040\" %}",
  41. "{% else %}",
  42. "{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  43. "{% endif %}"
  44. ],
  45. "description": [
  46. "{% if maxspeed %}",
  47. "<span style='color: {{ color }}'>{{ maxspeed }} {{ unit }}</span>",
  48. "{% elseif tags.maxspeed %}",
  49. "{{ tags.maxspeed }}",
  50. "{% else %}",
  51. "{{ trans('unknown') }}",
  52. "{% endif %}"
  53. ],
  54. "markerSymbol": null,
  55. "listMarkerSymbol": "line",
  56. "style": {
  57. "width": "3",
  58. "color": "{{ color }}",
  59. "text": "{{ maxspeed }} ",
  60. "textRepeat": "1",
  61. "textFontWeight": "bold"
  62. }
  63. },
  64. "const": {
  65. "colorMap": [
  66. "#00af00",
  67. "#ff7f00",
  68. "#ff0000",
  69. "#af00af"
  70. ],
  71. "highestColorSpeed": 300,
  72. "offsetColorSpeed": 20
  73. },
  74. "info": [
  75. "<div style='display: inline-block'>",
  76. "<table>",
  77. " <tr>",
  78. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  79. " <td colspan>{{ trans('unknown') }}</td>",
  80. " </tr>",
  81. "{% for i in range(25, 280, 25) %}",
  82. " <tr>",
  83. " <td>{{ markerLine(evaluate({ \"maxspeed\": i }))|raw }}</td>",
  84. " <td>{{ i }}km/h</td>",
  85. " </tr>",
  86. "{% endfor %}",
  87. " <tr>",
  88. " <td>{{ markerLine(evaluate({ \"maxspeed\": 300 }))|raw }}</td>",
  89. " <td>≥300km/h</td>",
  90. " </tr>",
  91. "</table>",
  92. "</div>",
  93. "",
  94. "<div style='display: inline-block'>",
  95. "<table>",
  96. " <tr>",
  97. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  98. " <td colspan>{{ trans('unknown') }}</td>",
  99. " </tr>",
  100. "{% for i in range(15, 150, 15) %}",
  101. " <tr>",
  102. " <td>{{ markerLine(evaluate({ \"maxspeed\": (i * 1.60934)|round }))|raw }}</td>",
  103. " <td>{{ i }}mph</td>",
  104. " </tr>",
  105. "{% endfor %}",
  106. " <tr>",
  107. " <td>{{ markerLine(evaluate({ \"maxspeed\": (175 * 1.60934)|round }))|raw }}</td>",
  108. " <td>175mph</td>",
  109. " </tr>",
  110. " <tr>",
  111. " <td>{{ markerLine(evaluate({ \"maxspeed\": (200 * 1.60934)|round }))|raw }}</td>",
  112. " <td>≥200mph</td>",
  113. " </tr>",
  114. "</table>",
  115. "</div>"
  116. ]
  117. }