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.

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