Sat, 26 Sep 2020 01:31:37 +0300
added square.svg from osm-carto
0 | 1 | scale: 1 |
2 | metatile: 2 | |
3 | name: | |
4 | description: A general-purpose OpenStreetMap mapnik style, in CartoCSS | |
5 | bounds: &world | |
6 | - -180 | |
7 | - -85.05112877980659 | |
8 | - 180 | |
9 | - 85.05112877980659 | |
10 | center: | |
11 | - 0 | |
12 | - 0 | |
13 | - 4 | |
14 | format: png | |
15 | interactivity: false | |
16 | minzoom: 0 | |
17 | maxzoom: 22 | |
18 | srs: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" | |
19 | ||
20 | # Various parts to be included later on | |
21 | _parts: | |
22 | # Extents are used for tilemill, and don't actually make it to the generated XML | |
23 | extents: &extents | |
24 | extent: *world | |
25 | srs-name: "900913" | |
26 | srs: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" | |
27 | osm2pgsql: &osm2pgsql | |
28 | type: "postgis" | |
29 | dbname: "gis" | |
30 | key_field: "" | |
31 | geometry_field: "way" | |
32 | extent: "-20037508,-20037508,20037508,20037508" | |
33 | ||
34 | Stylesheet: | |
35 | - style/style.mss | |
36 | - style/roads.mss | |
37 | - style/buildings.mss | |
38 | - style/places.mss | |
39 | - style/shapefiles.mss | |
40 | - style/amenity.mss | |
41 | - style/roadref.mss | |
42 | Layer: | |
43 | - id: landcover | |
44 | geometry: polygon | |
45 | <<: *extents | |
46 | Datasource: | |
47 | <<: *osm2pgsql | |
48 | table: |- | |
49 | (SELECT | |
50 | way, | |
51 | (CASE WHEN | |
52 | "landuse" IN ('grass', 'meadow', 'recreation_ground') | |
53 | OR ("leisure" IN ('park', 'playground', 'arena', 'stadium', 'sports_centre') AND landuse IS NULL) | |
54 | OR "natural" = 'scrub' | |
55 | THEN 'grass' | |
56 | ELSE CASE WHEN ("landuse" IN ('commercial', 'retail') OR "amenity" IN ('bus_station', 'ferry_terminal')) | |
57 | THEN 'commercial' | |
58 | ELSE CASE WHEN ("natural" = 'wood' OR "landuse" = 'forest') | |
59 | THEN 'forest' | |
60 | ELSE CASE WHEN ("natural" = 'water' OR "landuse" IN ('reservoir')) | |
61 | THEN 'water' | |
62 | ELSE CASE WHEN ("landuse" IN ('religious', 'cemetery') OR "amenity" = 'grave_yard') | |
63 | THEN 'religious' | |
64 | ELSE CASE WHEN ("landuse" = 'railway') | |
65 | THEN 'industrial' | |
2 | 66 | ELSE CASE WHEN ("natural" = 'wetland') |
67 | THEN 'wetland' | |
68 | ELSE "landuse" | |
69 | END | |
0 | 70 | END |
71 | END | |
72 | END | |
73 | END | |
74 | END | |
75 | END) AS feature, | |
76 | way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels, | |
77 | way_area | |
78 | FROM planet_osm_polygon | |
79 | WHERE (landuse IN ('forest', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow', 'grass', 'vineyard', 'orchard', 'religious', 'railway', 'construction', 'cemetery') | |
80 | OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub', 'water')) | |
81 | OR "leisure" IN ('park', 'playground', 'arena', 'stadium', 'sports_centre') | |
82 | OR "amenity" IN ('bus_station', 'ferry_terminal', 'grave_yard') | |
83 | AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real | |
84 | AND building IS NULL | |
85 | ORDER BY way_area DESC, feature | |
86 | ) AS landcover | |
87 | properties: | |
88 | cache-features: true | |
89 | minzoom: 5 | |
90 | - id: inland-water | |
91 | geometry: polygon | |
92 | <<: *extents | |
93 | Datasource: | |
94 | <<: *osm2pgsql | |
95 | table: |- | |
96 | (SELECT | |
97 | way | |
98 | FROM planet_osm_polygon | |
99 | WHERE ("natural" = 'water' OR landuse IN ('reservoir', 'basin') OR waterway = 'riverbank') | |
100 | ) AS landcover | |
101 | properties: | |
102 | cache-features: true | |
103 | minzoom: 5 | |
104 | - id: ocean-lz | |
105 | geometry: polygon | |
106 | <<: *extents | |
107 | Datasource: | |
108 | <<: *osm2pgsql | |
109 | table: |- | |
110 | (SELECT | |
111 | way | |
112 | FROM simplified_water_polygons | |
113 | ) AS ocean_lz | |
114 | properties: | |
115 | maxzoom: 9 | |
116 | - id: civic-services | |
117 | geometry: polygon | |
118 | <<: *extents | |
119 | Datasource: | |
120 | <<: *osm2pgsql | |
121 | table: |- | |
122 | (SELECT | |
123 | way | |
124 | FROM planet_osm_polygon | |
125 | WHERE ("amenity" IN ('hospital', 'community_centre', 'fire_station', 'school', 'university', 'kindergarten', 'childcare', 'social_facility') OR landuse IN ('civic_services', 'civic_admin')) | |
126 | ) AS civic_services | |
127 | properties: | |
128 | cache-features: true | |
129 | minzoom: 5 | |
130 | - id: aerodrome | |
131 | geometry: polygon | |
132 | Datasource: | |
133 | <<: *osm2pgsql | |
134 | table: |- | |
135 | (SELECT | |
136 | way | |
137 | FROM planet_osm_polygon | |
138 | WHERE aeroway = 'aerodrome' | |
139 | ) AS aerodrome | |
140 | properties: | |
141 | minzoom: 10 | |
142 | - id: runway | |
143 | geometry: line | |
144 | Datasource: | |
145 | <<: *osm2pgsql | |
146 | table: |- | |
147 | (SELECT | |
148 | way, | |
149 | aeroway, | |
150 | ref | |
151 | FROM planet_osm_line | |
152 | WHERE aeroway IN ('runway', 'taxiway') | |
153 | ) AS aerodrome | |
154 | properties: | |
155 | minzoom: 10 | |
156 | - id: ocean | |
157 | geometry: polygon | |
158 | <<: *extents | |
159 | Datasource: | |
160 | <<: *osm2pgsql | |
161 | table: |- | |
162 | (SELECT | |
163 | way | |
164 | FROM water_polygons | |
165 | ) AS ocean | |
166 | properties: | |
167 | minzoom: 10 | |
168 | - id: coastline | |
169 | geometry: line | |
170 | <<: *extents | |
171 | Datasource: | |
172 | <<: *osm2pgsql | |
173 | table: |- | |
174 | (SELECT way FROM planet_osm_line WHERE "natural" = 'coastline') AS coastlines | |
175 | properties: | |
176 | minzoom: 12 | |
177 | - id: buildings | |
178 | geometry: polygon | |
179 | <<: *extents | |
180 | Datasource: | |
181 | <<: *osm2pgsql | |
182 | table: |- | |
183 | (SELECT | |
184 | way, | |
185 | building | |
186 | FROM planet_osm_polygon | |
187 | WHERE building IS NOT NULL | |
188 | ) AS landcover | |
189 | properties: | |
190 | cache-features: true | |
191 | minzoom: 14 | |
192 | - id: road-casing-low-zoom | |
193 | geometry: line | |
194 | Datasource: | |
195 | <<: *osm2pgsql | |
196 | table: &road_low_zoom_sql |- | |
197 | (SELECT | |
198 | way, | |
199 | highway | |
200 | FROM planet_osm_roads | |
201 | WHERE "highway" IN ('primary', 'trunk') | |
202 | AND (tags->"access" IS NULL OR tags->"access" NOT IN ('private', 'no')) | |
203 | ORDER BY | |
204 | CASE | |
205 | WHEN highway = 'trunk' THEN 37 | |
206 | WHEN highway = 'primary' THEN 36 | |
207 | END ASC NULLS LAST | |
208 | ) AS road | |
209 | properties: | |
210 | minzoom: 4 | |
211 | maxzoom: 9 | |
212 | - id: road-low-zoom | |
213 | geometry: line | |
214 | Datasource: | |
215 | <<: *osm2pgsql | |
216 | table: *road_low_zoom_sql | |
217 | properties: | |
218 | minzoom: 4 | |
219 | maxzoom: 9 | |
2 | 220 | - id: foot-routes-layer-n1 |
221 | geometry: linestring | |
222 | <<: *extents | |
223 | Datasource: | |
224 | <<: *osm2pgsql | |
225 | table: &foot_routes_sql |- | |
226 | (SELECT | |
227 | way, | |
228 | osm_way_id, | |
229 | route, | |
230 | COALESCE(layer::integer, 0) AS layer | |
231 | FROM planet_osm_routes | |
232 | WHERE "route" IN ('hiking', 'foot', 'bicycle_lcn', 'bicycle_rcn', 'bicycle_ncn', 'bicycle_icn') | |
233 | ORDER BY | |
234 | CASE | |
235 | WHEN route = 'bicycle_icn' THEN 30 | |
236 | WHEN route = 'bicycle_ncn' THEN 31 | |
237 | WHEN route = 'bicycle_rcn' THEN 32 | |
238 | WHEN route = 'bicycle_lcn' THEN 33 | |
239 | WHEN route = 'foot' THEN 34 | |
240 | WHEN route = 'hiking' THEN 35 | |
241 | END DESC NULLS LAST | |
242 | ) AS foot_routes | |
243 | properties: | |
244 | minzoom: 14 | |
0 | 245 | - id: road-casing-layer-n1 |
246 | geometry: line | |
247 | Datasource: | |
248 | <<: *osm2pgsql | |
249 | table: &road_sql |- | |
250 | (SELECT | |
251 | way, | |
252 | (CASE WHEN "highway" IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary') | |
253 | THEN 'road_major' | |
254 | ELSE CASE WHEN "highway" IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 'residential', 'unclassified', 'living_street') | |
255 | THEN 'road_minor' | |
256 | ELSE CASE WHEN "highway" IN ('path', 'footway', 'cycleway', 'track', 'steps', 'pedestrian', 'platform') | |
257 | THEN 'road_path' | |
258 | ELSE 'road_' || "highway" | |
259 | END | |
260 | END | |
261 | END) AS feature, | |
262 | name, | |
263 | minority_name, | |
264 | highway, | |
265 | COALESCE(layer::integer, 0) AS layer | |
266 | FROM planet_osm_line | |
267 | WHERE "highway" IS NOT NULL | |
268 | AND (tags->"access" IS NULL OR tags->"access" NOT IN ('private', 'no')) | |
269 | ORDER BY | |
270 | CASE | |
271 | WHEN highway = 'motorway' THEN 38 | |
272 | WHEN highway = 'trunk' THEN 37 | |
273 | WHEN highway = 'primary' THEN 36 | |
274 | WHEN highway = 'secondary' THEN 35 | |
275 | WHEN highway = 'tertiary' THEN 34 | |
276 | ||
277 | WHEN highway = 'motorway_link' THEN 28 | |
278 | WHEN highway = 'trunk_link' THEN 27 | |
279 | WHEN highway = 'primary_link' THEN 26 | |
280 | WHEN highway = 'secondary_link' THEN 25 | |
281 | WHEN highway = 'tertiary_link' THEN 24 | |
282 | ||
283 | WHEN highway = 'residential' THEN 10 | |
284 | WHEN highway = 'unclassified' THEN 10 | |
285 | WHEN highway = 'path' THEN 8 | |
286 | WHEN highway = 'footway' THEN 8 | |
287 | WHEN highway = 'cycleway' THEN 8 | |
288 | WHEN highway = 'service' THEN 5 | |
289 | ||
290 | WHEN highway = 'runway' THEN 6 | |
291 | WHEN highway = 'taxiway' THEN 5 | |
292 | END ASC NULLS LAST | |
293 | ) AS road | |
294 | properties: | |
295 | minzoom: 10 | |
296 | - id: road-layer-n1 | |
297 | geometry: line | |
298 | Datasource: | |
299 | <<: *osm2pgsql | |
300 | table: *road_sql | |
301 | properties: | |
302 | minzoom: 10 | |
5 | 303 | - id: bus-route-layer-n1 |
304 | geometry: linestring | |
305 | <<: *extents | |
306 | Datasource: | |
307 | <<: *osm2pgsql | |
308 | table: &bus_routes_sql |- | |
309 | (SELECT DISTINCT | |
310 | way, | |
311 | COALESCE(layer::integer, 0) AS layer | |
312 | FROM planet_osm_routes | |
313 | WHERE "route" = 'bus' | |
314 | ) AS bus_routes | |
315 | properties: | |
316 | minzoom: 15 | |
0 | 317 | - id: rail-layer-n1 |
318 | geometry: linestring | |
319 | Datasource: | |
320 | <<: *osm2pgsql | |
321 | table: &rail_sql |- | |
322 | (SELECT | |
323 | way, | |
324 | name, | |
325 | minority_name, | |
326 | service, | |
327 | COALESCE(layer::integer, 0) AS layer, | |
328 | tags->'electrified' AS electrified, | |
329 | tags->'usage' AS usage | |
330 | FROM planet_osm_line | |
331 | WHERE "railway" = 'rail' | |
332 | ORDER BY | |
333 | CASE | |
334 | WHEN service IS NULL THEN 20 | |
335 | WHEN service IS NOT NULL THEN 30 | |
336 | END DESC NULLS LAST | |
337 | ) AS rail | |
338 | - id: road-casing | |
339 | geometry: line | |
340 | Datasource: | |
341 | <<: *osm2pgsql | |
342 | table: *road_sql | |
343 | properties: | |
344 | minzoom: 12 | |
2 | 345 | - id: foot-routes |
346 | geometry: linestring | |
347 | <<: *extents | |
348 | Datasource: | |
349 | <<: *osm2pgsql | |
350 | table: *foot_routes_sql | |
351 | properties: | |
352 | minzoom: 14 | |
0 | 353 | - id: road |
354 | geometry: line | |
355 | Datasource: | |
356 | <<: *osm2pgsql | |
357 | table: *road_sql | |
358 | properties: | |
359 | minzoom: 12 | |
5 | 360 | - id: bus-route |
361 | geometry: linestring | |
362 | <<: *extents | |
363 | Datasource: | |
364 | <<: *osm2pgsql | |
365 | table: *bus_routes_sql | |
366 | properties: | |
367 | minzoom: 15 | |
0 | 368 | - id: rail |
369 | geometry: linestring | |
370 | Datasource: | |
371 | <<: *osm2pgsql | |
372 | table: *rail_sql | |
373 | - id: bridge-area | |
374 | geometry: polygon | |
375 | Datasource: | |
376 | <<: *osm2pgsql | |
377 | table: &bridge_area_sql |- | |
378 | (SELECT | |
379 | way, | |
380 | name, | |
381 | bilingual_name, | |
382 | '0' AS natural | |
383 | FROM planet_osm_polygon | |
384 | WHERE "man_made" = 'bridge' | |
385 | ) AS bridge_area | |
386 | properties: | |
387 | minzoom: 12 | |
2 | 388 | - id: foot-routes-layer-1 |
389 | geometry: linestring | |
390 | <<: *extents | |
391 | Datasource: | |
392 | <<: *osm2pgsql | |
393 | table: *foot_routes_sql | |
394 | properties: | |
395 | minzoom: 14 | |
0 | 396 | - id: road-casing-layer-1 |
397 | geometry: line | |
398 | Datasource: | |
399 | <<: *osm2pgsql | |
400 | table: *road_sql | |
401 | properties: | |
402 | minzoom: 12 | |
403 | - id: road-layer-1 | |
404 | geometry: line | |
405 | Datasource: | |
406 | <<: *osm2pgsql | |
407 | table: *road_sql | |
408 | properties: | |
409 | minzoom: 12 | |
5 | 410 | - id: bus-route-layer-1 |
411 | geometry: linestring | |
412 | <<: *extents | |
413 | Datasource: | |
414 | <<: *osm2pgsql | |
415 | table: *bus_routes_sql | |
416 | properties: | |
417 | minzoom: 15 | |
0 | 418 | - id: rail-layer-1 |
419 | geometry: linestring | |
420 | Datasource: | |
421 | <<: *osm2pgsql | |
422 | table: *rail_sql | |
423 | - id: place-major | |
424 | geometry: point | |
425 | Datasource: | |
426 | <<: *osm2pgsql | |
427 | table: |- | |
428 | (SELECT | |
429 | way, | |
430 | name, | |
431 | bilingual_name, | |
3
89b6a7562889
fix rendering of Helsinki
Teemu Piippo <teemu@hecknology.net>
parents:
2
diff
changeset
|
432 | place, |
89b6a7562889
fix rendering of Helsinki
Teemu Piippo <teemu@hecknology.net>
parents:
2
diff
changeset
|
433 | capital |
0 | 434 | FROM planet_osm_point |
435 | WHERE "place" IN ('city', 'town') | |
3
89b6a7562889
fix rendering of Helsinki
Teemu Piippo <teemu@hecknology.net>
parents:
2
diff
changeset
|
436 | ORDER BY population DESC NULLS LAST |
0 | 437 | ) AS place_major |
438 | properties: | |
439 | minzoom: 6 | |
440 | maxzoom: 15 | |
441 | - id: train-stations | |
442 | geometry: point | |
443 | Datasource: | |
444 | <<: *osm2pgsql | |
445 | table: |- | |
446 | (SELECT | |
447 | way, | |
448 | name, | |
449 | bilingual_name, | |
450 | railway, | |
6
0575190fa5fc
better train station rendering
Teemu Piippo <teemu@hecknology.net>
parents:
5
diff
changeset
|
451 | COALESCE(tags->'network', 'FI:local') AS network, |
0575190fa5fc
better train station rendering
Teemu Piippo <teemu@hecknology.net>
parents:
5
diff
changeset
|
452 | tags->'railway:ref' AS ref, |
0575190fa5fc
better train station rendering
Teemu Piippo <teemu@hecknology.net>
parents:
5
diff
changeset
|
453 | (CASE WHEN tags->'station' = 'subway' THEN 1 ELSE 0 END) AS subway |
0 | 454 | FROM planet_osm_point |
455 | WHERE "railway" IN ('station', 'halt') | |
456 | ) AS train_stations | |
457 | - id: place-medium | |
458 | geometry: point | |
459 | Datasource: | |
460 | <<: *osm2pgsql | |
461 | table: |- | |
462 | (SELECT | |
463 | way, | |
464 | name, | |
465 | bilingual_name, | |
466 | place | |
467 | FROM planet_osm_point | |
468 | WHERE "place" IN ('suburb', 'borough', 'village') | |
469 | ) AS place_medium | |
470 | properties: | |
471 | minzoom: 12 | |
472 | maxzoom: 17 | |
473 | - id: stations | |
474 | geometry: point | |
475 | Datasource: | |
476 | <<: *osm2pgsql | |
477 | table: |- | |
478 | (SELECT | |
479 | way, | |
480 | name, | |
481 | bilingual_name, | |
482 | COALESCE( | |
483 | 'amenity_' || CASE WHEN amenity IN ('bus_station') THEN amenity END | |
484 | ) AS feature | |
485 | FROM | |
486 | ( | |
487 | SELECT | |
488 | ST_PointOnSurface(way) AS way, | |
489 | name, | |
490 | bilingual_name, | |
491 | amenity | |
492 | FROM planet_osm_polygon | |
493 | WHERE way && !bbox! | |
494 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
495 | UNION ALL | |
496 | SELECT | |
497 | way, | |
498 | bilingual_name, | |
499 | name, | |
500 | amenity | |
501 | FROM planet_osm_point | |
502 | WHERE way && !bbox! | |
503 | ) AS station_subquery | |
504 | WHERE ( | |
505 | "amenity" IN ('bus_station') | |
506 | ) | |
507 | ) AS stations | |
508 | properties: | |
509 | minzoom: 13 | |
510 | - id: place-natural | |
511 | geometry: polygon | |
512 | Datasource: | |
513 | <<: *osm2pgsql | |
514 | table: |- | |
515 | (SELECT | |
516 | way, | |
517 | name, | |
518 | bilingual_name, | |
519 | place, | |
520 | way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels, | |
521 | way_area | |
522 | FROM planet_osm_polygon | |
523 | WHERE ( | |
524 | "place" IN ('island', 'peninsula', 'isthmus', 'islet') | |
525 | OR "natural" IN ('peak', 'hill', 'fell') | |
526 | ) | |
527 | ) AS place_natural | |
528 | properties: | |
529 | minzoom: 8 | |
530 | - id: place-minor | |
531 | geometry: point | |
532 | Datasource: | |
533 | <<: *osm2pgsql | |
534 | table: |- | |
535 | (SELECT | |
536 | way, | |
537 | name, | |
538 | bilingual_name, | |
539 | (CASE WHEN ("place" = 'locality' OR "natural" IN ('peak', 'hill', 'fell')) THEN 1 ELSE 0 END) AS natural | |
540 | FROM planet_osm_point | |
541 | WHERE ( | |
542 | "place" IN ('neighbourhood', 'quarter', 'farm', 'hamlet', 'locality') | |
543 | OR "natural" IN ('peak', 'hill', 'fell') | |
544 | ) | |
545 | ) AS place_medium | |
546 | properties: | |
547 | minzoom: 15 | |
548 | - id: train-sites | |
549 | geometry: point | |
550 | Datasource: | |
551 | <<: *osm2pgsql | |
552 | table: |- | |
553 | (SELECT | |
554 | way, | |
555 | name, | |
556 | bilingual_name, | |
557 | railway, | |
558 | tags->'railway:ref' AS ref | |
559 | FROM planet_osm_point | |
560 | WHERE "railway" IN ('site', 'yard', 'crossover', 'junction', 'technical_station', 'service_station') | |
561 | ) AS train_stations | |
562 | - id: poi-name | |
563 | geometry: polygon | |
564 | Datasource: | |
565 | <<: *osm2pgsql | |
566 | table: |- | |
567 | (SELECT | |
568 | way, | |
569 | name, | |
570 | bilingual_name, | |
571 | 0 as natural | |
572 | FROM | |
573 | ( | |
574 | SELECT | |
575 | ST_PointOnSurface(way) AS way, | |
576 | name, | |
577 | bilingual_name, | |
578 | man_made, | |
579 | building, | |
580 | leisure, | |
581 | amenity, | |
582 | historic | |
583 | FROM planet_osm_polygon | |
584 | WHERE way && !bbox! | |
585 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
586 | UNION ALL | |
587 | SELECT | |
588 | way, | |
589 | name, | |
590 | bilingual_name, | |
591 | building, | |
592 | man_made, | |
593 | leisure, | |
594 | amenity, | |
595 | historic | |
596 | FROM planet_osm_point | |
597 | WHERE way && !bbox! | |
598 | ) AS poi_name_subquery | |
599 | WHERE ( | |
600 | "man_made" IN ('bridge') | |
601 | OR "amenity" IN ('hospital', 'university', 'exhibition_centre') | |
602 | OR "leisure" IN ('stadium') | |
603 | OR "historic" IN ('castle') | |
604 | ) | |
605 | ) AS poi_name | |
606 | properties: | |
607 | minzoom: 15 | |
608 | - id: poi-name-medium | |
609 | geometry: polygon | |
610 | Datasource: | |
611 | <<: *osm2pgsql | |
612 | table: |- | |
613 | (SELECT | |
614 | way, | |
615 | name, | |
616 | bilingual_name, | |
617 | shop, | |
618 | 0 as natural | |
619 | FROM | |
620 | ( | |
621 | SELECT | |
622 | ST_PointOnSurface(way) AS way, | |
623 | name, | |
624 | bilingual_name, | |
625 | amenity, | |
626 | shop | |
627 | FROM planet_osm_polygon | |
628 | WHERE way && !bbox! | |
629 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
630 | UNION ALL | |
631 | SELECT | |
632 | way, | |
633 | name, | |
634 | bilingual_name, | |
635 | shop, | |
636 | amenity | |
637 | FROM planet_osm_point | |
638 | WHERE way && !bbox! | |
639 | ) AS poi_name_subquery | |
640 | WHERE ( | |
641 | "amenity" IN ('school', 'marketplace', 'fire_station') | |
642 | OR "shop" = 'mall' | |
643 | ) | |
644 | ) AS poi_name_medium | |
645 | properties: | |
646 | minzoom: 16 | |
647 | - id: aerodrome-name | |
648 | geometry: point | |
649 | Datasource: | |
650 | <<: *osm2pgsql | |
651 | table: |- | |
652 | (SELECT | |
653 | way, | |
654 | aeroway, | |
655 | name, | |
656 | bilingual_name, | |
657 | ref | |
658 | FROM | |
659 | ( | |
660 | SELECT | |
661 | ST_PointOnSurface(way) AS way, | |
662 | aeroway, | |
663 | name, | |
664 | bilingual_name, | |
665 | COALESCE(tags->'iata', tags->'icao', ref) as ref | |
666 | FROM planet_osm_polygon | |
667 | WHERE way && !bbox! | |
668 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
669 | UNION ALL | |
670 | SELECT | |
671 | way, | |
672 | aeroway, | |
673 | name, | |
674 | bilingual_name, | |
675 | COALESCE(tags->'iata', tags->'icao', ref) as ref | |
676 | FROM planet_osm_point | |
677 | WHERE way && !bbox! | |
678 | ) AS station_subquery | |
679 | WHERE "aeroway" = 'aerodrome' | |
680 | ) AS stations | |
681 | properties: | |
682 | minzoom: 9 | |
683 | ||
684 | - id: poi-name-minor | |
685 | geometry: polygon | |
686 | Datasource: | |
687 | <<: *osm2pgsql | |
688 | table: |- | |
689 | (SELECT | |
690 | way, | |
691 | name, | |
692 | bilingual_name, | |
693 | 0 as natural | |
694 | FROM | |
695 | ( | |
696 | SELECT | |
697 | ST_PointOnSurface(way) AS way, | |
698 | name, | |
699 | bilingual_name, | |
700 | highway, | |
701 | area, | |
702 | amenity | |
703 | FROM planet_osm_polygon | |
704 | WHERE way && !bbox! | |
705 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
706 | UNION ALL | |
707 | SELECT | |
708 | way, | |
709 | name, | |
710 | bilingual_name, | |
711 | highway, | |
712 | NULL as area, | |
713 | amenity | |
714 | FROM planet_osm_point | |
715 | WHERE way && !bbox! | |
716 | ) AS poi_name_subquery | |
717 | WHERE ( | |
718 | "amenity" IN ('kindergarten', 'social_facility') | |
719 | OR ("highway" IN ('footway', 'pedestrian') AND area = 'yes') | |
720 | ) | |
721 | ) AS poi_name_medium | |
722 | properties: | |
723 | minzoom: 17 | |
724 | - id: train-milestones | |
725 | geometry: point | |
726 | Datasource: | |
727 | <<: *osm2pgsql | |
728 | table: |- | |
729 | (SELECT | |
730 | way, | |
731 | tags->'railway:position' AS position, | |
732 | railway | |
733 | FROM planet_osm_point | |
734 | WHERE "railway" = 'milestone' | |
735 | ) AS train_milestones | |
736 | - id: road-text | |
737 | geometry: line | |
738 | Datasource: | |
739 | <<: *osm2pgsql | |
740 | table: *road_sql | |
741 | properties: | |
742 | minzoom: 14 | |
743 | - id: road-text-minority | |
744 | geometry: line | |
745 | Datasource: | |
746 | <<: *osm2pgsql | |
747 | table: *road_sql | |
748 | properties: | |
749 | minzoom: 14 | |
2 | 750 | - id: foot-routes-text |
751 | geometry: linestring | |
752 | <<: *extents | |
753 | Datasource: | |
754 | <<: *osm2pgsql | |
755 | table: |- | |
756 | (SELECT | |
757 | way, | |
758 | name, | |
759 | ref, | |
760 | route | |
761 | FROM planet_osm_routes | |
762 | WHERE "route" IN ('hiking', 'foot', 'bicycle_lcn', 'bicycle_rcn', 'bicycle_ncn', 'bicycle_icn') | |
763 | ORDER BY | |
764 | CASE | |
765 | WHEN route = 'bicycle_icn' THEN 30 | |
766 | WHEN route = 'bicycle_ncn' THEN 31 | |
767 | WHEN route = 'bicycle_rcn' THEN 32 | |
768 | WHEN route = 'bicycle_lcn' THEN 33 | |
769 | WHEN route = 'foot' THEN 34 | |
770 | WHEN route = 'hiking' THEN 35 | |
771 | END DESC NULLS LAST | |
772 | ) AS foot_routes | |
773 | properties: | |
774 | minzoom: 15 | |
0 | 775 | - id: roads-text-ref |
776 | geometry: linestring | |
777 | <<: *extents | |
778 | Datasource: | |
779 | <<: *osm2pgsql | |
780 | table: &road-ref-sql |- | |
781 | (SELECT | |
782 | way, | |
783 | highway, | |
784 | refs, | |
785 | ref_1, | |
786 | ref_2, | |
787 | ref_3, | |
788 | ref_4, | |
789 | ref_5, | |
790 | ref_6, | |
791 | ref_class_1, | |
792 | ref_class_2, | |
793 | ref_class_3, | |
794 | ref_class_4, | |
795 | ref_class_5, | |
796 | ref_class_6, | |
797 | ref_length_1, | |
798 | ref_length_2, | |
799 | ref_length_3, | |
800 | ref_length_4, | |
801 | ref_length_5, | |
802 | ref_length_6 | |
803 | FROM ( | |
804 | SELECT | |
805 | osm_id, | |
806 | way, | |
807 | highway, | |
808 | array_to_string(refs, E'\n') AS refs, | |
809 | refs[1] as ref_1, | |
810 | refs[2] as ref_2, | |
811 | refs[3] as ref_3, | |
812 | refs[4] as ref_4, | |
813 | refs[5] as ref_5, | |
814 | refs[6] as ref_6, | |
815 | ref_classes[1] as ref_class_1, | |
816 | ref_classes[2] as ref_class_2, | |
817 | ref_classes[3] as ref_class_3, | |
818 | ref_classes[4] as ref_class_4, | |
819 | ref_classes[5] as ref_class_5, | |
820 | ref_classes[6] as ref_class_6, | |
821 | ref_widths[1] as ref_length_1, | |
822 | ref_widths[2] as ref_length_2, | |
823 | ref_widths[3] as ref_length_3, | |
824 | ref_widths[4] as ref_length_4, | |
825 | ref_widths[5] as ref_length_5, | |
826 | ref_widths[6] as ref_length_6 | |
827 | FROM ( | |
828 | SELECT | |
829 | osm_id, | |
830 | way, | |
831 | highway, | |
832 | string_to_array(ref, ';') AS refs, | |
833 | string_to_array(ref_class, ';') AS ref_classes, | |
834 | string_to_array(ref_width, ';') AS ref_widths | |
835 | FROM planet_osm_line | |
836 | WHERE (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary')) | |
837 | AND ref IS NOT NULL | |
838 | ) AS p) AS q | |
839 | ORDER BY | |
840 | CASE | |
841 | WHEN highway = 'motorway' THEN 38 | |
842 | WHEN highway = 'trunk' THEN 37 | |
843 | WHEN highway = 'primary' THEN 36 | |
844 | WHEN highway = 'secondary' THEN 35 | |
845 | WHEN highway = 'tertiary' THEN 34 | |
846 | WHEN highway = 'taxiway' THEN 5 | |
847 | END DESC NULLS LAST, | |
848 | refs, | |
849 | osm_id | |
850 | ) AS roads_text_ref | |
851 | properties: | |
852 | minzoom: 8 | |
853 | - id: roads-text-ref2 | |
854 | geometry: linestring | |
855 | <<: *extents | |
856 | Datasource: | |
857 | <<: *osm2pgsql | |
858 | table: *road-ref-sql | |
859 | properties: | |
860 | minzoom: 10 | |
861 | - id: roads-text-ref3 | |
862 | geometry: linestring | |
863 | <<: *extents | |
864 | Datasource: | |
865 | <<: *osm2pgsql | |
866 | table: *road-ref-sql | |
867 | properties: | |
868 | minzoom: 10 | |
869 | - id: roads-text-ref4 | |
870 | geometry: linestring | |
871 | <<: *extents | |
872 | Datasource: | |
873 | <<: *osm2pgsql | |
874 | table: *road-ref-sql | |
875 | properties: | |
876 | minzoom: 10 | |
877 | - id: roads-text-ref5 | |
878 | geometry: linestring | |
879 | <<: *extents | |
880 | Datasource: | |
881 | <<: *osm2pgsql | |
882 | table: *road-ref-sql | |
883 | properties: | |
884 | minzoom: 10 | |
885 | - id: roads-text-ref6 | |
886 | geometry: linestring | |
887 | <<: *extents | |
888 | Datasource: | |
889 | <<: *osm2pgsql | |
890 | table: *road-ref-sql | |
891 | properties: | |
892 | minzoom: 10 | |
893 | - id: railway-platform-ref | |
894 | geometry: linestring | |
895 | <<: *extents | |
896 | Datasource: | |
897 | <<: *osm2pgsql | |
898 | table: |- | |
899 | (SELECT | |
900 | way, | |
901 | COALESCE(tags->'local_ref', ref) AS ref | |
902 | FROM planet_osm_line | |
903 | WHERE "railway" = 'platform_edge' | |
904 | ORDER BY ref | |
905 | ) AS railway_platform_edge_ref | |
906 | properties: | |
907 | minzoom: 17 | |
4
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
908 | - id: commuter-train-ref |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
909 | geometry: linestring |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
910 | <<: *extents |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
911 | Datasource: |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
912 | <<: *osm2pgsql |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
913 | table: |- |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
914 | (SELECT |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
915 | way, |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
916 | ref |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
917 | FROM planet_osm_routes |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
918 | WHERE "route" = 'train' AND length(ref) = 1 AND network = 'HSL' |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
919 | ORDER BY ref |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
920 | ) AS commuter_trains |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
921 | properties: |
34a84c0a427c
render commuter train refs
Teemu Piippo <teemu@hecknology.net>
parents:
3
diff
changeset
|
922 | minzoom: 15 |
5 | 923 | - id: bus-ref |
924 | geometry: linestring | |
925 | <<: *extents | |
926 | Datasource: | |
927 | <<: *osm2pgsql | |
928 | table: |- | |
929 | (SELECT | |
930 | way, | |
931 | ref | |
932 | FROM planet_osm_routes | |
933 | WHERE "route" = 'bus' AND ref IS NOT NULL | |
934 | ORDER BY ref | |
935 | ) AS commuter_trains | |
936 | properties: | |
937 | minzoom: 17 |