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.

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