Main categories of OpenStreetBrowser with support for whitewater
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.

111 lines
3.8 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Maxspeed"
  5. },
  6. "query": {
  7. "11": "way[highway~\"^(motorway|trunk)$\"];",
  8. "13": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|tertiary)$\"];",
  9. "15": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified)$\"];",
  10. "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)$\"];"
  11. },
  12. "feature": {
  13. "pre": [
  14. "{% if tags.maxspeed is not defined %}",
  15. "{% set maxspeedKmh = null %}",
  16. "{% set maxspeed = null %}",
  17. "{% set unit = null %}",
  18. "{% else %}",
  19. "",
  20. "{% if tags.maxspeed|matches(\"^[0-9]+$\") %}",
  21. "{% set maxspeedKmh = tags.maxspeed %}",
  22. "{% set maxspeed = tags.maxspeed %}",
  23. "{% set unit = \"km/h\" %}",
  24. "{% endif %}",
  25. "",
  26. "",
  27. "{% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}",
  28. "{% if m %}",
  29. "{% set maxspeedKmh = m[1] * 1.60934 %}",
  30. "{% set maxspeed = m[1] %}",
  31. "{% set unit = \"mph\" %}",
  32. "{% endif %}",
  33. "",
  34. "{% endif %}",
  35. "",
  36. "{% if not maxspeedKmh %}",
  37. "{% set color = \"#404040\" %}",
  38. "{% else %}",
  39. "{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  40. "{% endif %}"
  41. ],
  42. "description": [
  43. "{% if maxspeed %}",
  44. "<span style='color: {{ color }}'>{{ maxspeed }} {{ unit }}</span>",
  45. "{% elseif tags.maxspeed %}",
  46. "{{ tags.maxspeed }}",
  47. "{% else %}",
  48. "{{ trans('unknown') }}",
  49. "{% endif %}"
  50. ],
  51. "markerSymbol": null,
  52. "listMarkerSymbol": "line",
  53. "style": {
  54. "width": "3",
  55. "color": "{{ color }}"
  56. }
  57. },
  58. "const": {
  59. "colorMap": [
  60. "#00af00",
  61. "#ff7f00",
  62. "#ff0000",
  63. "#af00af"
  64. ],
  65. "highestColorSpeed": 150,
  66. "offsetColorSpeed": 10
  67. },
  68. "info": [
  69. "<div style='display: inline-block'>",
  70. "<table>",
  71. " <tr>",
  72. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  73. " <td colspan>{{ trans('unknown') }}</td>",
  74. " </tr>",
  75. "{% for i in range(10, 140, 20) %}",
  76. " <tr>",
  77. " <td>{{ markerLine(evaluate({ \"maxspeed\": i }))|raw }}</td>",
  78. " <td>{{ i }}km/h</td>",
  79. " </tr>",
  80. "{% endfor %}",
  81. " <tr>",
  82. " <td>{{ markerLine(evaluate({ \"maxspeed\": 150 }))|raw }}</td>",
  83. " <td>≥150km/h</td>",
  84. " </tr>",
  85. "</table>",
  86. "</div>",
  87. "",
  88. "<div style='display: inline-block'>",
  89. "<table>",
  90. " <tr>",
  91. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  92. " <td colspan>{{ trans('unknown') }}</td>",
  93. " </tr>",
  94. "{% for i in range(10, 60, 10) %}",
  95. " <tr>",
  96. " <td>{{ markerLine(evaluate({ \"maxspeed\": (i * 1.60934)|round }))|raw }}</td>",
  97. " <td>{{ i }}mph</td>",
  98. " </tr>",
  99. "{% endfor %}",
  100. " <tr>",
  101. " <td>{{ markerLine(evaluate({ \"maxspeed\": (75 * 1.60934)|round }))|raw }}</td>",
  102. " <td>75mph</td>",
  103. " </tr>",
  104. " <tr>",
  105. " <td>{{ markerLine(evaluate({ \"maxspeed\": (95 * 1.60934)|round }))|raw }}</td>",
  106. " <td>≥95mph</td>",
  107. " </tr>",
  108. "</table>",
  109. "</div>"
  110. ]
  111. }