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.

338 lines
9.7 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. markerSymbol: ""
  78. listMarkerSymbol: |
  79. {% if tags.area == 'yes' %}
  80. polygon
  81. {% elseif 'node' in sides %}
  82. {{ markerCircle({ width: 0, radius: 5, fillOpacity: 1, fill: true, color: const.categories[category].color }) }}
  83. {% else %}
  84. {{ markerLine({
  85. 'styles': sides|join(','),
  86. 'style:main': {
  87. width: foot and tags.segregated == 'yes' ? 2 : const.categories[category].width|default(3),
  88. color: const.categories[category].color,
  89. dashArray: tags.highway == 'steps' or (foot and tags.segregated != 'yes') ? '3,3' : '',
  90. lineCap: tags.highway == 'steps' or (foot and tags.segregated != 'yes') ? 'butt' : 'round',
  91. offset: foot and tags.segregated == 'yes' ? 1 : 0
  92. },
  93. 'style:foot': {
  94. fill: false,
  95. width: foot and tags.segregated == 'yes' ? 2 : 3,
  96. color: const.categories.footway.color,
  97. dashArray: foot and tags.segregated != 'yes' ? '3,3' : '',
  98. dashOffset: 3,
  99. lineCap: foot and tags.segregated != 'yes' ? 'butt' : 'round',
  100. offset: foot and tags.segregated == 'yes' ? -1 : 0
  101. },
  102. 'style:left': {
  103. width: 3,
  104. offset: -6,
  105. color: const.categories.sidewalk.color
  106. },
  107. 'style:right': {
  108. width: 3,
  109. offset: 6,
  110. color: const.categories.sidewalk.color
  111. },
  112. 'style:leftr': {
  113. width: sidewalk_left ? 5 : 0,
  114. offset: -2.5,
  115. opacity: 0.3,
  116. dashArray: '1,10',
  117. lineCap: butt,
  118. color: sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color
  119. },
  120. 'style:rightr': {
  121. width: sidewalk_right ? 5 : 0,
  122. offset: 2.5,
  123. opacity: 0.3,
  124. dashArray: '1,10',
  125. lineCap: butt,
  126. color: sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color
  127. },
  128. }) }}
  129. {% endif %}
  130. style:
  131. opacity: 0
  132. fillOpacity: 0
  133. width: 5
  134. style:node:
  135. width: 0
  136. radius: 5
  137. fillOpacity: 1
  138. fill: true
  139. color: |
  140. {{ const.categories[category].color }}
  141. style:main:
  142. fill: |
  143. {% if tags.area == 'yes' %}true{% else %}false{% endif %}
  144. width: |
  145. {% if tags.area == 'yes' %}
  146. 1
  147. {% elseif foot and tags.segregated == 'yes' %}
  148. 2
  149. {% else %}
  150. {{ const.categories[category].width|default(3) }}
  151. {% endif %}
  152. color: |
  153. {{ const.categories[category].color }}
  154. dashArray: |
  155. {% if tags.highway == 'steps' or (foot and tags.segregated != 'yes') %}
  156. 3,3
  157. {% endif %}
  158. lineCap: |
  159. {% if tags.highway == 'steps' or (foot and tags.segregated != 'yes') %}butt{% else %}round{% endif %}
  160. offset: |
  161. {% if foot and tags.segregated == 'yes' %}1{% else %}0{% endif %}
  162. style:foot:
  163. fill: false
  164. width: |
  165. {% if foot and tags.segregated == 'yes' %}
  166. 2
  167. {% else %}
  168. 3
  169. {% endif %}
  170. color: |
  171. {{ const.categories.footway.color }}
  172. dashArray: |
  173. {% if foot and tags.segregated != 'yes' %}
  174. 3,3
  175. {% endif %}
  176. dashOffset: 3
  177. lineCap: |
  178. {% if foot and tags.segregated != 'yes' %}butt{% else %}round{% endif %}
  179. offset: |
  180. {% if foot and tags.segregated == 'yes' %}-1{% else %}0{% endif %}
  181. style:left:
  182. width: 3
  183. offset: |
  184. {{ -5 / map.metersPerPixel }}
  185. color: |
  186. {{ const.categories.sidewalk.color }}
  187. style:right:
  188. width: 3
  189. offset: |
  190. {{ 5 / map.metersPerPixel }}
  191. color: |
  192. {{ const.categories.sidewalk.color }}
  193. style:leftr:
  194. width: |
  195. {{ sidewalk_left ? 5 / map.metersPerPixel : 0 }}
  196. offset: |
  197. {{ -2.5 / map.metersPerPixel }}
  198. opacity: 0.3
  199. dashArray: '1,10'
  200. lineCap: butt
  201. color: |
  202. {{ sidewalk_left in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color }}
  203. style:rightr:
  204. width: |
  205. {{ sidewalk_right ? 5 / map.metersPerPixel : 0 }}
  206. offset: |
  207. {{ 2.5 / map.metersPerPixel }}
  208. opacity: 0.3
  209. dashArray: '1,10'
  210. lineCap: butt
  211. color: |
  212. {{ sidewalk_right in ['no', 'none'] ? '#000000' : const.categories.sidewalk.color }}
  213. styles: |
  214. {{ sides|join(',') }}
  215. info: |
  216. <table>
  217. {% for k, d in const.categories if k != 'cycleway' %}
  218. <tr>
  219. <td>{{ markerLine({
  220. width: d.width|default(3),
  221. color: d.color,
  222. dashArray: d.dashArray
  223. }) }}</td>
  224. <td>{{ tagTrans(d.key|default('highway'), k) }}</td>
  225. </tr>
  226. {% endfor %}
  227. <tr>
  228. <td>{{ markerCircle({
  229. width: 0,
  230. radius: 5,
  231. fillOpacity: 1,
  232. fill: true,
  233. color: const.categories.crossing.color
  234. }) }}</td>
  235. <td>{{ tagTrans('highway', 'crossing') }}</td>
  236. </tr>
  237. <tr>
  238. <td>{{ markerLine({
  239. styles: 'default,foot',
  240. style: {
  241. width: 4,
  242. color: const.categories.cycleway.color,
  243. dashArray: '3,3'
  244. },
  245. 'style:foot': {
  246. width: 4,
  247. color: const.categories.footway.color,
  248. dashArray: '3,3',
  249. dashOffset: 3
  250. }
  251. }) }}</td>
  252. <td>{{ tagTrans('highway', 'cycleway segregated=no') }}</td>
  253. </tr>
  254. <tr>
  255. <td>{{ markerLine({
  256. styles: 'default,foot',
  257. style: {
  258. width: 2,
  259. color: const.categories.cycleway.color,
  260. offset: -1
  261. },
  262. 'style:foot': {
  263. width: 2,
  264. color: const.categories.footway.color,
  265. offset: 1
  266. }
  267. }) }}</td>
  268. <td>{{ tagTrans('highway', 'cycleway segregated=yes') }}</td>
  269. </tr>
  270. {% for k, d in const.sidewalks %}
  271. <tr>
  272. <td>{{ markerLine({
  273. styles: d.styles,
  274. 'style:leftr': {
  275. width: 9,
  276. offset: -1,
  277. opacity: 0.3,
  278. dashArray: '1,10',
  279. lineCap: butt,
  280. color: d.color
  281. },
  282. 'style:left': {
  283. width: 3,
  284. offset: -7,
  285. color: d.color
  286. }
  287. }) }}</td>
  288. <td>{{ tagTrans('sidewalk', k) }}</td>
  289. </tr>
  290. {% endfor %}
  291. </table>
  292. const:
  293. categories:
  294. sidewalk:
  295. color: '#ff007f'
  296. key: footway
  297. pedestrian:
  298. color: '#ff00c8'
  299. width: 5
  300. footway:
  301. color: '#ab00ff'
  302. path:
  303. color: '#ee922d'
  304. steps:
  305. color: '#ab00ff'
  306. dashArray: '3,3'
  307. crossing:
  308. color: '#964e00'
  309. cycleway:
  310. color: '#002aff'
  311. platform:
  312. key: railway
  313. color: '#00ff00'
  314. sidewalks:
  315. 'yes':
  316. color: '#ff007f'
  317. styles: 'leftr,left'
  318. 'separate':
  319. color: '#ff007f'
  320. styles: 'leftr'
  321. 'no':
  322. color: '#000000'
  323. styles: 'leftr'