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.

251 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. "default,{% 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 %}main{% else %}{% if forward %},forward{% endif %}{% if backward %},backward{% endif %}{% endif %}",
  88. "{% endif %}"
  89. ],
  90. "style": {
  91. "color": "#00000000",
  92. "width": "6"
  93. },
  94. "style:main": {
  95. "color": "{{ const[forward].color }}",
  96. "fill": "{% if tags.area == 'yes' %}true{% else %}false{% endif %}",
  97. "width": "{% if tags.area == 'yes' %}0{% else %}{{ const[forward].width }}{% endif %}"
  98. },
  99. "style:forward": {
  100. "width": "0",
  101. "fill": "false",
  102. "pattern": "arrowHead",
  103. "pattern-offset": "29",
  104. "pattern-repeat": "60",
  105. "pattern-polygon": "true",
  106. "pattern-pixelSize": "9",
  107. "pattern-angleCorrection": "0",
  108. "pattern-path-width": "0",
  109. "pattern-path-color": "{{ const[forward].color }}",
  110. "pattern-path-fillOpacity": "1",
  111. "pattern-lineOffset": "0",
  112. "pattern2": "dash",
  113. "pattern2-offset": "13",
  114. "pattern2-repeat": "60",
  115. "pattern2-pixelSize": "22",
  116. "pattern2-path-width": "{{ const[forward].width }}",
  117. "pattern2-path-color": "{{ const[forward].color }}",
  118. "pattern2-lineOffset": "0",
  119. "pattern2-path-lineCap": "butt",
  120. "pattern2-path-fillOpacity": "1"
  121. },
  122. "style:backward": {
  123. "width": "0",
  124. "fill": "false",
  125. "pattern": "arrowHead",
  126. "pattern-offset": "31",
  127. "pattern-repeat": "60",
  128. "pattern-polygon": "true",
  129. "pattern-pixelSize": "9",
  130. "pattern-angleCorrection": "180",
  131. "pattern-path-width": "0",
  132. "pattern-path-color": "{{ const[backward].color }}",
  133. "pattern-path-fillOpacity": "1",
  134. "pattern-lineOffset": "0",
  135. "pattern2": "dash",
  136. "pattern2-offset": "47",
  137. "pattern2-repeat": "60",
  138. "pattern2-pixelSize": "22",
  139. "pattern2-path-width": "{{ const[backward].width }}",
  140. "pattern2-path-color": "{{ const[backward].color }}",
  141. "pattern2-lineOffset": "0",
  142. "pattern2-path-lineCap": "butt",
  143. "pattern2-path-fillOpacity": "1"
  144. },
  145. "style:left_both": {
  146. "width": "{{ const[left].width }}",
  147. "color": "{{ const[left].color }}",
  148. "offset": "{{ -1 - const[left].width / 2 }}"
  149. },
  150. "style:left": {
  151. "width": "0",
  152. "fill": "false",
  153. "pattern": "arrowHead",
  154. "pattern-offset": "{{ left_direction == 'forward' ? 29 : 1 }}",
  155. "pattern-repeat": "60",
  156. "pattern-polygon": "true",
  157. "pattern-pixelSize": "9",
  158. "pattern-angleCorrection": "{{ left_direction == 'forward' ? 0 : 180 }}",
  159. "pattern-path-width": "0",
  160. "pattern-path-color": "{{ const[left].color }}",
  161. "pattern-path-fillOpacity": "1",
  162. "pattern-lineOffset": "{{ -1 - const[left].width / 2 }}",
  163. "pattern2": "dash",
  164. "pattern2-offset": "{{ left_direction == 'forward' ? 13 : 17 }}",
  165. "pattern2-repeat": "60",
  166. "pattern2-pixelSize": "22",
  167. "pattern2-path-width": "{{ const[left].width }}",
  168. "pattern2-path-color": "{{ const[left].color }}",
  169. "pattern2-lineOffset": "{{ -1 - const[left].width / 2 }}",
  170. "pattern2-path-lineCap": "butt",
  171. "pattern2-path-fillOpacity": "1"
  172. },
  173. "style:right": {
  174. "width": "0",
  175. "fill": "false",
  176. "pattern": "arrowHead",
  177. "pattern-offset": "{{ right_direction == 'forward' ? 59 : 31 }}",
  178. "pattern-repeat": "60",
  179. "pattern-polygon": "true",
  180. "pattern-pixelSize": "9",
  181. "pattern-angleCorrection": "{{ right_direction == 'forward' ? 0 : 180 }}",
  182. "pattern-path-width": "0",
  183. "pattern-path-color": "{{ const[right].color }}",
  184. "pattern-path-fillOpacity": "1",
  185. "pattern-lineOffset": "{{ 1 + const[right].width / 2 }}",
  186. "pattern2": "dash",
  187. "pattern2-offset": "{{ right_direction == 'forward' ? 43 : 47 }}",
  188. "pattern2-repeat": "60",
  189. "pattern2-pixelSize": "22",
  190. "pattern2-path-width": "{{ const[right].width }}",
  191. "pattern2-path-color": "{{ const[right].color }}",
  192. "pattern2-lineOffset": "{{ 1 + const[right].width / 2 }}",
  193. "pattern2-path-lineCap": "butt",
  194. "pattern2-path-fillOpacity": "1"
  195. }
  196. },
  197. "info": [
  198. "<table>",
  199. "{% for key, value in const if not value.info_hide %}",
  200. " <tr>",
  201. " <td>{{ markerLine({'width': value.width, 'color': value.color})|raw }}</div></td>",
  202. " <td>{{ tagTrans(value.trans_tag|default('highway'), key) }}</td>",
  203. " </tr>",
  204. "{% endfor %}",
  205. "</table>"
  206. ],
  207. "const": {
  208. "cycleway": {
  209. "width": "2",
  210. "color": "#0000ff"
  211. },
  212. "track": {
  213. "width": "2",
  214. "color": "#7f7f00"
  215. },
  216. "lane": {
  217. "width": "2",
  218. "color": "#7f0000"
  219. },
  220. "share_busway": {
  221. "width": "2",
  222. "color": "#7f007f",
  223. "trans_tag": "cycleway"
  224. },
  225. "footway": {
  226. "width": "2",
  227. "color": "#00af00"
  228. },
  229. "path": {
  230. "width": "2",
  231. "color": "#00af00",
  232. "info_hide": true
  233. },
  234. "pedestrian": {
  235. "width": "4",
  236. "color": "#5faf00"
  237. },
  238. "living_street": {
  239. "width": "4",
  240. "color": "#00afff"
  241. },
  242. "bicycle_road": {
  243. "width": "4",
  244. "color": "#003fff"
  245. },
  246. "shared_lane": {
  247. "width": "4",
  248. "color": "#000000"
  249. }
  250. }
  251. }