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.

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