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.

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