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.

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