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.

332 lines
9.4 KiB

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