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.

549 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 = '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.footway.color }}
  167. width: |
  168. {% if tags.segregated == 'yes' %}
  169. {{ const.types.footway.width / 2 }}
  170. {% else %}
  171. {{ const.types.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.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. <ul>
  308. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}</li>
  309. </ul>
  310. </li>
  311. {% endif %}
  312. {% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %}
  313. <li>
  314. {{ keyTrans('cycleway:width') }}:
  315. {% if not attribute(tags, 'cycleway:width') %}
  316. {{ trans('unknown') }}
  317. {% elseif attribute(tags, 'cycleway:width') matches "/(m|')$/" %}
  318. {{ attribute(tags, 'cycleway:width') }}
  319. {% else %}
  320. {{ attribute(tags, 'cycleway:width') }}m
  321. {% endif %}
  322. </li>
  323. {% endif %}
  324. {% if leftCycle and attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
  325. <li>{{ keyTrans('cycleway:left') }}:
  326. {% if const.types[leftCycle].warning %}
  327. <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>
  328. {% elseif not const.types[leftCycle] %}
  329. <div class='warning'>Invalid tag cycleway:left={{ attribute(tags, 'cycleway:left') }}.</div>
  330. {% endif %}
  331. <ul>
  332. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
  333. <li>
  334. {{ keyTrans('cycleway:width') }}:
  335. {% if not leftWidth %}
  336. {{ trans('unknown') }}
  337. {% elseif attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %}
  338. {{ attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) }}
  339. {% else %}
  340. {{ leftWidth }}m
  341. {% endif %}
  342. </li>
  343. </ul></li>
  344. {% elseif attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
  345. <li>{{ keyTrans('cycleway:left') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
  346. {% endif %}
  347. {% if rightCycle and attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
  348. <li>{{ keyTrans('cycleway:right') }}:
  349. {% if const.types[rightCycle].warning %}
  350. <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>
  351. {% elseif not const.types[rightCycle] %}
  352. <div class='warning'>Invalid tag cycleway:right={{ attribute(tags, 'cycleway:right') }}.</div>
  353. <div class='warning'>Unknown</div>
  354. {% endif %}
  355. <ul>
  356. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
  357. <li>
  358. {{ keyTrans('cycleway:width') }}:
  359. {% if not rightWidth %}
  360. {{ trans('unknown') }}
  361. {% elseif attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %}
  362. {{ attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) }}
  363. {% else %}
  364. {{ rightWidth }}m
  365. {% endif %}
  366. </li>
  367. </ul></li>
  368. {% elseif attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
  369. <li>{{ keyTrans('cycleway:right') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
  370. {% endif %}
  371. </ul>
  372. markerSymbol: ''
  373. listMarkerSymbol: line
  374. info: |
  375. <table>
  376. <tr>
  377. <th>Symbol</th>
  378. <th></th>
  379. </tr>
  380. {% for k, v in const.types %}
  381. {% if not v.hideInfo %}
  382. <tr>
  383. <td>
  384. {{ markerLine({ width: v.width|default(4), color: v.color }) }}
  385. </td>
  386. <td>
  387. {% set label = v.label|default(k|split('=') > 1 ? k : ('cycleway=' ~ k)) %}
  388. {% if label|split('=') > 1 %}
  389. {{ tagTrans(label|split('=')[0], label|split('=')[1]) }}
  390. {% else %}
  391. {{ keyTrans(label) }}
  392. {% endif %}
  393. </td>
  394. </tr>
  395. {% endif %}
  396. {% endfor %}
  397. {% for k, v in const.otherInfrastructure %}
  398. <tr>
  399. <td>
  400. {{ markerLine(evaluate({ highway: 'cycleway', cycleway: k })) }}
  401. </td>
  402. <td>
  403. {{ tagTrans('cycleway', k) }}
  404. </td>
  405. </tr>
  406. {% endfor %}
  407. <tr>
  408. <td>
  409. {{ markerLine({ width: 4, color: '#ff0000' }) }}
  410. </td>
  411. <td>
  412. Deprecated or invalid tag!
  413. </td>
  414. </tr>
  415. </table>
  416. const:
  417. types:
  418. cyclestreet:
  419. color: '#006f3f'
  420. width: 8
  421. label: cyclestreet
  422. bicycle_road:
  423. color: '#006f4f'
  424. width: 8
  425. label: bicycle_road
  426. highway=living_street:
  427. color: '#ff9f00'
  428. width: 8
  429. cycleway:
  430. color: '#009f00'
  431. width: 4
  432. footway:
  433. color: '#ff9f00'
  434. width: 4
  435. lane:
  436. color: '#00df3f'
  437. track:
  438. color: '#009f00'
  439. shared:
  440. color: '#ff0000'
  441. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=lane, cycleway:oneway=-1 instead.'
  442. hideInfo: true
  443. shared_lane:
  444. color: '#003faf'
  445. share_busway:
  446. color: '#007faf'
  447. shoulder:
  448. color: '#7f00ff'
  449. opposite:
  450. color: '#ff0000'
  451. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.'
  452. hideInfo: true
  453. opposite_lane:
  454. color: '#ff0000'
  455. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.'
  456. hideInfo: true
  457. opposite_share_busway:
  458. color: '#ff0000'
  459. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=share_busway, cycleway:%other_driving_side%:oneway=-1 instead.'
  460. hideInfo: true
  461. opposite_track:
  462. color: '#ff0000'
  463. warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=track, cycleway:%other_driving_side%:oneway=-1 instead.'
  464. hideInfo: true
  465. otherInfrastructure:
  466. crossing:
  467. extraWidth: 4
  468. lineCap: butt
  469. dashArray: '4,4'
  470. color: black
  471. traffic_island:
  472. extraWidth: 2
  473. lineCap: butt
  474. color: 'black'
  475. hiddenTypes:
  476. 'no': true
  477. 'yes': true
  478. separate: true
  479. sidepath: true
  480. link: true