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.

275 lines
11 KiB

  1. query:
  2. 10: |
  3. (
  4. way["parking:left"];way["parking:right"];way["parking:both"];
  5. way["parking:lane:left"];way["parking:lane:right"];way["parking:lane:both"];
  6. )
  7. feature:
  8. pre: |
  9. {% set deprecated = attribute(tags, 'parking:lane:left') or attribute(tags, 'parking:lane:right') or attribute(tags, 'parking:lane:both') %}
  10. {% set leftOrientation = attribute(tags, 'parking:left:orientation')|default(attribute(tags, 'parking:lane:left'))|default(attribute(tags, 'parking:both:orientation'))|default(attribute(tags, 'parking:lane:both'))|default('unknown') %}
  11. {% set rightOrientation = attribute(tags, 'parking:right:orientation')|default(attribute(tags, 'parking:lane:right'))|default(attribute(tags, 'parking:both:orientation'))|default(attribute(tags, 'parking:lane:both'))|default('unknown') %}
  12. {% set leftType = attribute(tags, 'parking:left')|default(attribute(tags, 'parking:lane:left:' ~ leftOrientation))|default(attribute(tags, 'parking:both'))|default(attribute(tags, 'parking:lane:both:' ~ leftOrientation))|default('unknown') %}
  13. {% set rightType = attribute(tags, 'parking:right')|default(attribute(tags, 'parking:lane:right:' ~ rightOrientation))|default(attribute(tags, 'parking:both'))|default(attribute(tags, 'parking:lane:both:' ~ rightOrientation))|default('unknown') %}
  14. {% if (attribute(tags, 'parking:lane:left:' ~ leftOrientation) or attribute(tags, 'parking:lane:both:' ~ leftOrientation)) and leftType == 'on_street' %}
  15. {% set leftType = 'lane' %}
  16. {% endif %}
  17. {% if (attribute(tags, 'parking:lane:right:' ~ rightOrientation) or attribute(tags, 'parking:lane:both:' ~ rightOrientation)) and rightType == 'on_street' %}
  18. {% set rightType = 'lane' %}
  19. {% endif %}
  20. {% set leftCondition = 'undefined' %}
  21. {% if attribute(tags, 'parking:left:fee')|default(attribute(tags, 'parking:both:fee')) == 'no' %}
  22. {% set leftRestriction = 'free' %}
  23. {% endif %}
  24. {% if attribute(tags, 'parking:left:maxstay')|default(attribute(tags, 'parking:both:maxstay')) not in [undefined, 'no'] %}
  25. {% set leftRestriction = 'free_time_limit' %}
  26. {% endif %}
  27. {% if attribute(tags, 'parking:left:fee')|default(attribute(tags, 'parking:both:fee')) not in [undefined, 'no'] or attribute(tags, 'parking:left:fee:conditional')|default(attribute(tags, 'parking:both:fee:conditional')) matches '/yes/' %}
  28. {% set leftRestriction = 'paid' %}
  29. {% endif %}
  30. {% if attribute(tags, 'parking:left:access')|default(attribute(tags, 'parking:both:access')) == 'customers' or attribute(tags, 'parking:left:access:conditional')|default(attribute(tags, 'parking:both:access:conditional')) matches '/customers/' %}
  31. {% set leftRestriction = 'customers' %}
  32. {% endif %}
  33. {% if attribute(tags, 'parking:left:access')|default(attribute(tags, 'parking:both:access')) == 'no' or attribute(tags, 'parking:left:access:conditional')|default(attribute(tags, 'parking:both:access:conditional')) matches '/no/' %}
  34. {% set leftRestriction = 'non_public' %}
  35. {% endif %}
  36. {% if attribute(tags, 'parking:left:disabled')|default(attribute(tags, 'parking:both:disabled')) not in [undefined, 'no'] or attribute(tags, 'parking:left:disabled:conditional')|default(attribute(tags, 'parking:both:disabled:conditional')) %}
  37. {% set leftRestriction = 'disabled' %}
  38. {% endif %}
  39. {% if attribute(tags, 'parking:left')|default(attribute(tags, 'parking:both')) == 'no' and attribute(tags, 'parking:left:reason')|default(attribute(tags, 'parking:both:reason')) %}
  40. {% set leftRestriction = 'reason' %}
  41. {% endif %}
  42. {% for r in ['charging_only', 'loading_only', 'no_parking', 'no_standing', 'no_stopping'] %}
  43. {% if attribute(tags, 'parking:left:restriction')|default(attribute(tags, 'parking:both:restriction')) == r or attribute(tags, 'parking:left:restriction:conditional')|default(attribute(tags, 'parking:both:restriction:conditional')) matches ('/' ~ r ~ '/') %}
  44. {% set leftRestriction = r %}
  45. {% endif %}
  46. {% endfor %}
  47. {% set rightCondition = 'undefined' %}
  48. {% if attribute(tags, 'parking:right:fee')|default(attribute(tags, 'parking:both:fee')) == 'no' %}
  49. {% set rightRestriction = 'free' %}
  50. {% endif %}
  51. {% if attribute(tags, 'parking:right:maxstay')|default(attribute(tags, 'parking:both:maxstay')) not in [undefined, 'no'] %}
  52. {% set rightRestriction = 'free_time_limit' %}
  53. {% endif %}
  54. {% if attribute(tags, 'parking:right:fee')|default(attribute(tags, 'parking:both:fee')) not in [undefined, 'no'] or attribute(tags, 'parking:right:fee:conditional')|default(attribute(tags, 'parking:both:fee:conditional')) matches '/yes/' %}
  55. {% set rightRestriction = 'paid' %}
  56. {% endif %}
  57. {% if attribute(tags, 'parking:right:access')|default(attribute(tags, 'parking:both:access')) == 'customers' or attribute(tags, 'parking:right:access:conditional')|default(attribute(tags, 'parking:both:access:conditional')) matches '/customers/' %}
  58. {% set rightRestriction = 'customers' %}
  59. {% endif %}
  60. {% if attribute(tags, 'parking:right:access')|default(attribute(tags, 'parking:both:access')) == 'no' or attribute(tags, 'parking:right:access:conditional')|default(attribute(tags, 'parking:both:access:conditional')) matches '/no/' %}
  61. {% set rightRestriction = 'non_public' %}
  62. {% endif %}
  63. {% if attribute(tags, 'parking:right:disabled')|default(attribute(tags, 'parking:both:disabled')) not in [undefined, 'no'] or attribute(tags, 'parking:right:disabled:conditional')|default(attribute(tags, 'parking:both:disabled:conditional')) %}
  64. {% set rightRestriction = 'disabled' %}
  65. {% endif %}
  66. {% if attribute(tags, 'parking:right')|default(attribute(tags, 'parking:both')) == 'no' and attribute(tags, 'parking:right:reason')|default(attribute(tags, 'parking:both:reason')) %}
  67. {% set rightRestriction = 'reason' %}
  68. {% endif %}
  69. {% for r in ['charging_only', 'loading_only', 'no_parking', 'no_standing', 'no_stopping'] %}
  70. {% if attribute(tags, 'parking:right:restriction')|default(attribute(tags, 'parking:both:restriction')) == r or attribute(tags, 'parking:right:restriction:conditional')|default(attribute(tags, 'parking:both:restriction:conditional')) matches ('/' ~ r ~ '/') %}
  71. {% set rightRestriction = r %}
  72. {% endif %}
  73. {% endfor %}
  74. body: |
  75. Left: <ul>
  76. <li>Type: {{ leftType }}</li>
  77. {% if leftType not in ['no', 'separate'] %}
  78. <li>Orientation: {{ leftOrientation }}</li>
  79. {% endif %}
  80. </ul>
  81. Right: <ul>
  82. <li>Type: {{ rightType }}</li>
  83. {% if rightType not in ['no', 'separate'] %}
  84. <li>Orientation: {{ rightOrientation }}</li>
  85. {% endif %}
  86. </ul>
  87. {% if deprecated %}<div class='warning'>{{ repoTrans('deprecated', 'parking:lane:left/right/both', 'https://wiki.openstreetmap.org/wiki/Key:parking:lane')|raw }}</div>{% endif %}
  88. markerSymbol: ''
  89. listMarkerSymbol: line
  90. details: |
  91. Left: {{ leftType }} / {{ leftOrientation }}<br>
  92. Right: {{ rightType }} / {{ rightOrientation }}
  93. styles: |
  94. default
  95. {% if leftType == 'separate' %}
  96. ,leftSeparate
  97. {% elseif leftType in ['no', 'unknown'] and leftOrientation == 'unknown' %}
  98. ,leftType
  99. {% else %}
  100. ,leftType,leftOrientation
  101. {% endif %}
  102. {% if rightType == 'separate' %}
  103. ,rightSeparate
  104. {% elseif rightType in ['no', 'unknown'] and rightOrientation == 'unknown' %}
  105. ,rightType
  106. {% else %}
  107. ,rightType,rightOrientation
  108. {% endif %}
  109. style:
  110. color: '#7f7f7f'
  111. style:leftType:
  112. color: |
  113. {{ const.restriction[leftRestriction].color }}
  114. offset: |
  115. {{ 0 - ((const.orientation[leftOrientation].width) * const.type[leftType].kerbPosition + (const.type[leftType].width / 2) + 4) }}
  116. lineCap: butt
  117. width: |
  118. {{ const.type[leftType].width }}
  119. dashArray: |
  120. {{ const.type[leftType].dashArray }}
  121. style:leftOrientation:
  122. color: |
  123. {{ const.restriction[leftRestriction].color }}
  124. offset: |
  125. {{ 0 - ((const.type[leftType].width) * (1 - const.type[leftType].kerbPosition) + const.orientation[leftOrientation].width / 2 + 4) }}
  126. lineCap: butt
  127. width: |
  128. {{ const.orientation[leftOrientation].width }}
  129. dashArray: |
  130. {{ const.orientation[leftOrientation].dashArray }}
  131. style:leftSeparate:
  132. width: 0
  133. pattern: arrowHead
  134. pattern-angleCorrection: -90
  135. pattern-pixelSize: 7
  136. pattern-lineOffset: -10
  137. pattern-polygon: false
  138. pattern-repeat: 15
  139. pattern-path-color: |
  140. {{ const.restriction[leftRestriction].color }}
  141. style:rightType:
  142. color: |
  143. {{ const.restriction[rightRestriction].color }}
  144. offset: |
  145. {{ (const.orientation[rightOrientation].width) * const.type[rightType].kerbPosition + (const.type[rightType].width / 2) + 4 }}
  146. lineCap: butt
  147. width: |
  148. {{ const.type[rightType].width }}
  149. dashArray: |
  150. {{ const.type[rightType].dashArray }}
  151. style:rightOrientation:
  152. color: |
  153. {{ const.restriction[rightRestriction].color }}
  154. offset: |
  155. {{ (const.type[rightType].width) * (1 - const.type[rightType].kerbPosition) + const.orientation[rightOrientation].width / 2 + 4 }}
  156. lineCap: butt
  157. width: |
  158. {{ const.orientation[rightOrientation].width }}
  159. dashArray: |
  160. {{ const.orientation[rightOrientation].dashArray }}
  161. style:rightSeparate:
  162. width: 0
  163. pattern: arrowHead
  164. pattern-angleCorrection: 90
  165. pattern-pixelSize: 7
  166. pattern-lineOffset: 10
  167. pattern-polygon: false
  168. pattern-repeat: 15
  169. pattern-path-color: |
  170. {{ const.restriction[rightRestriction].color }}
  171. info: |
  172. Parking Type:
  173. <table>
  174. {% for k, def in const.type %}
  175. <tr>
  176. <td>{{ markerLine(evaluate({ 'parking:both': k, 'parking:both:orientation': 'parallel' })) }}</td>
  177. <td>{{ k }}</td>
  178. </tr>
  179. {% endfor %}
  180. </table>
  181. Parking Orientation:
  182. <table>
  183. {% for k, def in const.orientation %}
  184. <tr>
  185. <td>{{ markerLine(evaluate({ 'parking:both': 'lane', 'parking:both:orientation': k })) }}</td>
  186. <td>{{ k }}</td>
  187. </tr>
  188. {% endfor %}
  189. </table>
  190. Parking Conditions/Restrictions:
  191. <table>
  192. {% for k, def in const.restriction %}
  193. <tr>
  194. <td>{{ markerLine({ color: def.color, width: 5 }) }}</td>
  195. <td>{{ k }}</td>
  196. </tr>
  197. {% endfor %}
  198. </table>
  199. const:
  200. type:
  201. 'no':
  202. width: 6
  203. dashArray: '6,10'
  204. kerbPosition: 0
  205. lane:
  206. width: 2
  207. dashArray: ''
  208. kerbPosition: 1
  209. street_side:
  210. width: 2
  211. dashArray: '5,5'
  212. kerbPosition: 1
  213. half_on_kerb:
  214. width: 2
  215. dashArray: ''
  216. kerbPosition: 0.5
  217. on_kerb:
  218. width: 2
  219. dashArray: ''
  220. kerbPosition: 0
  221. shoulder:
  222. width: 3
  223. dashArray: '5,5'
  224. kerbPosition: 0
  225. separate:
  226. width: 0
  227. dashArray: ''
  228. kerbPosition: 0
  229. unknown:
  230. width: 3
  231. dashArray: '1,1'
  232. kerbPosition: 0
  233. orientation:
  234. parallel:
  235. width: 5
  236. dashArray: '10,3'
  237. diagonal:
  238. width: 8
  239. dashArray: '5,5'
  240. perpendicular:
  241. width: 12
  242. dashArray: '3,3'
  243. unknown:
  244. width: 8
  245. dashArray: '1,1'
  246. restriction:
  247. undefined:
  248. color: '#0000ff'
  249. free:
  250. color: chartreuse
  251. free_time_limit:
  252. color: dodgerblue
  253. paid:
  254. color: hotpink
  255. customers:
  256. color: darkorange
  257. non_public:
  258. color: red
  259. disabled:
  260. color: turquoise
  261. reason:
  262. color: plum
  263. charging_only:
  264. color: limegreen
  265. loading_only:
  266. color: lightcyan
  267. no_parking:
  268. color: orange
  269. no_standing:
  270. color: salmon
  271. no_stopping:
  272. color: red