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.

108 lines
3.7 KiB

  1. {
  2. "type": "overpass",
  3. "query": {
  4. "10": "way[highway~'^(motorway|trunk)']",
  5. "12": "way[highway~'^(motorway|trunk|primary)']",
  6. "13": "way[highway~'^(motorway|trunk|primary|secondary)']",
  7. "14": "way[highway~'^(motorway|trunk|primary|secondary|tertiary)']",
  8. "15": "way[highway~'^(motorway|trunk|primary|secondary|tertiary|pedestrian|unclassified)']",
  9. "16": "way[highway~'^(motorway|trunk|primary|secondary|tertiary|pedestrian|unclassified|residential)']",
  10. "17": "way[highway~'^(motorway|trunk|primary|secondary|tertiary|pedestrian|unclassified|residential|living_street|service)']",
  11. "18": "way[highway][highway!~'^(raceway|bus_guideway)$']"
  12. },
  13. "feature": {
  14. "pre": [
  15. "{% set highway = tags.highway %}{% set is_link = false %}",
  16. "{% if tags.highway|matches('_link$') %}",
  17. " {% set highway = tags.highway|slice(0, tags.highway|length - 5) %}{% set is_link = true %}",
  18. "{% endif %}"
  19. ],
  20. "description": "{{ tagTrans('highway', tags.highway) }}",
  21. "priority": "{{ const.priorities[highway]|default(50) + (is_link ? 0.5 : 0) }}",
  22. "markerSymbol": "",
  23. "listMarkerSymbol": "line",
  24. "style": {
  25. "width": "{{ is_link ? 2 : 4 }}",
  26. "color": "{{ const.colors[highway]|default('#ff0000') }}"
  27. }
  28. },
  29. "info": [
  30. "<table>",
  31. "{% for k, color in const.colors %}",
  32. " {% if map.zoom >= const.zooms[k] %}",
  33. " <tr>",
  34. " <td>{{ markerLine({ \"width\": \"4\", \"color\": color })|raw }}</td>",
  35. " <td>{{ tagTrans('highway', k) }}</td>",
  36. " </tr>",
  37. " {% endif %}",
  38. "{% endfor %}",
  39. " <tr>",
  40. " <td>{{ markerLine({ \"width\": \"2\", \"color\": const.colors.motorway })|raw }}</td>",
  41. " <td>{{ tagTrans('highway', 'motorway_link') }}</td>",
  42. " </tr>",
  43. " <tr>",
  44. " <td>{{ markerLine({ \"width\": \"4\", \"color\": \"#ff0000\" })|raw }}</td>",
  45. " <td>{{ trans('invalid value') }}</td>",
  46. " </tr>",
  47. "</table>"
  48. ],
  49. "const": {
  50. "priorities": {
  51. "motorway": 1,
  52. "trunk": 2,
  53. "primary": 10,
  54. "secondary": 11,
  55. "tertiary": 12,
  56. "pedestrian": 20,
  57. "unclassified": 21,
  58. "residential": 22,
  59. "living_street": 23,
  60. "service": 24,
  61. "track": 30,
  62. "escape": 31,
  63. "cycleway": 41,
  64. "bridleway": 42,
  65. "footway": 43,
  66. "path": 44,
  67. "steps": 45
  68. },
  69. "colors": {
  70. "motorway": "#af0000",
  71. "trunk": "#af3f00",
  72. "primary": "#ff3f00",
  73. "secondary": "#ff7f00",
  74. "tertiary": "#ffaf00",
  75. "pedestrian": "#ff00ff",
  76. "unclassified": "#0000ff",
  77. "residential": "#7f00ff",
  78. "living_street": "#af00ff",
  79. "service": "#00007f",
  80. "track": "#bb6300",
  81. "escape": "#bb3300",
  82. "cycleway": "#7faf00",
  83. "bridleway": "#00af7f",
  84. "footway": "#00af00",
  85. "path": "#007f00",
  86. "steps": "#00af00"
  87. },
  88. "zooms": {
  89. "motorway": 10,
  90. "trunk": 10,
  91. "primary": 12,
  92. "secondary": 13,
  93. "tertiary": 14,
  94. "pedestrian": 15,
  95. "unclassified": 15,
  96. "residential": 16,
  97. "living_street": 17,
  98. "service": 17,
  99. "track": 18,
  100. "escape": 18,
  101. "cycleway": 18,
  102. "bridleway": 18,
  103. "footway": 18,
  104. "path": 18,
  105. "steps": 18
  106. }
  107. }
  108. }