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.

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