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.

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