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.

328 lines
8.4 KiB

  1. query:
  2. (
  3. way[highway=cycleway];
  4. way[cyclestreet=yes];
  5. way[bicycle_road=yes];
  6. way["cycleway:left"]["cycleway:left"!~"(no|separate)"];
  7. way["cycleway:right"]["cycleway:right"!~"(no|separate)"];
  8. way["cycleway:both"]["cycleway:both"!~"(no|separate)"];
  9. )
  10. feature:
  11. pre: |
  12. {% set type = tags.highway %}
  13. {% if tags.cyclestreet == 'yes' %}
  14. {% set type = 'cyclestreet' %}
  15. {% elseif tags.bicycle_road in ['yes', 'designated'] %}
  16. {% set type = 'bicycle_road' %}
  17. {% endif %}
  18. {% set oneway = attribute(tags, 'oneway:bicycle')|default(tags.oneway) %}
  19. {% if oneway == 'yes' %}
  20. {% set oneway = 1 %}
  21. {% elseif oneway == 'no' %}
  22. {% set oneway = 0 %}
  23. {% endif %}
  24. {% set leftCycle = attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
  25. {% if leftCycle in ['no', 'separate'] %}
  26. {% set leftCycle = '' %}
  27. {% endif %}
  28. {% set leftOneway = attribute(tags, 'cycleway:left:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %}
  29. {% if not leftOneway or leftOneway in ['yes'] %}
  30. {% set leftOneway = map.driving_side == 'left' ? 1 : -1 %}
  31. {% elseif leftOneway in ['no'] %}
  32. {% set leftOneway = 0 %}
  33. {% endif %}
  34. {% set rightCycle = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
  35. {% if rightCycle in ['no', 'separate'] %}
  36. {% set rightCycle = '' %}
  37. {% endif %}
  38. {% set rightOneway = attribute(tags, 'cycleway:right:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %}
  39. {% if not rightOneway or rightOneway in ['yes'] %}
  40. {% set rightOneway = map.driving_side == 'left' ? -1 : 1 %}
  41. {% elseif rightOneway in ['no'] %}
  42. {% set rightOneway = 0 %}
  43. {% endif %}
  44. styles: |
  45. {% if tags.segregated %}
  46. footway,
  47. {% endif %}
  48. default
  49. {% if leftCycle %}
  50. ,left
  51. {% endif %}
  52. {% if rightCycle %}
  53. ,right
  54. {% endif %}
  55. style:
  56. width: |
  57. {% if tags.segregated == 'yes' %}
  58. {{ const.types[type].width / 2 }}
  59. {% else %}
  60. {{ const.types[type].width }}
  61. {% endif %}
  62. dashArray: |
  63. {% if oneway and tags.segregated == 'no' %}
  64. 5,5,5,20
  65. {% elseif oneway %}
  66. 25,10
  67. {% elseif tags.segregated == 'no' %}
  68. 5,5
  69. {% endif %}
  70. dashOffset: |
  71. {% if oneway and tags.segregated == 'no' %}
  72. 5
  73. {% elseif oneway %}
  74. 10
  75. {% elseif tags.segregated == 'no' %}
  76. 0
  77. {% endif %}
  78. lineCap: |
  79. {% if tags.segregated == 'no' or oneway %}
  80. butt
  81. {% else %}
  82. round
  83. {% endif %}
  84. color: |
  85. {{ const.types[type].color }}
  86. offset: |
  87. {% if tags.segregated == 'yes' %}
  88. {{ const.types[type].width / 2 - 1 }}
  89. {% endif %}
  90. pattern: |
  91. {% if oneway -%}
  92. arrowHead
  93. {%- endif %}
  94. pattern-repeat: |
  95. 35
  96. pattern-offset: |
  97. {{ oneway == -1 ? 17 : 22 }}
  98. noClip: |
  99. {{ oneway != 0 }}
  100. pattern-polygon: true
  101. pattern-pixelSize: 9
  102. pattern-angleCorrection: |
  103. {{ oneway == -1 ? 180 : 0 }}
  104. pattern-path-color: |
  105. {{ const.types[type].color }}
  106. pattern-path-width: 0
  107. pattern-path-fillOpacity: 1
  108. style:footway:
  109. color: |
  110. {{ const.types.footway.color }}
  111. width: |
  112. {% if tags.segregated == 'yes' %}
  113. {{ const.types.footway.width / 2 }}
  114. {% else %}
  115. {{ const.types.footway.width }}
  116. {% endif %}
  117. dashArray: |
  118. {% if oneway and tags.segregated == 'no' %}
  119. 5,5,5,5,5,10
  120. {% elseif oneway %}
  121. 25,10
  122. {% elseif tags.segregated == 'no' %}
  123. 5,5
  124. {% endif %}
  125. dashOffset: |
  126. {% if oneway %}
  127. 10
  128. {% elseif tags.segregated == 'no' %}
  129. 5
  130. {% endif %}
  131. noClip: |
  132. {{ oneway != 0 }}
  133. lineCap: |
  134. {% if tags.segregated == 'no' or oneway %}
  135. butt
  136. {% else %}
  137. round
  138. {% endif %}
  139. offset: |
  140. {% if tags.segregated == 'yes' %}
  141. {{ (const.types.footway.width / 2 - 1) * -1 }}
  142. {% endif %}
  143. style:left:
  144. offset: -5
  145. color: |
  146. {{ const.types[leftCycle].color|default('#ff0000') }}
  147. width: 3
  148. lineCap: |
  149. {{ leftOneway ? 'butt' : 'round' }}
  150. dashArray: |
  151. {{ leftOneway ? '27,8' : '' }}
  152. dashOffset: |
  153. {{ leftOneway == -1 ? 28 : 0 }}
  154. noClip: true
  155. # {{ leftOneway }}
  156. pattern: |
  157. {% if leftOneway %}arrowHead{% endif %}
  158. pattern-offset: |
  159. {{ leftOneway == -1 ? 4 : 30.5 }}
  160. pattern-lineOffset: -5
  161. pattern-repeat: 35
  162. pattern-polygon: true
  163. pattern-pixelSize: 9
  164. pattern-angleCorrection: |
  165. {{ leftOneway == -1 ? 180 : 0 }}
  166. pattern-path-width: 0
  167. pattern-path-color: |
  168. {{ const.types[leftCycle].color|default('#ff0000') }}
  169. pattern-path-fillOpacity: 1
  170. style:right:
  171. offset: 5
  172. color: |
  173. {{ const.types[rightCycle].color|default('#ff0000') }}
  174. width: 3
  175. lineCap: |
  176. {{ rightOneway ? 'butt' : 'round' }}
  177. dashArray: |
  178. {{ rightOneway ? '27,8' : '' }}
  179. dashOffset: |
  180. {{ rightOneway == -1 ? 28 : 0 }}
  181. noClip: true
  182. # {{ rightOneway }}
  183. pattern: |
  184. {% if rightOneway %}arrowHead{% endif %}
  185. pattern-offset: |
  186. {{ rightOneway == -1 ? 4 : 30.5 }}
  187. pattern-lineOffset: 5
  188. pattern-repeat: 35
  189. pattern-polygon: true
  190. pattern-pixelSize: 9
  191. pattern-angleCorrection: |
  192. {{ rightOneway == -1 ? 180 : 0 }}
  193. pattern-path-width: 0
  194. pattern-path-color: |
  195. {{ const.types[rightCycle].color|default('#ff0000') }}
  196. pattern-path-fillOpacity: 1
  197. description: |
  198. {% if tags.cyclestreet == 'yes' %}
  199. {{ keyTrans('cyclestreet') }}
  200. {% elseif tags.bicycle_road in ['yes', 'designated'] %}
  201. {{ keyTrans('bicycle_road') }}
  202. {% elseif tags.segregated %}
  203. {{ tagTrans('highway', 'cycleway segregated=' ~ tags.segregated) }}
  204. {% elseif tags.highway %}
  205. {{ tagTrans('highway', tags.highway) }}
  206. {% endif %}
  207. body: |
  208. <ul>
  209. {% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %}
  210. <li>
  211. {{ keyTrans('cycleway:width') }}:
  212. {% if not attribute(tags, 'cycleway:width') %}
  213. {{ trans('unknown') }}
  214. {% elseif attribute(tags, 'cycleway:width') matches "/(m|')$/" %}
  215. {{ attribute(tags, 'cycleway:width') }}
  216. {% else %}
  217. {{ attribute(tags, 'cycleway:width') }}m
  218. {% endif %}
  219. </li>
  220. {% endif %}
  221. {% if leftCycle %}
  222. <li>{{ keyTrans('cycleway:left') }}:<ul>
  223. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
  224. <li>
  225. {{ keyTrans('cycleway:width') }}:
  226. {% if not leftWidth %}
  227. {{ trans('unknown') }}
  228. {% elseif attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %}
  229. {{ attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) }}
  230. {% else %}
  231. {{ leftWidth }}m
  232. {% endif %}
  233. </li>
  234. </ul></li>
  235. {% endif %}
  236. {% if rightCycle %}
  237. <li>{{ keyTrans('cycleway:right') }}:<ul>
  238. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
  239. <li>
  240. {{ keyTrans('cycleway:width') }}:
  241. {% if not rightWidth %}
  242. {{ trans('unknown') }}
  243. {% elseif attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %}
  244. {{ attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) }}
  245. {% else %}
  246. {{ rightWidth }}m
  247. {% endif %}
  248. </li>
  249. </ul></li>
  250. {% endif %}
  251. </ul>
  252. markerSymbol: ''
  253. const:
  254. types:
  255. cycleway:
  256. color: '#009f00'
  257. width: 4
  258. footway:
  259. color: '#ff9f00'
  260. width: 4
  261. cyclestreet:
  262. color: '#006f3f'
  263. width: 8
  264. bicycle_road:
  265. color: '#006f4f'
  266. width: 8
  267. lane:
  268. color: '#00df3f'
  269. shared_lane:
  270. color: '#003faf'
  271. share_busway:
  272. color: '#ff7f00'
  273. opposite:
  274. color: '#ff0000'
  275. warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.'
  276. opposite_lane:
  277. color: '#ff0000'
  278. warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.'
  279. track:
  280. color: '#ff0000'
  281. warning: 'Deprecated tag! Consider tagging as separate way with highway=cycleway.'