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.

427 lines
16 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. {% if tags.incline %}<li>
  101. <span class='key'>{{ keyTrans('incline') }}:</span>
  102. <span class='value'>{{ tags.incline|formatUnit('incline') }}</span>
  103. </li>{% endif %}
  104. {% endif %}
  105. {% if attribute(tags, 'sidewalk:left')|default(attribute(tags, 'sidewalk:both')) %}
  106. <li>{{ keyTrans('sidewalk:left') }}:<ul>
  107. <li>{{ tagTrans('sidewalk', attribute(tags, 'sidewalk:left')|default(attribute(tags, 'sidewalk:both'))) }}</li>
  108. {% if attribute(tags, 'sidewalk:left:width')|default(attribute(tags, 'sidewalk:both:width')) %}<li>
  109. <span class='key'>{{ keyTrans('width') }}:</span>
  110. <span class='value'>{{ attribute(tags, 'sidewalk:left:width')|default(attribute(tags, 'sidewalk:both:width'))|formatUnit }}</span>
  111. </li>{% endif %}
  112. {% if attribute(tags, 'sidewalk:left:wheelchair')|default(attribute(tags, 'sidewalk:both:wheelchair')) %}<li>
  113. <span class='key'>{{ keyTrans('wheelchair') }}:</span>
  114. <span class='value'>{{ tagTrans('wheelchair', attribute(tags, 'sidewalk:left:wheelchair')|default(attribute(tags, 'sidewalk:both:wheelchair'))) }}</span>
  115. </li>{% endif %}
  116. {% if attribute(tags, 'sidewalk:left:surface')|default(attribute(tags, 'sidewalk:both:surface')) %}<li>
  117. <span class='key'>{{ keyTrans('surface') }}:</span>
  118. <span class='value'>{{ tagTrans('surface', attribute(tags, 'sidewalk:left:surface')|default(attribute(tags, 'sidewalk:both:surface'))) }}</span>
  119. </li>{% endif %}
  120. {% if attribute(tags, 'sidewalk:left:tactile_paving') %}<li>
  121. <span class='key'>{{ keyTrans('tactile_paving') }}:</span>
  122. <span class='value'>{{ tagTrans('tactile_paving', attribute(tags, 'sidewalk:left:tactile_paving')|default(attribute(tags, 'sidewalk:both:tactile_paving'))) }}</span>
  123. </li>{% endif %}
  124. {% if attribute(tags, 'sidewalk:left:smoothness')|default(attribute(tags, 'sidewalk:both:smoothness')) %}<li>
  125. <span class='key'>{{ keyTrans('smoothness') }}:</span>
  126. <span class='value'>{{ tagTrans('smoothness', attribute(tags, 'sidewalk:left:smoothness')|default(attribute(tags, 'sidewalk:both:smoothness'))) }}</span>
  127. </li>{% endif %}
  128. {% if attribute(tags, 'sidewalk:left:incline')|default(attribute(tags, 'sidewalk:both:incline')) %}<li>
  129. <span class='key'>{{ keyTrans('incline') }}:</span>
  130. <span class='value'>{{ attribute(tags, 'sidewalk:left:incline')|default(attribute(tags, 'sidewalk:both:incline'))|formatUnit('incline') }}</span>
  131. </li>{% endif %}
  132. </ul></li>
  133. {% endif %}
  134. {% if attribute(tags, 'sidewalk:right')|default(attribute(tags, 'sidewalk:both')) %}
  135. <li>{{ keyTrans('sidewalk:right') }}:<ul>
  136. <li>{{ tagTrans('sidewalk', attribute(tags, 'sidewalk:right')|default(attribute(tags, 'sidewalk:both'))) }}</li>
  137. {% if attribute(tags, 'sidewalk:right:width')|default(attribute(tags, 'sidewalk:both:width')) %}<li>
  138. <span class='key'>{{ keyTrans('width') }}:</span>
  139. <span class='value'>{{ attribute(tags, 'sidewalk:right:width')|default(attribute(tags, 'sidewalk:both:width'))|formatUnit }}</span>
  140. </li>{% endif %}
  141. {% if attribute(tags, 'sidewalk:right:wheelchair')|default(attribute(tags, 'sidewalk:both:wheelchair')) %}<li>
  142. <span class='key'>{{ keyTrans('wheelchair') }}:</span>
  143. <span class='value'>{{ tagTrans('wheelchair', attribute(tags, 'sidewalk:right:wheelchair')|default(attribute(tags, 'sidewalk:both:wheelchair'))) }}</span>
  144. </li>{% endif %}
  145. {% if attribute(tags, 'sidewalk:right:surface')|default(attribute(tags, 'sidewalk:both:surface')) %}<li>
  146. <span class='key'>{{ keyTrans('surface') }}:</span>
  147. <span class='value'>{{ tagTrans('surface', attribute(tags, 'sidewalk:right:surface')|default(attribute(tags, 'sidewalk:both:surface'))) }}</span>
  148. </li>{% endif %}
  149. {% if attribute(tags, 'sidewalk:right:tactile_paving') %}<li>
  150. <span class='key'>{{ keyTrans('tactile_paving') }}:</span>
  151. <span class='value'>{{ tagTrans('tactile_paving', attribute(tags, 'sidewalk:right:tactile_paving')|default(attribute(tags, 'sidewalk:both:tactile_paving'))) }}</span>
  152. </li>{% endif %}
  153. {% if attribute(tags, 'sidewalk:right:smoothness')|default(attribute(tags, 'sidewalk:both:smoothness')) %}<li>
  154. <span class='key'>{{ keyTrans('smoothness') }}:</span>
  155. <span class='value'>{{ tagTrans('smoothness', attribute(tags, 'sidewalk:right:smoothness')|default(attribute(tags, 'sidewalk:both:smoothness'))) }}</span>
  156. </li>{% endif %}
  157. {% if attribute(tags, 'sidewalk:right:incline')|default(attribute(tags, 'sidewalk:both:incline')) %}<li>
  158. <span class='key'>{{ keyTrans('incline') }}:</span>
  159. <span class='value'>{{ attribute(tags, 'sidewalk:right:incline')|default(attribute(tags, 'sidewalk:both:incline'))|formatUnit('incline') }}</span>
  160. </li>{% endif %}
  161. </ul></li>
  162. {% endif %}
  163. </ul>
  164. markerSymbol: ""
  165. listMarkerSymbol: |
  166. {% if tags.area == 'yes' %}
  167. polygon
  168. {% elseif 'node' in sides %}
  169. {{ markerCircle({ width: 0, radius: 5, fillOpacity: 1, fill: true, color: const.categories[category].color }) }}
  170. {% else %}
  171. {{ markerLine({
  172. 'styles': sides|join(','),
  173. 'style:main': {
  174. width: foot and tags.segregated == 'yes' ? 2 : const.categories[category].width|default(3),
  175. color: const.categories[category].color,
  176. dashArray: tags.highway == 'steps' or (foot and tags.segregated != 'yes') ? '3,3' : '',
  177. lineCap: tags.highway == 'steps' or (foot and tags.segregated != 'yes') ? 'butt' : 'round',
  178. offset: foot and tags.segregated == 'yes' ? 1 : 0
  179. },
  180. 'style:foot': {
  181. fill: false,
  182. width: foot and tags.segregated == 'yes' ? 2 : 3,
  183. color: const.categories.footway.color,
  184. dashArray: foot and tags.segregated != 'yes' ? '3,3' : '',
  185. dashOffset: 3,
  186. lineCap: foot and tags.segregated != 'yes' ? 'butt' : 'round',
  187. offset: foot and tags.segregated == 'yes' ? -1 : 0
  188. },
  189. 'style:left': {
  190. width: 3,
  191. offset: -6,
  192. color: const.categories.sidewalk.color
  193. },
  194. 'style:right': {
  195. width: 3,
  196. offset: 6,
  197. color: const.categories.sidewalk.color
  198. },
  199. 'style:leftr': {
  200. width: sidewalk_left ? 5 : 0,
  201. offset: -2.5,
  202. opacity: 0.3,
  203. dashArray: '1,10',
  204. lineCap: butt,
  205. color: sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color
  206. },
  207. 'style:rightr': {
  208. width: sidewalk_right ? 5 : 0,
  209. offset: 2.5,
  210. opacity: 0.3,
  211. dashArray: '1,10',
  212. lineCap: butt,
  213. color: sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color
  214. },
  215. }) }}
  216. {% endif %}
  217. style:
  218. opacity: 0
  219. fillOpacity: 0
  220. width: 5
  221. style:node:
  222. width: 0
  223. radius: 5
  224. fillOpacity: 1
  225. fill: true
  226. color: |
  227. {{ const.categories[category].color }}
  228. style:main:
  229. fill: |
  230. {% if tags.area == 'yes' %}true{% else %}false{% endif %}
  231. width: |
  232. {% if tags.area == 'yes' %}
  233. 1
  234. {% elseif foot and tags.segregated == 'yes' %}
  235. 2
  236. {% else %}
  237. {{ const.categories[category].width|default(3) }}
  238. {% endif %}
  239. color: |
  240. {{ const.categories[category].color }}
  241. dashArray: |
  242. {% if tags.highway == 'steps' or (foot and tags.segregated != 'yes') %}
  243. 3,3
  244. {% endif %}
  245. lineCap: |
  246. {% if tags.highway == 'steps' or (foot and tags.segregated != 'yes') %}butt{% else %}round{% endif %}
  247. offset: |
  248. {% if foot and tags.segregated == 'yes' %}1{% else %}0{% endif %}
  249. style:foot:
  250. fill: false
  251. width: |
  252. {% if foot and tags.segregated == 'yes' %}
  253. 2
  254. {% else %}
  255. 3
  256. {% endif %}
  257. color: |
  258. {{ const.categories.footway.color }}
  259. dashArray: |
  260. {% if foot and tags.segregated != 'yes' %}
  261. 3,3
  262. {% endif %}
  263. dashOffset: 3
  264. lineCap: |
  265. {% if foot and tags.segregated != 'yes' %}butt{% else %}round{% endif %}
  266. offset: |
  267. {% if foot and tags.segregated == 'yes' %}-1{% else %}0{% endif %}
  268. style:left:
  269. width: 3
  270. offset: |
  271. {{ -5 / map.metersPerPixel }}
  272. color: |
  273. {{ const.categories.sidewalk.color }}
  274. style:right:
  275. width: 3
  276. offset: |
  277. {{ 5 / map.metersPerPixel }}
  278. color: |
  279. {{ const.categories.sidewalk.color }}
  280. style:leftr:
  281. width: |
  282. {{ sidewalk_left ? 5 / map.metersPerPixel : 0 }}
  283. offset: |
  284. {{ -2.5 / map.metersPerPixel }}
  285. opacity: 0.3
  286. dashArray: '1,10'
  287. lineCap: butt
  288. color: |
  289. {{ sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color }}
  290. style:rightr:
  291. width: |
  292. {{ sidewalk_right ? 5 / map.metersPerPixel : 0 }}
  293. offset: |
  294. {{ 2.5 / map.metersPerPixel }}
  295. opacity: 0.3
  296. dashArray: '1,10'
  297. lineCap: butt
  298. color: |
  299. {{ sidewalk_right in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color }}
  300. styles: |
  301. {{ sides|join(',') }}
  302. info: |
  303. <table>
  304. {% for k, d in const.categories if k != 'cycleway' %}
  305. <tr>
  306. <td>{{ markerLine({
  307. width: d.width|default(3),
  308. color: d.color,
  309. dashArray: d.dashArray
  310. }) }}</td>
  311. <td>{{ tagTrans(d.key|default('highway'), k) }}</td>
  312. </tr>
  313. {% endfor %}
  314. <tr>
  315. <td>{{ markerCircle({
  316. width: 0,
  317. radius: 5,
  318. fillOpacity: 1,
  319. fill: true,
  320. color: const.categories.crossing.color
  321. }) }}</td>
  322. <td>{{ tagTrans('highway', 'crossing') }}</td>
  323. </tr>
  324. <tr>
  325. <td>{{ markerLine({
  326. styles: 'default,foot',
  327. style: {
  328. width: 4,
  329. color: const.categories.cycleway.color,
  330. dashArray: '3,3'
  331. },
  332. 'style:foot': {
  333. width: 4,
  334. color: const.categories.footway.color,
  335. dashArray: '3,3',
  336. dashOffset: 3
  337. }
  338. }) }}</td>
  339. <td>{{ tagTrans('highway', 'cycleway segregated=no') }}</td>
  340. </tr>
  341. <tr>
  342. <td>{{ markerLine({
  343. styles: 'default,foot',
  344. style: {
  345. width: 2,
  346. color: const.categories.cycleway.color,
  347. offset: -1
  348. },
  349. 'style:foot': {
  350. width: 2,
  351. color: const.categories.footway.color,
  352. offset: 1
  353. }
  354. }) }}</td>
  355. <td>{{ tagTrans('highway', 'cycleway segregated=yes') }}</td>
  356. </tr>
  357. {% for k, d in const.sidewalks %}
  358. <tr>
  359. <td>{{ markerLine({
  360. styles: d.styles,
  361. 'style:leftr': {
  362. width: 9,
  363. offset: -1,
  364. opacity: 0.3,
  365. dashArray: '1,10',
  366. lineCap: butt,
  367. color: d.color
  368. },
  369. 'style:left': {
  370. width: 3,
  371. offset: -7,
  372. color: d.color
  373. }
  374. }) }}</td>
  375. <td>{{ tagTrans('sidewalk', k) }}</td>
  376. </tr>
  377. {% endfor %}
  378. </table>
  379. const:
  380. categories:
  381. sidewalk:
  382. color: '#ff007f'
  383. key: footway
  384. pedestrian:
  385. color: '#ff00c8'
  386. width: 5
  387. footway:
  388. color: '#ab00ff'
  389. path:
  390. color: '#ee922d'
  391. steps:
  392. color: '#ab00ff'
  393. dashArray: '3,3'
  394. crossing:
  395. color: '#964e00'
  396. cycleway:
  397. color: '#002aff'
  398. platform:
  399. key: railway
  400. color: '#00ff00'
  401. sidewalks:
  402. 'yes':
  403. color: '#ff007f'
  404. styles: 'leftr,left'
  405. 'separate':
  406. color: '#ff007f'
  407. styles: 'leftr'
  408. 'no':
  409. color: '#000000'
  410. styles: 'leftr'