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.

553 lines
16 KiB

  1. query:
  2. (
  3. way[highway=cycleway];
  4. way[cyclestreet=yes];
  5. way[bicycle_road=yes];
  6. way[highway=path][bicycle][bicycle!=no];
  7. way[highway=living_street];
  8. way["cycleway"]["cycleway"!~"(no|separate)"];
  9. way["cycleway:left"]["cycleway:left"!~"(no|separate)"];
  10. way["cycleway:right"]["cycleway:right"!~"(no|separate)"];
  11. way["cycleway:both"]["cycleway:both"!~"(no|separate)"];
  12. )
  13. feature:
  14. pre: |
  15. {% set type = tags.highway %}
  16. {% if tags.highway == 'path' and tags.bicycle and tags.bicycle != 'no' %}
  17. {% set type = 'highway=cycleway' %}
  18. {% endif %}
  19. {% if tags.cyclestreet == 'yes' %}
  20. {% set type = 'cyclestreet' %}
  21. {% elseif tags.bicycle_road in ['yes', 'designated'] %}
  22. {% set type = 'bicycle_road' %}
  23. {% elseif tags.highway and const.types['highway=' ~ tags.highway] %}
  24. {% set type = 'highway=' ~ tags.highway %}
  25. {% endif %}
  26. {% set mainOneway = tags.oneway %}
  27. {% if mainOneway == 'yes' %}
  28. {% set mainOneway = 1 %}
  29. {% elseif mainOneway == 'no' %}
  30. {% set mainOneway = 0 %}
  31. {% endif %}
  32. {% set oneway = attribute(tags, 'oneway:bicycle')|default(tags.oneway) %}
  33. {% if oneway == 'yes' %}
  34. {% set oneway = 1 %}
  35. {% elseif oneway == 'no' %}
  36. {% set oneway = 0 %}
  37. {% endif %}
  38. {% set leftCycle = '' %}{% set rightCycle = '' %}
  39. {% if tags.cycleway %}
  40. {% if const.otherInfrastructure[tags.cycleway] %}
  41. {# skip #}
  42. {% elseif (tags.oneway in ['yes', 1] and map.driving_side == 'right') or (tags.oneway in [-1] and map.driving_side == 'left') %}
  43. {{ tags.cycleway|debug }}
  44. {% if tags.cycleway matches '/^opposite/' %}
  45. {% set leftCycle = tags.cycleway %}
  46. {% else %}
  47. {% set rightCycle = tags.cycleway %}
  48. {% endif %}
  49. {% elseif (tags.oneway in ['yes', 1] and map.driving_side == 'left') or (tags.oneway in [-1] and map.driving_side == 'right') %}
  50. {% if tags.cycleway matches '/^opposite/' %}
  51. {% set rightCycle = tags.cycleway %}
  52. {% else %}
  53. {% set leftCycle = tags.cycleway %}
  54. {% endif %}
  55. {% else %}
  56. {% set leftCycle = tags.cycleway %}
  57. {% set rightCycle = tags.cycleway %}
  58. {% endif %}
  59. {% endif %}
  60. {% set leftCycle1 = attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
  61. {% if leftCycle1 %}{% set leftCycle = leftCycle1 %}{% endif %}
  62. {% if const.hiddenTypes[leftCycle] %}
  63. {% set leftCycle = '' %}
  64. {% endif %}
  65. {% set leftOneway = attribute(tags, 'cycleway:left:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %}
  66. {% if not leftOneway or leftOneway in ['yes'] %}
  67. {% set leftOneway = map.driving_side == 'left' ? 1 : -1 %}
  68. {% elseif leftOneway in ['no'] %}
  69. {% set leftOneway = 0 %}
  70. {% endif %}
  71. {% set rightCycle1 = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
  72. {% if rightCycle1 %}{% set rightCycle = rightCycle1 %}{% endif %}
  73. {% if const.hiddenTypes[rightCycle] %}
  74. {% set rightCycle = '' %}
  75. {% endif %}
  76. {% set rightOneway = attribute(tags, 'cycleway:right:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %}
  77. {% if not rightOneway or rightOneway in ['yes'] %}
  78. {% set rightOneway = map.driving_side == 'left' ? -1 : 1 %}
  79. {% elseif rightOneway in ['no'] %}
  80. {% set rightOneway = 0 %}
  81. {% endif %}
  82. {% if mainOneway and ((not rightCycle and mainOneway == rightOneway) or (not leftCycle and mainOneway == leftOneway)) %}
  83. {% set oneway = mainOneway %}
  84. {% elseif mainOneway == oneway and ((rightCycle and mainOneway == rightOneway) or (leftCycle and mainOneway == leftOneway)) %}
  85. {% set oneway = 0 %}
  86. {% endif %}
  87. {% if oneway and attribute(tags, 'oneway:bicycle') == 'no' and not rightCycle and not leftCycle %}
  88. {% set oneway = 0 %}
  89. {% endif %}
  90. styles: |
  91. {% if tags.bridge and tags.bridge != 'no' %}
  92. bridge_outer,bridge_inner,
  93. {% endif %}
  94. {% if const.otherInfrastructure[tags.cycleway|default(tags.path)] %}
  95. other,
  96. {% endif %}
  97. {% if tags.segregated %}
  98. footway,
  99. {% endif %}
  100. default
  101. {% if leftCycle %}
  102. ,left
  103. {% endif %}
  104. {% if rightCycle %}
  105. ,right
  106. {% endif %}
  107. style:
  108. width: |
  109. {% if tags.segregated == 'yes' %}
  110. {{ const.types[type].width / 2 }}
  111. {% else %}
  112. {{ const.types[type].width }}
  113. {% endif %}
  114. dashArray: |
  115. {% if oneway and tags.segregated == 'no' %}
  116. 5,5,5,20
  117. {% elseif oneway %}
  118. 25,10
  119. {% elseif tags.segregated == 'no' %}
  120. 5,5
  121. {% endif %}
  122. dashOffset: |
  123. {% if oneway and tags.segregated == 'no' %}
  124. 5
  125. {% elseif oneway %}
  126. 10
  127. {% elseif tags.segregated == 'no' %}
  128. 0
  129. {% endif %}
  130. lineCap: |
  131. {% if tags.segregated == 'no' or oneway %}
  132. butt
  133. {% else %}
  134. round
  135. {% endif %}
  136. color: |
  137. {{ const.types[type].color }}
  138. offset: |
  139. {% if tags.segregated == 'yes' %}
  140. {{ const.types[type].width / 2 - 1 }}
  141. {% else %}
  142. 0
  143. {% endif %}
  144. pattern: |
  145. {% if oneway -%}
  146. arrowHead
  147. {%- endif %}
  148. pattern-repeat: |
  149. 35
  150. pattern-offset: |
  151. {{ oneway == -1 ? 17 : 22 }}
  152. noClip: |
  153. {{ oneway != 0 }}
  154. pattern-polygon: true
  155. pattern-pixelSize: 9
  156. pattern-angleCorrection: |
  157. {{ oneway == -1 ? 180 : 0 }}
  158. pattern-path-color: |
  159. {{ const.types[type].color }}
  160. pattern-path-width: 0
  161. pattern-path-fillOpacity: 1
  162. zIndex: |-
  163. {{ tags.layer|default(0) }}
  164. style:footway:
  165. color: |
  166. {{ const.types['highway=footway'].color }}
  167. width: |
  168. {% if tags.segregated == 'yes' %}
  169. {{ const.types['highway=footway'].width / 2 }}
  170. {% else %}
  171. {{ const.types['highway=footway'].width }}
  172. {% endif %}
  173. dashArray: |
  174. {% if oneway and tags.segregated == 'no' %}
  175. 5,5,5,5,5,10
  176. {% elseif oneway %}
  177. 25,10
  178. {% elseif tags.segregated == 'no' %}
  179. 5,5
  180. {% endif %}
  181. dashOffset: |
  182. {% if oneway %}
  183. 10
  184. {% elseif tags.segregated == 'no' %}
  185. 5
  186. {% endif %}
  187. noClip: |
  188. {{ oneway != 0 }}
  189. lineCap: |
  190. {% if tags.segregated == 'no' or oneway %}
  191. butt
  192. {% else %}
  193. round
  194. {% endif %}
  195. offset: |
  196. {% if tags.segregated == 'yes' %}
  197. {{ (const.types['highway=footway'].width / 2 - 1) * -1 }}
  198. {% endif %}
  199. zIndex: |-
  200. {{ tags.layer|default(0) }}
  201. style:left:
  202. offset: -5
  203. color: |
  204. {{ const.types[leftCycle].color|default('#ff0000') }}
  205. width: 3
  206. lineCap: |
  207. {{ leftOneway ? 'butt' : 'round' }}
  208. dashArray: |
  209. {{ leftOneway ? '27,8' : '' }}
  210. dashOffset: |
  211. {{ leftOneway == -1 ? 28 : 0 }}
  212. noClip: true
  213. # {{ leftOneway }}
  214. pattern: |
  215. {% if leftOneway %}arrowHead{% endif %}
  216. pattern-offset: |
  217. {{ leftOneway == -1 ? 4 : 30.5 }}
  218. pattern-lineOffset: -5
  219. pattern-repeat: 35
  220. pattern-polygon: true
  221. pattern-pixelSize: 9
  222. pattern-angleCorrection: |
  223. {{ leftOneway == -1 ? 180 : 0 }}
  224. pattern-path-width: 0
  225. pattern-path-color: |
  226. {{ const.types[leftCycle].color|default('#ff0000') }}
  227. pattern-path-fillOpacity: 1
  228. zIndex: |-
  229. {{ tags.layer|default(0) }}
  230. style:right:
  231. offset: 5
  232. color: |
  233. {{ const.types[rightCycle].color|default('#ff0000') }}
  234. width: 3
  235. lineCap: |
  236. {{ rightOneway ? 'butt' : 'round' }}
  237. dashArray: |
  238. {{ rightOneway ? '27,8' : '' }}
  239. dashOffset: |
  240. {{ rightOneway == -1 ? 28 : 0 }}
  241. noClip: true
  242. # {{ rightOneway }}
  243. pattern: |
  244. {% if rightOneway %}arrowHead{% endif %}
  245. pattern-offset: |
  246. {{ rightOneway == -1 ? 4 : 30.5 }}
  247. pattern-lineOffset: 5
  248. pattern-repeat: 35
  249. pattern-polygon: true
  250. pattern-pixelSize: 9
  251. pattern-angleCorrection: |
  252. {{ rightOneway == -1 ? 180 : 0 }}
  253. pattern-path-width: 0
  254. pattern-path-color: |
  255. {{ const.types[rightCycle].color|default('#ff0000') }}
  256. pattern-path-fillOpacity: 1
  257. zIndex: |-
  258. {{ tags.layer|default(0) }}
  259. style:other:
  260. width: |
  261. {{ const.types[type].width + const.otherInfrastructure[tags.cycleway].extraWidth }}
  262. color: |
  263. {{ const.otherInfrastructure[tags.cycleway].color }}
  264. lineCap: |
  265. {{ const.otherInfrastructure[tags.cycleway].lineCap|default('round') }}
  266. dashArray: |
  267. {{ const.otherInfrastructure[tags.cycleway].dashArray|default('') }}
  268. offset: 0
  269. zIndex: |-
  270. {{ tags.layer|default(0) - 0.1 }}
  271. style:bridge_outer:
  272. width: |
  273. {{ const.types[type].width|default(5) + 8 }}
  274. color: black
  275. lineCap: butt
  276. zIndex: |-
  277. {{ tags.layer|default(0) - 0.21 }}
  278. style:bridge_inner:
  279. width: |
  280. {{ const.types[type].width|default(5) + 4 }}
  281. color: white
  282. lineCap: butt
  283. zIndex: |-
  284. {{ tags.layer|default(0) - 0.2 }}
  285. description: |
  286. {% if tags.cyclestreet == 'yes' %}
  287. {{ keyTrans('cyclestreet') }}
  288. {% elseif tags.bicycle_road in ['yes', 'designated'] %}
  289. {{ keyTrans('bicycle_road') }}
  290. {% elseif tags.highway and const.types['highway=' ~ tags.highway] %}
  291. {{ tagTrans('highway', tags.highway) }}
  292. {% elseif tags.segregated %}
  293. {{ tagTrans('highway', 'cycleway segregated=' ~ tags.segregated) }}
  294. {% elseif tags.highway %}
  295. {{ tagTrans('highway', tags.highway) }}
  296. {% endif %}
  297. body: |
  298. <ul>
  299. {% if const.otherInfrastructure[tags.cycleway] %}
  300. <li>
  301. {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}
  302. </li>
  303. {% elseif tags.cycleway and tags.cycleway != 'yes' %}
  304. <li>
  305. {{ keyTrans('cycleway') }}:
  306. <div class='warning'>Recommendation: Indicate side of way by using 'cycleway:left' and/or 'cycleway:right'.</div>
  307. {% if const.types[tags.cycleway].warning %}
  308. <div class='warning'>{{ const.types[tags.cycleway].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'both'}) }}</div>
  309. {% endif %}
  310. <ul>
  311. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}</li>
  312. </ul>
  313. </li>
  314. {% endif %}
  315. {% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %}
  316. <li>
  317. {{ keyTrans('cycleway:width') }}:
  318. {% if not attribute(tags, 'cycleway:width') %}
  319. {{ trans('unknown') }}
  320. {% elseif attribute(tags, 'cycleway:width') matches "/(m|')$/" %}
  321. {{ attribute(tags, 'cycleway:width') }}
  322. {% else %}
  323. {{ attribute(tags, 'cycleway:width') }}m
  324. {% endif %}
  325. </li>
  326. {% endif %}
  327. {% if leftCycle and attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
  328. <li>{{ keyTrans('cycleway:left') }}:
  329. {% if const.types[leftCycle].warning %}
  330. <div class='warning'>{{ const.types[leftCycle].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'left'}) }}</div>
  331. {% elseif not const.types[leftCycle] %}
  332. <div class='warning'>Invalid tag cycleway:left={{ attribute(tags, 'cycleway:left') }}.</div>
  333. {% endif %}
  334. <ul>
  335. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
  336. <li>
  337. {{ keyTrans('cycleway:width') }}:
  338. {% if not leftWidth %}
  339. {{ trans('unknown') }}
  340. {% elseif attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %}
  341. {{ attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) }}
  342. {% else %}
  343. {{ leftWidth }}m
  344. {% endif %}
  345. </li>
  346. </ul></li>
  347. {% elseif attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
  348. <li>{{ keyTrans('cycleway:left') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
  349. {% endif %}
  350. {% if rightCycle and attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
  351. <li>{{ keyTrans('cycleway:right') }}:
  352. {% if const.types[rightCycle].warning %}
  353. <div class='warning'>{{ const.types[rightCycle].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'right'}) }}</div>
  354. {% elseif not const.types[rightCycle] %}
  355. <div class='warning'>Invalid tag cycleway:right={{ attribute(tags, 'cycleway:right') }}.</div>
  356. <div class='warning'>Unknown</div>
  357. {% endif %}
  358. <ul>
  359. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
  360. <li>
  361. {{ keyTrans('cycleway:width') }}:
  362. {% if not rightWidth %}
  363. {{ trans('unknown') }}
  364. {% elseif attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %}
  365. {{ attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) }}
  366. {% else %}
  367. {{ rightWidth }}m
  368. {% endif %}
  369. </li>
  370. </ul></li>
  371. {% elseif attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
  372. <li>{{ keyTrans('cycleway:right') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
  373. {% endif %}
  374. </ul>
  375. markerSymbol: ''
  376. listMarkerSymbol: line
  377. info: |
  378. <table>
  379. <tr>
  380. <th>Symbol</th>
  381. <th></th>
  382. </tr>
  383. {% for k, v in const.types %}
  384. {% if not v.hideInfo %}
  385. <tr>
  386. <td>
  387. {{ markerLine({ width: v.width|default(4), color: v.color }) }}
  388. </td>
  389. <td>
  390. {% set label = v.label|default(k|split('=') > 1 ? k : ('cycleway=' ~ k)) %}
  391. {% if label|split('=') > 1 %}
  392. {{ tagTrans(label|split('=')[0], label|split('=')[1]) }}
  393. {% else %}
  394. {{ keyTrans(label) }}
  395. {% endif %}
  396. </td>
  397. </tr>
  398. {% endif %}
  399. {% endfor %}
  400. {% for k, v in const.otherInfrastructure %}
  401. <tr>
  402. <td>
  403. {{ markerLine(evaluate({ highway: 'cycleway', cycleway: k })) }}
  404. </td>
  405. <td>
  406. {{ tagTrans('cycleway', k) }}
  407. </td>
  408. </tr>
  409. {% endfor %}
  410. <tr>
  411. <td>
  412. {{ markerLine({ width: 4, color: '#ff0000' }) }}
  413. </td>
  414. <td>
  415. Deprecated or invalid tag!
  416. </td>
  417. </tr>
  418. </table>
  419. const:
  420. types:
  421. cyclestreet:
  422. color: '#006f3f'
  423. width: 8
  424. label: cyclestreet
  425. bicycle_road:
  426. color: '#006f4f'
  427. width: 8
  428. label: bicycle_road
  429. highway=living_street:
  430. color: '#ff9f00'
  431. width: 8
  432. highway=cycleway:
  433. color: '#009f00'
  434. width: 4
  435. highway=footway:
  436. color: '#ff9f00'
  437. width: 4
  438. lane:
  439. color: '#00df3f'
  440. track:
  441. color: '#009f00'
  442. shared:
  443. color: '#ff0000'
  444. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=lane, cycleway:oneway=-1 instead.'
  445. hideInfo: true
  446. shared_lane:
  447. color: '#003faf'
  448. share_busway:
  449. color: '#007faf'
  450. shoulder:
  451. color: '#7f00ff'
  452. opposite:
  453. color: '#ff0000'
  454. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.'
  455. hideInfo: true
  456. opposite_lane:
  457. color: '#ff0000'
  458. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.'
  459. hideInfo: true
  460. opposite_share_busway:
  461. color: '#ff0000'
  462. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=share_busway, cycleway:%other_driving_side%:oneway=-1 instead.'
  463. hideInfo: true
  464. opposite_track:
  465. color: '#ff0000'
  466. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=track, cycleway:%other_driving_side%:oneway=-1 instead.'
  467. hideInfo: true
  468. otherInfrastructure:
  469. crossing:
  470. extraWidth: 4
  471. lineCap: butt
  472. dashArray: '4,4'
  473. color: black
  474. traffic_island:
  475. extraWidth: 2
  476. lineCap: butt
  477. color: 'black'
  478. hiddenTypes:
  479. 'no': true
  480. 'yes': true
  481. separate: true
  482. sidepath: true
  483. link: true