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.

217 lines
9.7 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "ca": "Velocitat màxima",
  5. "cs": "Maximální rychlost",
  6. "de": "Höchstgeschwindigkeiten",
  7. "en": "Maxspeed",
  8. "es": "Velocidad máxima",
  9. "fr": "Limites de vitesse",
  10. "gl": "Velocidade máxima",
  11. "hu": "Sebességkorlátozás",
  12. "it": "Velocità massima",
  13. "ja": "最高速度",
  14. "nb": "Fartsgrense",
  15. "nl": "Snelheidslimiet",
  16. "oc": "Limits de velocitat",
  17. "pl": "Prędkość maksymalna",
  18. "pt": "Velocidade máxima",
  19. "pt-br": "Veloc. máxima",
  20. "ro": "Viteza maximă",
  21. "ru": "Максимальная скорость",
  22. "sr": "Максимална брзина",
  23. "tr": "En yüksek hız"
  24. },
  25. "query": {
  26. "11": "way[highway~\"^(motorway|trunk)$\"];",
  27. "13": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|tertiary)$\"];",
  28. "15": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified)$\"];",
  29. "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)$\"];"
  30. },
  31. "feature": {
  32. "pre": [
  33. "{% set maxspeedKmh = null %}",
  34. "{% set maxspeed = null %}",
  35. "{% set unit = null %}",
  36. "",
  37. "{% if tags.maxspeed is defined %}",
  38. " {% if const.colorOther[tags.maxspeed] %}",
  39. " {% set maxspeed = tags.maxspeed %}",
  40. " {% elseif tags.maxspeed|matches(\"^[0-9]+$\") %}",
  41. " {% set maxspeedKmh = tags.maxspeed %}",
  42. " {% set maxspeed = tags.maxspeed %}",
  43. " {% set unit = \"km/h\" %}",
  44. " {% elseif tags.maxspeed|matches( \"(^[0-9]+) mph$\") %}",
  45. " {% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}",
  46. " {% set maxspeedKmh = m[1] * 1.60934 %}",
  47. " {% set maxspeed = m[1] %}",
  48. " {% set unit = \"mph\" %}",
  49. " {% else %}",
  50. " {% set maxspeed = 'other' %}",
  51. " {% endif %}",
  52. "{% endif %}",
  53. "",
  54. "{% if attribute(tags, 'maxspeed:forward') is defined %}",
  55. " {% set x = attribute(tags, 'maxspeed:forward') %}",
  56. " {% if const.colorOther[x] %}",
  57. " {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}",
  58. " {% elseif attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+$\") %}",
  59. " {% set maxspeedFKmh = attribute(tags, 'maxspeed:forward') %}",
  60. " {% set maxspeedF = attribute(tags, 'maxspeed:forward') %}",
  61. " {% set unit = \"km/h\" %}",
  62. " {% elseif attribute(tags, 'maxspeed:forward')|matches(\"^[0-9]+ mph$\") %}",
  63. " {% set m = attribute(tags, 'maxspeed:forward')|matches(\"(^[0-9]+) mph$\") %}",
  64. " {% set maxspeedFKmh = m[1] * 1.60934 %}",
  65. " {% set maxspeedF = m[1] %}",
  66. " {% set unit = \"mph\" %}",
  67. " {% else %}",
  68. " {% set maxspeedF = 'other' %}",
  69. " {% endif %}",
  70. "{% endif %}",
  71. "",
  72. "{% if attribute(tags, 'maxspeed:backward') is defined %}",
  73. " {% set x = attribute(tags, 'maxspeed:backward') %}",
  74. " {% if const.colorOther[x] %}",
  75. " {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}",
  76. " {% elseif attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+$\") %}",
  77. " {% set maxspeedBKmh = attribute(tags, 'maxspeed:backward') %}",
  78. " {% set maxspeedB = attribute(tags, 'maxspeed:backward') %}",
  79. " {% set unit = \"km/h\" %}",
  80. " {% elseif attribute(tags, 'maxspeed:backward')|matches(\"^[0-9]+ mph$\") %}",
  81. " {% set m = attribute(tags, 'maxspeed:backward')|matches(\"(^[0-9]+) mph$\") %}",
  82. " {% set maxspeedBKmh = m[1] * 1.60934 %}",
  83. " {% set maxspeedB = m[1] %}",
  84. " {% set unit = \"mph\" %}",
  85. " {% else %}",
  86. " {% set maxspeedB = 'other' %}",
  87. " {% endif %}",
  88. "{% endif %}",
  89. "",
  90. "{% if const.colorOther[maxspeed] %}",
  91. "{% set color = const.colorOther[maxspeed] %}",
  92. "{% elseif not maxspeedKmh %}",
  93. "{% set color = \"#404040\" %}",
  94. "{% else %}",
  95. "{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  96. "{% endif %}",
  97. "",
  98. "{% if const.colorOther[maxspeedF] %}",
  99. "{% set colorF = const.colorOther[maxspeedF] %}",
  100. "{% elseif maxspeedFKmh %}",
  101. "{% set colorF = colorInterpolate(const.colorMap, (maxspeedFKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  102. "{% endif %}",
  103. "",
  104. "{% if const.colorOther[maxspeedB] %}",
  105. "{% set colorB = const.colorOther[maxspeedB] %}",
  106. "{% elseif maxspeedBKmh %}",
  107. "{% set colorB = colorInterpolate(const.colorMap, (maxspeedBKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
  108. "{% endif %}"
  109. ],
  110. "description": "{{ tagTransList('highway', tags.highway) }}",
  111. "details": [
  112. "{% if maxspeedF or maxspeedB %}",
  113. "<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 }}",
  114. "{% elseif maxspeed %}",
  115. "<span style='color: {{ color }}'>{{ maxspeed == 'other' ? tags.maxspeed : const.colorOther[maxspeed] ? tagTrans('maxspeed', maxspeed) : maxspeed }} {{ unit }}</span>",
  116. "{% elseif tags.maxspeed %}",
  117. "{{ tags.maxspeed }}",
  118. "{% else %}",
  119. "{{ trans('unknown') }}",
  120. "{% endif %}"
  121. ],
  122. "markerSymbol": "",
  123. "listMarkerSymbol": "line",
  124. "styles": "{% if maxspeedB or maxspeedF %}left,right,default{% else %}default{% endif %}",
  125. "style": {
  126. "width": "{% if maxspeedB or maxspeedF %}0{% else %}4{% endif %}",
  127. "color": "{{ color }}",
  128. "text": [
  129. "{% if maxspeedB or maxspeedF %}",
  130. " {% if maxspeedB %}🡸 {{ maxspeedB == 'other' ? attribute(tags, 'maxspeed:backward') : maxspeedB }} {% endif %}|{% if maxspeedF %} {{ maxspeedF == 'other' ? attribute(tags, 'maxspeed:forward') : maxspeedF }} 🡺{% endif %} ",
  131. "{% else %}",
  132. " {{ maxspeed == 'other' ? tags.maxspeed : maxspeed }} ",
  133. "{% endif %}"
  134. ],
  135. "textRepeat": "1",
  136. "textOffset": "4",
  137. "textFontWeight": "bold"
  138. },
  139. "style:left": {
  140. "width": "2",
  141. "color": "{{ colorB|default('#404040') }}",
  142. "offset": "-1"
  143. },
  144. "style:right": {
  145. "width": "2",
  146. "color": "{{ colorF|default('#404040') }}",
  147. "offset": "1"
  148. }
  149. },
  150. "const": {
  151. "colorMap": [
  152. "#00af00",
  153. "#ff7f00",
  154. "#ff0000",
  155. "#af00af"
  156. ],
  157. "colorOther": {
  158. "none": "#ff00ff",
  159. "walk": "#00afff",
  160. "other": "#0000ff"
  161. },
  162. "highestColorSpeed": 150,
  163. "offsetColorSpeed": 10
  164. },
  165. "info": [
  166. "<table>",
  167. " <tr>",
  168. " <td>{{ markerLine(evaluate({}))|raw }}</td>",
  169. " <td colspan>{{ trans('unknown') }}</td>",
  170. " </tr>",
  171. " <tr>",
  172. " <td>{{ markerLine(evaluate({ \"maxspeed\": \"walk\" }))|raw }}</td>",
  173. " <td colspan>{{ tagTrans('maxspeed', 'walk') }}</td>",
  174. " </tr>",
  175. " <tr>",
  176. " <td>{{ markerLine(evaluate({ \"maxspeed\": \"none\" }))|raw }}</td>",
  177. " <td>{{ tagTrans('maxspeed', 'none') }}</td>",
  178. " </tr>",
  179. " <tr>",
  180. " <td>{{ markerLine(evaluate({ \"maxspeed\": \"other\" }))|raw }}</td>",
  181. " <td>{{ trans('other') }}</td>",
  182. " </tr>",
  183. "</table>",
  184. "<div style='display: inline-block; width: 49%;'>",
  185. "<table>",
  186. "{% for i in range(10, 140, 20) %}",
  187. " <tr>",
  188. " <td>{{ markerLine(evaluate({ \"maxspeed\": i }))|raw }}</td>",
  189. " <td>{{ i }}km/h</td>",
  190. " </tr>",
  191. "{% endfor %}",
  192. " <tr>",
  193. " <td>{{ markerLine(evaluate({ \"maxspeed\": 150 }))|raw }}</td>",
  194. " <td>≥150km/h</td>",
  195. " </tr>",
  196. "</table>",
  197. "</div>",
  198. "<div style='display: inline-block; width: 49%;'>",
  199. "<table>",
  200. "{% for i in range(10, 60, 10) %}",
  201. " <tr>",
  202. " <td>{{ markerLine(evaluate({ \"maxspeed\": (i * 1.60934)|round }))|raw }}</td>",
  203. " <td>{{ i }}mph</td>",
  204. " </tr>",
  205. "{% endfor %}",
  206. " <tr>",
  207. " <td>{{ markerLine(evaluate({ \"maxspeed\": (75 * 1.60934)|round }))|raw }}</td>",
  208. " <td>75mph</td>",
  209. " </tr>",
  210. " <tr>",
  211. " <td>{{ markerLine(evaluate({ \"maxspeed\": (95 * 1.60934)|round }))|raw }}</td>",
  212. " <td>≥95mph</td>",
  213. " </tr>",
  214. "</table>",
  215. "</div>"
  216. ]
  217. }