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.

415 lines
15 KiB

  1. query:
  2. 15: |
  3. (
  4. way[highway~"^(footway|pedestrian|steps|path|platform)$"];
  5. way[highway=cycleway][foot~"^(yes|designated)$"];
  6. way[footway];
  7. way[sidewalk~"^(yes|both|left|right|no|none)$"];
  8. way["sidewalk:left"~"(yes|no|separate)$"];
  9. way["sidewalk:right"~"(yes|no|separate)$"];
  10. way["sidewalk:both"~"(yes|no|separate)$"];
  11. nwr["railway"="platform"];
  12. node[highway=crossing];
  13. )
  14. feature:
  15. pre: |
  16. {% set sides = ['default'] %}
  17. {% set sidewalk_left = null %}{% set sidewalk_right = null %}
  18. {% set category = tags.highway %}
  19. {% if attribute(tags, 'sidewalk:both') == 'yes' or tags.sidewalk in ['yes', 'both', 'left', 'both', 'right'] or tags.footway == 'sidewalk' %}
  20. {% set category = 'sidewalk' %}
  21. {% endif %}
  22. {% if tags.highway in ['pedestrian', 'footway','steps','path','cycleway','platform'] %}
  23. {% set sides = sides|merge(['main']) %}
  24. {% endif %}
  25. {% if tags.railway in ['platform'] %}
  26. {% set sides = sides|merge(['main']) %}
  27. {% set category = 'platform' %}
  28. {% endif %}
  29. {% set foot = false %}
  30. {% if tags.highway not in ['pedestrian', 'footway', 'path'] and tags.foot in ['yes', 'designated'] %}
  31. {% set foot = tags.foot %}
  32. {% set sides = sides|merge(['foot']) %}
  33. {% endif %}
  34. {% if tags.footway == 'crossing' %}
  35. {% set category = 'crossing' %}
  36. {% endif %}
  37. {% if tags.sidewalk in ['no', 'none'] %}
  38. {% set sidewalk_left = 'no' %}
  39. {% set sidewalk_right = 'no' %}
  40. {% set sides = sides|merge(['leftr', 'rightr']) %}
  41. {% endif %}
  42. {% if attribute(tags, 'sidewalk:both') %}
  43. {% set sidewalk_left = attribute(tags, 'sidewalk:both') %}
  44. {% set sides = sides|merge(['leftr', 'rightr']) %}
  45. {% endif %}
  46. {% if attribute(tags, 'sidewalk:left') %}
  47. {% set sidewalk_left = attribute(tags, 'sidewalk:left') %}
  48. {% set sides = sides|merge(['leftr']) %}
  49. {% endif %}
  50. {% if attribute(tags, 'sidewalk:left') == 'yes' or attribute(tags, 'sidewalk:both') == 'yes' or tags.sidewalk in ['left', 'both'] %}
  51. {% set sidewalk_left = 'yes' %}
  52. {% set sides = sides|merge(['leftr', 'left']) %}
  53. {% endif %}
  54. {% if attribute(tags, 'sidewalk:right') %}
  55. {% set sidewalk_right = attribute(tags, 'sidewalk:right') %}
  56. {% set sides = sides|merge(['rightr']) %}
  57. {% endif %}
  58. {% if attribute(tags, 'sidewalk:right') == 'yes' or attribute(tags, 'sidewalk:both') == 'yes' or tags.sidewalk in ['right', 'both'] %}
  59. {% set sidewalk_right = 'yes' %}
  60. {% set sides = sides|merge(['rightr', 'right']) %}
  61. {% endif %}
  62. {% if type == 'node' %}
  63. {% set sides = ['node'] %}
  64. {% endif %}
  65. description: |
  66. {% if tags.footway %}
  67. {{ tagTrans('footway', tags.footway) }}
  68. {% elseif tags.highway %}
  69. {% if tags.highway in ['path', 'cycleway'] and tags.segregated %}
  70. {{ tagTrans('highway', 'cycleway segregated=' ~ tags.segregated) }}
  71. {% else %}
  72. {{ tagTrans('highway', tags.highway) }}
  73. {% endif %}
  74. {% elseif tags.railway %}
  75. {{ tagTrans('railway', tags.railway) }}
  76. {% endif %}
  77. body: |
  78. <ul>
  79. {% if 'main' in sides %}
  80. {% if tags.width %}<li>
  81. <span class='key'>{{ keyTrans('width') }}:</span>
  82. <span class='value'>{{ tags.width|formatUnit }}</span>
  83. </li>{% endif %}
  84. {% if tags.wheelchair %}<li>
  85. <span class='key'>{{ keyTrans('wheelchair') }}:</span>
  86. <span class='value'>{{ tagTrans('wheelchair', tags.wheelchair) }}</span>
  87. </li>{% endif %}
  88. {% if tags.surface %}<li>
  89. <span class='key'>{{ keyTrans('surface') }}:</span>
  90. <span class='value'>{{ tagTrans('surface', tags.surface) }}</span>
  91. </li>{% endif %}
  92. {% if tags.tactile_paving %}<li>
  93. <span class='key'>{{ keyTrans('tactile_paving') }}:</span>
  94. <span class='value'>{{ tagTrans('tactile_paving', tags.tactile_paving) }}</span>
  95. </li>{% endif %}
  96. {% if tags.smoothness %}<li>
  97. <span class='key'>{{ keyTrans('smoothness') }}:</span>
  98. <span class='value'>{{ tagTrans('smoothness', tags.smoothness) }}</span>
  99. </li>{% endif %}
  100. {% endif %}
  101. {% if attribute(tags, 'sidewalk:left')|default(attribute(tags, 'sidewalk:both')) %}
  102. <li>{{ keyTrans('sidewalk:left') }}:<ul>
  103. <li>{{ tagTrans('sidewalk', attribute(tags, 'sidewalk:left')|default(attribute(tags, 'sidewalk:both'))) }}</li>
  104. {% if attribute(tags, 'sidewalk:left:width')|default(attribute(tags, 'sidewalk:both:width')) %}<li>
  105. <span class='key'>{{ keyTrans('width') }}:</span>
  106. <span class='value'>{{ attribute(tags, 'sidewalk:left:width')|default(attribute(tags, 'sidewalk:both:width'))|formatUnit }}</span>
  107. </li>{% endif %}
  108. {% if attribute(tags, 'sidewalk:left:wheelchair')|default(attribute(tags, 'sidewalk:both:wheelchair')) %}<li>
  109. <span class='key'>{{ keyTrans('wheelchair') }}:</span>
  110. <span class='value'>{{ tagTrans('wheelchair', attribute(tags, 'sidewalk:left:wheelchair')|default(attribute(tags, 'sidewalk:both:wheelchair'))) }}</span>
  111. </li>{% endif %}
  112. {% if attribute(tags, 'sidewalk:left:surface')|default(attribute(tags, 'sidewalk:both:surface')) %}<li>
  113. <span class='key'>{{ keyTrans('surface') }}:</span>
  114. <span class='value'>{{ tagTrans('surface', attribute(tags, 'sidewalk:left:surface')|default(attribute(tags, 'sidewalk:both:surface'))) }}</span>
  115. </li>{% endif %}
  116. {% if attribute(tags, 'sidewalk:left:tactile_paving') %}<li>
  117. <span class='key'>{{ keyTrans('tactile_paving') }}:</span>
  118. <span class='value'>{{ tagTrans('tactile_paving', attribute(tags, 'sidewalk:left:tactile_paving')|default(attribute(tags, 'sidewalk:both:tactile_paving'))) }}</span>
  119. </li>{% endif %}
  120. {% if attribute(tags, 'sidewalk:left:smoothness')|default(attribute(tags, 'sidewalk:both:smoothness')) %}<li>
  121. <span class='key'>{{ keyTrans('smoothness') }}:</span>
  122. <span class='value'>{{ tagTrans('smoothness', attribute(tags, 'sidewalk:left:smoothness')|default(attribute(tags, 'sidewalk:both:smoothness'))) }}</span>
  123. </li>{% endif %}
  124. </ul></li>
  125. {% endif %}
  126. {% if attribute(tags, 'sidewalk:right')|default(attribute(tags, 'sidewalk:both')) %}
  127. <li>{{ keyTrans('sidewalk:right') }}:<ul>
  128. <li>{{ tagTrans('sidewalk', attribute(tags, 'sidewalk:right')|default(attribute(tags, 'sidewalk:both'))) }}</li>
  129. {% if attribute(tags, 'sidewalk:right:width')|default(attribute(tags, 'sidewalk:both:width')) %}<li>
  130. <span class='key'>{{ keyTrans('width') }}:</span>
  131. <span class='value'>{{ attribute(tags, 'sidewalk:right:width')|default(attribute(tags, 'sidewalk:both:width'))|formatUnit }}</span>
  132. </li>{% endif %}
  133. {% if attribute(tags, 'sidewalk:right:wheelchair')|default(attribute(tags, 'sidewalk:both:wheelchair')) %}<li>
  134. <span class='key'>{{ keyTrans('wheelchair') }}:</span>
  135. <span class='value'>{{ tagTrans('wheelchair', attribute(tags, 'sidewalk:right:wheelchair')|default(attribute(tags, 'sidewalk:both:wheelchair'))) }}</span>
  136. </li>{% endif %}
  137. {% if attribute(tags, 'sidewalk:right:surface')|default(attribute(tags, 'sidewalk:both:surface')) %}<li>
  138. <span class='key'>{{ keyTrans('surface') }}:</span>
  139. <span class='value'>{{ tagTrans('surface', attribute(tags, 'sidewalk:right:surface')|default(attribute(tags, 'sidewalk:both:surface'))) }}</span>
  140. </li>{% endif %}
  141. {% if attribute(tags, 'sidewalk:right:tactile_paving') %}<li>
  142. <span class='key'>{{ keyTrans('tactile_paving') }}:</span>
  143. <span class='value'>{{ tagTrans('tactile_paving', attribute(tags, 'sidewalk:right:tactile_paving')|default(attribute(tags, 'sidewalk:both:tactile_paving'))) }}</span>
  144. </li>{% endif %}
  145. {% if attribute(tags, 'sidewalk:right:smoothness')|default(attribute(tags, 'sidewalk:both:smoothness')) %}<li>
  146. <span class='key'>{{ keyTrans('smoothness') }}:</span>
  147. <span class='value'>{{ tagTrans('smoothness', attribute(tags, 'sidewalk:right:smoothness')|default(attribute(tags, 'sidewalk:both:smoothness'))) }}</span>
  148. </li>{% endif %}
  149. </ul></li>
  150. {% endif %}
  151. </ul>
  152. markerSymbol: ""
  153. listMarkerSymbol: |
  154. {% if tags.area == 'yes' %}
  155. polygon
  156. {% elseif 'node' in sides %}
  157. {{ markerCircle({ width: 0, radius: 5, fillOpacity: 1, fill: true, color: const.categories[category].color }) }}
  158. {% else %}
  159. {{ markerLine({
  160. 'styles': sides|join(','),
  161. 'style:main': {
  162. width: foot and tags.segregated == 'yes' ? 2 : const.categories[category].width|default(3),
  163. color: const.categories[category].color,
  164. dashArray: tags.highway == 'steps' or (foot and tags.segregated != 'yes') ? '3,3' : '',
  165. lineCap: tags.highway == 'steps' or (foot and tags.segregated != 'yes') ? 'butt' : 'round',
  166. offset: foot and tags.segregated == 'yes' ? 1 : 0
  167. },
  168. 'style:foot': {
  169. fill: false,
  170. width: foot and tags.segregated == 'yes' ? 2 : 3,
  171. color: const.categories.footway.color,
  172. dashArray: foot and tags.segregated != 'yes' ? '3,3' : '',
  173. dashOffset: 3,
  174. lineCap: foot and tags.segregated != 'yes' ? 'butt' : 'round',
  175. offset: foot and tags.segregated == 'yes' ? -1 : 0
  176. },
  177. 'style:left': {
  178. width: 3,
  179. offset: -6,
  180. color: const.categories.sidewalk.color
  181. },
  182. 'style:right': {
  183. width: 3,
  184. offset: 6,
  185. color: const.categories.sidewalk.color
  186. },
  187. 'style:leftr': {
  188. width: sidewalk_left ? 5 : 0,
  189. offset: -2.5,
  190. opacity: 0.3,
  191. dashArray: '1,10',
  192. lineCap: butt,
  193. color: sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color
  194. },
  195. 'style:rightr': {
  196. width: sidewalk_right ? 5 : 0,
  197. offset: 2.5,
  198. opacity: 0.3,
  199. dashArray: '1,10',
  200. lineCap: butt,
  201. color: sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color
  202. },
  203. }) }}
  204. {% endif %}
  205. style:
  206. opacity: 0
  207. fillOpacity: 0
  208. width: 5
  209. style:node:
  210. width: 0
  211. radius: 5
  212. fillOpacity: 1
  213. fill: true
  214. color: |
  215. {{ const.categories[category].color }}
  216. style:main:
  217. fill: |
  218. {% if tags.area == 'yes' %}true{% else %}false{% endif %}
  219. width: |
  220. {% if tags.area == 'yes' %}
  221. 1
  222. {% elseif foot and tags.segregated == 'yes' %}
  223. 2
  224. {% else %}
  225. {{ const.categories[category].width|default(3) }}
  226. {% endif %}
  227. color: |
  228. {{ const.categories[category].color }}
  229. dashArray: |
  230. {% if tags.highway == 'steps' or (foot and tags.segregated != 'yes') %}
  231. 3,3
  232. {% endif %}
  233. lineCap: |
  234. {% if tags.highway == 'steps' or (foot and tags.segregated != 'yes') %}butt{% else %}round{% endif %}
  235. offset: |
  236. {% if foot and tags.segregated == 'yes' %}1{% else %}0{% endif %}
  237. style:foot:
  238. fill: false
  239. width: |
  240. {% if foot and tags.segregated == 'yes' %}
  241. 2
  242. {% else %}
  243. 3
  244. {% endif %}
  245. color: |
  246. {{ const.categories.footway.color }}
  247. dashArray: |
  248. {% if foot and tags.segregated != 'yes' %}
  249. 3,3
  250. {% endif %}
  251. dashOffset: 3
  252. lineCap: |
  253. {% if foot and tags.segregated != 'yes' %}butt{% else %}round{% endif %}
  254. offset: |
  255. {% if foot and tags.segregated == 'yes' %}-1{% else %}0{% endif %}
  256. style:left:
  257. width: 3
  258. offset: |
  259. {{ -5 / map.metersPerPixel }}
  260. color: |
  261. {{ const.categories.sidewalk.color }}
  262. style:right:
  263. width: 3
  264. offset: |
  265. {{ 5 / map.metersPerPixel }}
  266. color: |
  267. {{ const.categories.sidewalk.color }}
  268. style:leftr:
  269. width: |
  270. {{ sidewalk_left ? 5 / map.metersPerPixel : 0 }}
  271. offset: |
  272. {{ -2.5 / map.metersPerPixel }}
  273. opacity: 0.3
  274. dashArray: '1,10'
  275. lineCap: butt
  276. color: |
  277. {{ sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color }}
  278. style:rightr:
  279. width: |
  280. {{ sidewalk_right ? 5 / map.metersPerPixel : 0 }}
  281. offset: |
  282. {{ 2.5 / map.metersPerPixel }}
  283. opacity: 0.3
  284. dashArray: '1,10'
  285. lineCap: butt
  286. color: |
  287. {{ sidewalk_right in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color }}
  288. styles: |
  289. {{ sides|join(',') }}
  290. info: |
  291. <table>
  292. {% for k, d in const.categories if k != 'cycleway' %}
  293. <tr>
  294. <td>{{ markerLine({
  295. width: d.width|default(3),
  296. color: d.color,
  297. dashArray: d.dashArray
  298. }) }}</td>
  299. <td>{{ tagTrans(d.key|default('highway'), k) }}</td>
  300. </tr>
  301. {% endfor %}
  302. <tr>
  303. <td>{{ markerCircle({
  304. width: 0,
  305. radius: 5,
  306. fillOpacity: 1,
  307. fill: true,
  308. color: const.categories.crossing.color
  309. }) }}</td>
  310. <td>{{ tagTrans('highway', 'crossing') }}</td>
  311. </tr>
  312. <tr>
  313. <td>{{ markerLine({
  314. styles: 'default,foot',
  315. style: {
  316. width: 4,
  317. color: const.categories.cycleway.color,
  318. dashArray: '3,3'
  319. },
  320. 'style:foot': {
  321. width: 4,
  322. color: const.categories.footway.color,
  323. dashArray: '3,3',
  324. dashOffset: 3
  325. }
  326. }) }}</td>
  327. <td>{{ tagTrans('highway', 'cycleway segregated=no') }}</td>
  328. </tr>
  329. <tr>
  330. <td>{{ markerLine({
  331. styles: 'default,foot',
  332. style: {
  333. width: 2,
  334. color: const.categories.cycleway.color,
  335. offset: -1
  336. },
  337. 'style:foot': {
  338. width: 2,
  339. color: const.categories.footway.color,
  340. offset: 1
  341. }
  342. }) }}</td>
  343. <td>{{ tagTrans('highway', 'cycleway segregated=yes') }}</td>
  344. </tr>
  345. {% for k, d in const.sidewalks %}
  346. <tr>
  347. <td>{{ markerLine({
  348. styles: d.styles,
  349. 'style:leftr': {
  350. width: 9,
  351. offset: -1,
  352. opacity: 0.3,
  353. dashArray: '1,10',
  354. lineCap: butt,
  355. color: d.color
  356. },
  357. 'style:left': {
  358. width: 3,
  359. offset: -7,
  360. color: d.color
  361. }
  362. }) }}</td>
  363. <td>{{ tagTrans('sidewalk', k) }}</td>
  364. </tr>
  365. {% endfor %}
  366. </table>
  367. const:
  368. categories:
  369. sidewalk:
  370. color: '#ff007f'
  371. key: footway
  372. pedestrian:
  373. color: '#ff00c8'
  374. width: 5
  375. footway:
  376. color: '#ab00ff'
  377. path:
  378. color: '#ee922d'
  379. steps:
  380. color: '#ab00ff'
  381. dashArray: '3,3'
  382. crossing:
  383. color: '#964e00'
  384. cycleway:
  385. color: '#002aff'
  386. platform:
  387. key: railway
  388. color: '#00ff00'
  389. sidewalks:
  390. 'yes':
  391. color: '#ff007f'
  392. styles: 'leftr,left'
  393. 'separate':
  394. color: '#ff007f'
  395. styles: 'leftr'
  396. 'no':
  397. color: '#000000'
  398. styles: 'leftr'