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.

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