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.

262 lines
6.3 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. styles: |
  35. {% if tags.segregated %}
  36. footway,
  37. {% endif %}
  38. default
  39. {% if leftCycle %}
  40. ,left
  41. {% endif %}
  42. style:
  43. width: |
  44. {% if tags.segregated == 'yes' %}
  45. {{ const.types[type].width / 2 }}
  46. {% else %}
  47. {{ const.types[type].width }}
  48. {% endif %}
  49. dashArray: |
  50. {% if oneway and tags.segregated == 'no' %}
  51. 5,5,5,20
  52. {% elseif oneway %}
  53. 25,10
  54. {% elseif tags.segregated == 'no' %}
  55. 5,5
  56. {% endif %}
  57. dashOffset: |
  58. {% if oneway and tags.segregated == 'no' %}
  59. 5
  60. {% elseif oneway %}
  61. 10
  62. {% elseif tags.segregated == 'no' %}
  63. 0
  64. {% endif %}
  65. lineCap: |
  66. {% if tags.segregated == 'no' or oneway %}
  67. butt
  68. {% else %}
  69. round
  70. {% endif %}
  71. color: |
  72. {{ const.types[type].color }}
  73. offset: |
  74. {% if tags.segregated == 'yes' %}
  75. {{ const.types[type].width / 2 - 1 }}
  76. {% endif %}
  77. pattern: |
  78. {% if oneway -%}
  79. arrowHead
  80. {%- endif %}
  81. pattern-repeat: |
  82. 35
  83. pattern-offset: |
  84. {{ oneway == -1 ? 17 : 22 }}
  85. noClip: |
  86. {{ oneway != 0 }}
  87. pattern-polygon: true
  88. pattern-pixelSize: 9
  89. pattern-angleCorrection: |
  90. {{ oneway == -1 ? 180 : 0 }}
  91. pattern-path-color: |
  92. {{ const.types[type].color }}
  93. pattern-path-width: 0
  94. pattern-path-fillOpacity: 1
  95. style:footway:
  96. color: |
  97. {{ const.types.footway.color }}
  98. width: |
  99. {% if tags.segregated == 'yes' %}
  100. {{ const.types.footway.width / 2 }}
  101. {% else %}
  102. {{ const.types.footway.width }}
  103. {% endif %}
  104. dashArray: |
  105. {% if oneway and tags.segregated == 'no' %}
  106. 5,5,5,5,5,10
  107. {% elseif oneway %}
  108. 25,10
  109. {% elseif tags.segregated == 'no' %}
  110. 5,5
  111. {% endif %}
  112. dashOffset: |
  113. {% if oneway %}
  114. 10
  115. {% elseif tags.segregated == 'no' %}
  116. 5
  117. {% endif %}
  118. noClip: |
  119. {{ oneway != 0 }}
  120. lineCap: |
  121. {% if tags.segregated == 'no' or oneway %}
  122. butt
  123. {% else %}
  124. round
  125. {% endif %}
  126. offset: |
  127. {% if tags.segregated == 'yes' %}
  128. {{ (const.types.footway.width / 2 - 1) * -1 }}
  129. {% endif %}
  130. style:left:
  131. offset: -5
  132. color: |
  133. {{ const.types[leftCycle].color|default('#ff0000') }}
  134. width: 3
  135. lineCap: |
  136. {{ leftOneway ? 'butt' : 'round' }}
  137. dashArray: |
  138. {{ leftOneway ? '27,8' : '' }}
  139. dashOffset: |
  140. {{ leftOneway == -1 ? 28 : 0 }}
  141. noClip: true
  142. # {{ leftOneway }}
  143. pattern: |
  144. {% if leftOneway %}arrowHead{% endif %}
  145. pattern-offset: |
  146. {{ leftOneway == -1 ? 4 : 30.5 }}
  147. pattern-lineOffset: -5
  148. pattern-repeat: 35
  149. pattern-polygon: true
  150. pattern-pixelSize: 9
  151. pattern-angleCorrection: |
  152. {{ leftOneway == -1 ? 180 : 0 }}
  153. pattern-path-width: 0
  154. pattern-path-color: |
  155. {{ const.types[leftCycle].color|default('#ff0000') }}
  156. pattern-path-fillOpacity: 1
  157. description: |
  158. {% if tags.cyclestreet == 'yes' %}
  159. {{ keyTrans('cyclestreet') }}
  160. {% elseif tags.bicycle_road in ['yes', 'designated'] %}
  161. {{ keyTrans('bicycle_road') }}
  162. {% elseif tags.segregated %}
  163. {{ tagTrans('highway', 'cycleway segregated=' ~ tags.segregated) }}
  164. {% elseif tags.highway %}
  165. {{ tagTrans('highway', tags.highway) }}
  166. {% endif %}
  167. body: |
  168. <ul>
  169. {% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %}
  170. <li>
  171. {{ keyTrans('cycleway:width') }}:
  172. {% if not attribute(tags, 'cycleway:width') %}
  173. {{ trans('unknown') }}
  174. {% elseif attribute(tags, 'cycleway:width') matches "/(m|')$/" %}
  175. {{ attribute(tags, 'cycleway:width') }}
  176. {% else %}
  177. {{ attribute(tags, 'cycleway:width') }}m
  178. {% endif %}
  179. </li>
  180. {% endif %}
  181. {% if leftCycle %}
  182. <li>{{ keyTrans('cycleway:left') }}:<ul>
  183. <li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
  184. <li>
  185. {{ keyTrans('cycleway:width') }}:
  186. {% if not leftWidth %}
  187. {{ trans('unknown') }}
  188. {% elseif attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %}
  189. {{ attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) }}
  190. {% else %}
  191. {{ leftWidth }}m
  192. {% endif %}
  193. </li>
  194. </ul></li>
  195. {% endif %}
  196. </ul>
  197. markerSymbol: ''
  198. const:
  199. types:
  200. cycleway:
  201. color: '#009f00'
  202. width: 4
  203. footway:
  204. color: '#ff9f00'
  205. width: 4
  206. cyclestreet:
  207. color: '#006f3f'
  208. width: 8
  209. bicycle_road:
  210. color: '#006f4f'
  211. width: 8
  212. lane:
  213. color: '#00df3f'
  214. shared_lane:
  215. color: '#003faf'
  216. share_busway:
  217. color: '#ff7f00'
  218. opposite_lane:
  219. color: '#ff0000'
  220. warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.'
  221. track:
  222. color: '#ff0000'
  223. warning: 'Deprecated tag! Consider tagging as separate way with highway=cycleway.'