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.

264 lines
10 KiB

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