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.

247 lines
11 KiB

  1. {
  2. "type": "overpass",
  3. "query": {
  4. "14": [
  5. "(",
  6. "way[highway=cycleway];",
  7. ")"
  8. ],
  9. "16": [
  10. "(",
  11. "way[highway][highway~'^(primary(_link)?|secondary(_link)?|tertiary(_link)?|unclassified|residential|living_street|cycleway|track|road)$'][bicycle!=no];",
  12. "way[bicycle~'^(yes|designated)$'];",
  13. "way[cycleway];",
  14. ")"
  15. ]
  16. },
  17. "feature": {
  18. "pre": [
  19. "{% set forward = false %}",
  20. "{% set backward = false %}",
  21. "{% set cycleway = tags.cycleway|split(';') %}",
  22. "{% set road_type = const[tags.highway] ? tags.highway : 'shared_lane' %}",
  23. "{% if tags.bicycle_road and tags.bicycle_road != 'no' %}{% set road_type = 'bicycle_road' %}{% endif %}",
  24. "{% set oneway = attribute(tags, 'oneway:bicycle')|default(tags.oneway) %}",
  25. "{% if tags.highway == 'path' and tags.bicycle == 'designated' %}{% set road_type = 'cycleway' %}{% endif %}",
  26. "{% if oneway in ['yes', '1'] %}{% set forward = road_type %}{% elseif oneway in ['-1'] %}{% set backward = road_type %}{% else %}{% set forward = road_type %}{% set backward = road_type %}{% endif %}",
  27. "{% for c in cycleway %}",
  28. " {% if c in ['opposite', 'opposite_lane'] %}{% set backward = c|slice(9)|default(road_type) %}{% endif %}",
  29. " {% if c in ['opposite_track'] %}{% set backward = 'cycleway' %}{% endif %}",
  30. " {% if c == 'track' %}{% set c = 'cycleway' %}{% endif %}",
  31. " {% if const[c] %}{% if oneway in ['yes', '1', '-1'] %}{% set forward = c %}{% else %}{% set forward = c %}{% set backward = c %}{% endif %}{% endif %}",
  32. "{% endfor %}",
  33. "",
  34. "{% set left = false %}{% set right = false %}",
  35. "{% set left_direction = 'forward' %}{% set right_direction = 'forward' %}",
  36. "{% if attribute(tags, 'cycleway:left') %}",
  37. " {% set left = attribute(tags, 'cycleway:left') %}",
  38. " {% if left in ['opposite_lane'] %}",
  39. " {% set left = 'lane' %}{% set left_direction = 'backward' %}",
  40. " {% elseif left in ['opposite_track'] %}",
  41. " {% set left = 'cycleway' %}{% set left_direction = 'backward' %}",
  42. " {% elseif left in ['track'] %}",
  43. " {% set left = 'cycleway' %}",
  44. " {% elseif left in ['no'] %}",
  45. " {% set left = 'shared_lane' %}",
  46. " {% endif %}",
  47. " {% if attribute(tags, 'cycleway:left:oneway') == 'no' %}",
  48. " {% set left_direction = 'both' %}",
  49. " {% elseif attribute(tags, 'cycleway:left:oneway') == '-1' %}",
  50. " {% set left_direction = 'backward' %}",
  51. " {% endif %}",
  52. "{% elseif attribute(tags, 'cycleway:right') and (not oneway or oneway == 'no') %}",
  53. " {% set left = 'shared_lane' %}",
  54. "{% endif %}",
  55. "{% if attribute(tags, 'cycleway:right') %}",
  56. " {% set right = attribute(tags, 'cycleway:right') %}",
  57. " {% if right in ['opposite_lane'] %}",
  58. " {% set right = 'lane' %}{% set right_direction = 'backward' %}",
  59. " {% elseif right in ['opposite_track'] %}",
  60. " {% set right = 'cycleway' %}{% set right_direction = 'backward' %}",
  61. " {% elseif right in ['track'] %}",
  62. " {% set right = 'cycleway' %}",
  63. " {% elseif right in ['no'] %}",
  64. " {% set right = 'shared_lane' %}",
  65. " {% endif %}",
  66. " {% if attribute(tags, 'cycleway:right:oneway') == 'no' %}",
  67. " {% set right_direction = 'both' %}",
  68. " {% elseif attribute(tags, 'cycleway:right:oneway') == '-1' %}",
  69. " {% set right_direction = 'backward' %}",
  70. " {% endif %}",
  71. "{% elseif attribute(tags, 'cycleway:left') and (not oneway or oneway == 'no') %}",
  72. " {% set right = 'shared_lane' %}",
  73. "{% endif %}"
  74. ],
  75. "body": [
  76. "{{ keyTrans('highway') }}: {{ tagTrans('highway', tags.highway) }}<br>",
  77. "{% if tags.cycleway %}{{ keyTrans('cycleway') }}: {% for c in cycleway %}{{ tagTrans('cycleway', c) }} {% endfor %}<br>{% endif %}",
  78. "{% if tags.surface %}{{ keyTrans('surface') }}: {{ tagTrans('surface', tags.surface) }}<br>{% endif %}"
  79. ],
  80. "markerSymbol": null,
  81. "listMarkerSymbol": "line",
  82. "styles": [
  83. "{% if left or right %}",
  84. " {% if left and left_direction == 'both' %},left_both{% elseif left %},left{% endif %}",
  85. " {% if right and right_direction == 'both' %},right_both{% elseif right %},right{% endif %}",
  86. "{% else %}",
  87. " {% if forward and backward and forward == backward %}default{% else %}{% if forward %},forward{% endif %}{% if backward %},backward{% endif %}{% endif %}",
  88. "{% endif %}"
  89. ],
  90. "style": {
  91. "color": "{{ const[forward].color }}",
  92. "fill": "{% if tags.area == 'yes' %}true{% else %}false{% endif %}",
  93. "width": "{% if tags.area == 'yes' %}0{% else %}{{ const[forward].width }}{% endif %}"
  94. },
  95. "style:forward": {
  96. "width": "0",
  97. "fill": "false",
  98. "pattern": "arrowHead",
  99. "pattern-offset": "8",
  100. "pattern-repeat": "60",
  101. "pattern-polygon": "true",
  102. "pattern-pixelSize": "9",
  103. "pattern-angleCorrection": "0",
  104. "pattern-path-width": "0",
  105. "pattern-path-color": "{{ const[forward].color }}",
  106. "pattern-path-fillOpacity": "1",
  107. "pattern-lineOffset": "0",
  108. "pattern2": "dash",
  109. "pattern2-offset": "50",
  110. "pattern2-repeat": "60",
  111. "pattern2-pixelSize": "22",
  112. "pattern2-path-width": "{{ const[forward].width }}",
  113. "pattern2-path-color": "{{ const[forward].color }}",
  114. "pattern2-lineOffset": "0",
  115. "pattern2-path-lineCap": "butt",
  116. "pattern2-path-fillOpacity": "1"
  117. },
  118. "style:backward": {
  119. "width": "0",
  120. "fill": "false",
  121. "pattern": "arrowHead",
  122. "pattern-offset": "10",
  123. "pattern-repeat": "60",
  124. "pattern-polygon": "true",
  125. "pattern-pixelSize": "9",
  126. "pattern-angleCorrection": "180",
  127. "pattern-path-width": "0",
  128. "pattern-path-color": "{{ const[backward].color }}",
  129. "pattern-path-fillOpacity": "1",
  130. "pattern-lineOffset": "0",
  131. "pattern2": "dash",
  132. "pattern2-offset": "25",
  133. "pattern2-repeat": "60",
  134. "pattern2-pixelSize": "22",
  135. "pattern2-path-width": "{{ const[backward].width }}",
  136. "pattern2-path-color": "{{ const[backward].color }}",
  137. "pattern2-lineOffset": "0",
  138. "pattern2-path-lineCap": "butt",
  139. "pattern2-path-fillOpacity": "1"
  140. },
  141. "style:left_both": {
  142. "width": "{{ const[left].width }}",
  143. "color": "{{ const[left].color }}",
  144. "offset": "{{ -1 - const[left].width / 2 }}"
  145. },
  146. "style:left": {
  147. "width": "0",
  148. "fill": "false",
  149. "pattern": "arrowHead",
  150. "pattern-offset": "{{ left_direction == 'forward' ? 8 : 10 }}",
  151. "pattern-repeat": "60",
  152. "pattern-polygon": "true",
  153. "pattern-pixelSize": "9",
  154. "pattern-angleCorrection": "{{ left_direction == 'forward' ? 0 : 180 }}",
  155. "pattern-path-width": "0",
  156. "pattern-path-color": "{{ const[left].color }}",
  157. "pattern-path-fillOpacity": "1",
  158. "pattern-lineOffset": "{{ -1 - const[left].width / 2 }}",
  159. "pattern2": "dash",
  160. "pattern2-offset": "{{ left_direction == 'forward' ? 50 : 25 }}",
  161. "pattern2-repeat": "60",
  162. "pattern2-pixelSize": "22",
  163. "pattern2-path-width": "{{ const[left].width }}",
  164. "pattern2-path-color": "{{ const[left].color }}",
  165. "pattern2-lineOffset": "{{ -1 - const[left].width / 2 }}",
  166. "pattern2-path-lineCap": "butt",
  167. "pattern2-path-fillOpacity": "1"
  168. },
  169. "style:right": {
  170. "width": "0",
  171. "fill": "false",
  172. "pattern": "arrowHead",
  173. "pattern-offset": "{{ right_direction == 'forward' ? 8 : 10 }}",
  174. "pattern-repeat": "60",
  175. "pattern-polygon": "true",
  176. "pattern-pixelSize": "9",
  177. "pattern-angleCorrection": "{{ right_direction == 'forward' ? 0 : 180 }}",
  178. "pattern-path-width": "0",
  179. "pattern-path-color": "{{ const[right].color }}",
  180. "pattern-path-fillOpacity": "1",
  181. "pattern-lineOffset": "{{ 1 + const[right].width / 2 }}",
  182. "pattern2": "dash",
  183. "pattern2-offset": "{{ right_direction == 'forward' ? 50 : 25 }}",
  184. "pattern2-repeat": "60",
  185. "pattern2-pixelSize": "22",
  186. "pattern2-path-width": "{{ const[right].width }}",
  187. "pattern2-path-color": "{{ const[right].color }}",
  188. "pattern2-lineOffset": "{{ 1 + const[right].width / 2 }}",
  189. "pattern2-path-lineCap": "butt",
  190. "pattern2-path-fillOpacity": "1"
  191. }
  192. },
  193. "info": [
  194. "<table>",
  195. "{% for key, value in const if not value.info_hide %}",
  196. " <tr>",
  197. " <td>{{ markerLine({'width': value.width, 'color': value.color})|raw }}</div></td>",
  198. " <td>{{ tagTrans(value.trans_tag|default('highway'), key) }}</td>",
  199. " </tr>",
  200. "{% endfor %}",
  201. "</table>"
  202. ],
  203. "const": {
  204. "cycleway": {
  205. "width": "2",
  206. "color": "#0000ff"
  207. },
  208. "track": {
  209. "width": "2",
  210. "color": "#7f7f00"
  211. },
  212. "lane": {
  213. "width": "2",
  214. "color": "#7f0000"
  215. },
  216. "share_busway": {
  217. "width": "2",
  218. "color": "#7f007f",
  219. "trans_tag": "cycleway"
  220. },
  221. "footway": {
  222. "width": "2",
  223. "color": "#00af00"
  224. },
  225. "path": {
  226. "width": "2",
  227. "color": "#00af00",
  228. "info_hide": true
  229. },
  230. "pedestrian": {
  231. "width": "4",
  232. "color": "#5faf00"
  233. },
  234. "living_street": {
  235. "width": "4",
  236. "color": "#00afff"
  237. },
  238. "bicycle_road": {
  239. "width": "4",
  240. "color": "#003fff"
  241. },
  242. "shared_lane": {
  243. "width": "4",
  244. "color": "#000000"
  245. }
  246. }
  247. }