Sat, 26 Sep 2020 00:54:51 +0300
fix rendering of Helsinki
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 | |
303 | - id: rail-layer-n1 | |
304 | geometry: linestring | |
305 | Datasource: | |
306 | <<: *osm2pgsql | |
307 | table: &rail_sql |- | |
308 | (SELECT | |
309 | way, | |
310 | name, | |
311 | minority_name, | |
312 | service, | |
313 | COALESCE(layer::integer, 0) AS layer, | |
314 | tags->'electrified' AS electrified, | |
315 | tags->'usage' AS usage | |
316 | FROM planet_osm_line | |
317 | WHERE "railway" = 'rail' | |
318 | ORDER BY | |
319 | CASE | |
320 | WHEN service IS NULL THEN 20 | |
321 | WHEN service IS NOT NULL THEN 30 | |
322 | END DESC NULLS LAST | |
323 | ) AS rail | |
324 | - id: road-casing | |
325 | geometry: line | |
326 | Datasource: | |
327 | <<: *osm2pgsql | |
328 | table: *road_sql | |
329 | properties: | |
330 | minzoom: 12 | |
2 | 331 | - id: foot-routes |
332 | geometry: linestring | |
333 | <<: *extents | |
334 | Datasource: | |
335 | <<: *osm2pgsql | |
336 | table: *foot_routes_sql | |
337 | properties: | |
338 | minzoom: 14 | |
0 | 339 | - id: road |
340 | geometry: line | |
341 | Datasource: | |
342 | <<: *osm2pgsql | |
343 | table: *road_sql | |
344 | properties: | |
345 | minzoom: 12 | |
346 | - id: rail | |
347 | geometry: linestring | |
348 | Datasource: | |
349 | <<: *osm2pgsql | |
350 | table: *rail_sql | |
351 | - id: bridge-area | |
352 | geometry: polygon | |
353 | Datasource: | |
354 | <<: *osm2pgsql | |
355 | table: &bridge_area_sql |- | |
356 | (SELECT | |
357 | way, | |
358 | name, | |
359 | bilingual_name, | |
360 | '0' AS natural | |
361 | FROM planet_osm_polygon | |
362 | WHERE "man_made" = 'bridge' | |
363 | ) AS bridge_area | |
364 | properties: | |
365 | minzoom: 12 | |
2 | 366 | - id: foot-routes-layer-1 |
367 | geometry: linestring | |
368 | <<: *extents | |
369 | Datasource: | |
370 | <<: *osm2pgsql | |
371 | table: *foot_routes_sql | |
372 | properties: | |
373 | minzoom: 14 | |
0 | 374 | - id: road-casing-layer-1 |
375 | geometry: line | |
376 | Datasource: | |
377 | <<: *osm2pgsql | |
378 | table: *road_sql | |
379 | properties: | |
380 | minzoom: 12 | |
381 | - id: road-layer-1 | |
382 | geometry: line | |
383 | Datasource: | |
384 | <<: *osm2pgsql | |
385 | table: *road_sql | |
386 | properties: | |
387 | minzoom: 12 | |
388 | - id: rail-layer-1 | |
389 | geometry: linestring | |
390 | Datasource: | |
391 | <<: *osm2pgsql | |
392 | table: *rail_sql | |
393 | - id: place-major | |
394 | geometry: point | |
395 | Datasource: | |
396 | <<: *osm2pgsql | |
397 | table: |- | |
398 | (SELECT | |
399 | way, | |
400 | name, | |
401 | bilingual_name, | |
3
89b6a7562889
fix rendering of Helsinki
Teemu Piippo <teemu@hecknology.net>
parents:
2
diff
changeset
|
402 | place, |
89b6a7562889
fix rendering of Helsinki
Teemu Piippo <teemu@hecknology.net>
parents:
2
diff
changeset
|
403 | capital |
0 | 404 | FROM planet_osm_point |
405 | WHERE "place" IN ('city', 'town') | |
3
89b6a7562889
fix rendering of Helsinki
Teemu Piippo <teemu@hecknology.net>
parents:
2
diff
changeset
|
406 | ORDER BY population DESC NULLS LAST |
0 | 407 | ) AS place_major |
408 | properties: | |
409 | minzoom: 6 | |
410 | maxzoom: 15 | |
411 | - id: train-stations | |
412 | geometry: point | |
413 | Datasource: | |
414 | <<: *osm2pgsql | |
415 | table: |- | |
416 | (SELECT | |
417 | way, | |
418 | name, | |
419 | bilingual_name, | |
420 | railway, | |
421 | tags->'railway:ref' AS ref | |
422 | FROM planet_osm_point | |
423 | WHERE "railway" IN ('station', 'halt') | |
424 | ) AS train_stations | |
425 | - id: place-medium | |
426 | geometry: point | |
427 | Datasource: | |
428 | <<: *osm2pgsql | |
429 | table: |- | |
430 | (SELECT | |
431 | way, | |
432 | name, | |
433 | bilingual_name, | |
434 | place | |
435 | FROM planet_osm_point | |
436 | WHERE "place" IN ('suburb', 'borough', 'village') | |
437 | ) AS place_medium | |
438 | properties: | |
439 | minzoom: 12 | |
440 | maxzoom: 17 | |
441 | - id: stations | |
442 | geometry: point | |
443 | Datasource: | |
444 | <<: *osm2pgsql | |
445 | table: |- | |
446 | (SELECT | |
447 | way, | |
448 | name, | |
449 | bilingual_name, | |
450 | COALESCE( | |
451 | 'amenity_' || CASE WHEN amenity IN ('bus_station') THEN amenity END | |
452 | ) AS feature | |
453 | FROM | |
454 | ( | |
455 | SELECT | |
456 | ST_PointOnSurface(way) AS way, | |
457 | name, | |
458 | bilingual_name, | |
459 | amenity | |
460 | FROM planet_osm_polygon | |
461 | WHERE way && !bbox! | |
462 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
463 | UNION ALL | |
464 | SELECT | |
465 | way, | |
466 | bilingual_name, | |
467 | name, | |
468 | amenity | |
469 | FROM planet_osm_point | |
470 | WHERE way && !bbox! | |
471 | ) AS station_subquery | |
472 | WHERE ( | |
473 | "amenity" IN ('bus_station') | |
474 | ) | |
475 | ) AS stations | |
476 | properties: | |
477 | minzoom: 13 | |
478 | - id: place-natural | |
479 | geometry: polygon | |
480 | Datasource: | |
481 | <<: *osm2pgsql | |
482 | table: |- | |
483 | (SELECT | |
484 | way, | |
485 | name, | |
486 | bilingual_name, | |
487 | place, | |
488 | way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels, | |
489 | way_area | |
490 | FROM planet_osm_polygon | |
491 | WHERE ( | |
492 | "place" IN ('island', 'peninsula', 'isthmus', 'islet') | |
493 | OR "natural" IN ('peak', 'hill', 'fell') | |
494 | ) | |
495 | ) AS place_natural | |
496 | properties: | |
497 | minzoom: 8 | |
498 | - id: place-minor | |
499 | geometry: point | |
500 | Datasource: | |
501 | <<: *osm2pgsql | |
502 | table: |- | |
503 | (SELECT | |
504 | way, | |
505 | name, | |
506 | bilingual_name, | |
507 | (CASE WHEN ("place" = 'locality' OR "natural" IN ('peak', 'hill', 'fell')) THEN 1 ELSE 0 END) AS natural | |
508 | FROM planet_osm_point | |
509 | WHERE ( | |
510 | "place" IN ('neighbourhood', 'quarter', 'farm', 'hamlet', 'locality') | |
511 | OR "natural" IN ('peak', 'hill', 'fell') | |
512 | ) | |
513 | ) AS place_medium | |
514 | properties: | |
515 | minzoom: 15 | |
516 | - id: train-sites | |
517 | geometry: point | |
518 | Datasource: | |
519 | <<: *osm2pgsql | |
520 | table: |- | |
521 | (SELECT | |
522 | way, | |
523 | name, | |
524 | bilingual_name, | |
525 | railway, | |
526 | tags->'railway:ref' AS ref | |
527 | FROM planet_osm_point | |
528 | WHERE "railway" IN ('site', 'yard', 'crossover', 'junction', 'technical_station', 'service_station') | |
529 | ) AS train_stations | |
530 | - id: poi-name | |
531 | geometry: polygon | |
532 | Datasource: | |
533 | <<: *osm2pgsql | |
534 | table: |- | |
535 | (SELECT | |
536 | way, | |
537 | name, | |
538 | bilingual_name, | |
539 | 0 as natural | |
540 | FROM | |
541 | ( | |
542 | SELECT | |
543 | ST_PointOnSurface(way) AS way, | |
544 | name, | |
545 | bilingual_name, | |
546 | man_made, | |
547 | building, | |
548 | leisure, | |
549 | amenity, | |
550 | historic | |
551 | FROM planet_osm_polygon | |
552 | WHERE way && !bbox! | |
553 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
554 | UNION ALL | |
555 | SELECT | |
556 | way, | |
557 | name, | |
558 | bilingual_name, | |
559 | building, | |
560 | man_made, | |
561 | leisure, | |
562 | amenity, | |
563 | historic | |
564 | FROM planet_osm_point | |
565 | WHERE way && !bbox! | |
566 | ) AS poi_name_subquery | |
567 | WHERE ( | |
568 | "man_made" IN ('bridge') | |
569 | OR "amenity" IN ('hospital', 'university', 'exhibition_centre') | |
570 | OR "leisure" IN ('stadium') | |
571 | OR "historic" IN ('castle') | |
572 | ) | |
573 | ) AS poi_name | |
574 | properties: | |
575 | minzoom: 15 | |
576 | - id: poi-name-medium | |
577 | geometry: polygon | |
578 | Datasource: | |
579 | <<: *osm2pgsql | |
580 | table: |- | |
581 | (SELECT | |
582 | way, | |
583 | name, | |
584 | bilingual_name, | |
585 | shop, | |
586 | 0 as natural | |
587 | FROM | |
588 | ( | |
589 | SELECT | |
590 | ST_PointOnSurface(way) AS way, | |
591 | name, | |
592 | bilingual_name, | |
593 | amenity, | |
594 | shop | |
595 | FROM planet_osm_polygon | |
596 | WHERE way && !bbox! | |
597 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
598 | UNION ALL | |
599 | SELECT | |
600 | way, | |
601 | name, | |
602 | bilingual_name, | |
603 | shop, | |
604 | amenity | |
605 | FROM planet_osm_point | |
606 | WHERE way && !bbox! | |
607 | ) AS poi_name_subquery | |
608 | WHERE ( | |
609 | "amenity" IN ('school', 'marketplace', 'fire_station') | |
610 | OR "shop" = 'mall' | |
611 | ) | |
612 | ) AS poi_name_medium | |
613 | properties: | |
614 | minzoom: 16 | |
615 | - id: aerodrome-name | |
616 | geometry: point | |
617 | Datasource: | |
618 | <<: *osm2pgsql | |
619 | table: |- | |
620 | (SELECT | |
621 | way, | |
622 | aeroway, | |
623 | name, | |
624 | bilingual_name, | |
625 | ref | |
626 | FROM | |
627 | ( | |
628 | SELECT | |
629 | ST_PointOnSurface(way) AS way, | |
630 | aeroway, | |
631 | name, | |
632 | bilingual_name, | |
633 | COALESCE(tags->'iata', tags->'icao', ref) as ref | |
634 | FROM planet_osm_polygon | |
635 | WHERE way && !bbox! | |
636 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
637 | UNION ALL | |
638 | SELECT | |
639 | way, | |
640 | aeroway, | |
641 | name, | |
642 | bilingual_name, | |
643 | COALESCE(tags->'iata', tags->'icao', ref) as ref | |
644 | FROM planet_osm_point | |
645 | WHERE way && !bbox! | |
646 | ) AS station_subquery | |
647 | WHERE "aeroway" = 'aerodrome' | |
648 | ) AS stations | |
649 | properties: | |
650 | minzoom: 9 | |
651 | ||
652 | - id: poi-name-minor | |
653 | geometry: polygon | |
654 | Datasource: | |
655 | <<: *osm2pgsql | |
656 | table: |- | |
657 | (SELECT | |
658 | way, | |
659 | name, | |
660 | bilingual_name, | |
661 | 0 as natural | |
662 | FROM | |
663 | ( | |
664 | SELECT | |
665 | ST_PointOnSurface(way) AS way, | |
666 | name, | |
667 | bilingual_name, | |
668 | highway, | |
669 | area, | |
670 | amenity | |
671 | FROM planet_osm_polygon | |
672 | WHERE way && !bbox! | |
673 | AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2) | |
674 | UNION ALL | |
675 | SELECT | |
676 | way, | |
677 | name, | |
678 | bilingual_name, | |
679 | highway, | |
680 | NULL as area, | |
681 | amenity | |
682 | FROM planet_osm_point | |
683 | WHERE way && !bbox! | |
684 | ) AS poi_name_subquery | |
685 | WHERE ( | |
686 | "amenity" IN ('kindergarten', 'social_facility') | |
687 | OR ("highway" IN ('footway', 'pedestrian') AND area = 'yes') | |
688 | ) | |
689 | ) AS poi_name_medium | |
690 | properties: | |
691 | minzoom: 17 | |
692 | - id: train-milestones | |
693 | geometry: point | |
694 | Datasource: | |
695 | <<: *osm2pgsql | |
696 | table: |- | |
697 | (SELECT | |
698 | way, | |
699 | tags->'railway:position' AS position, | |
700 | railway | |
701 | FROM planet_osm_point | |
702 | WHERE "railway" = 'milestone' | |
703 | ) AS train_milestones | |
704 | - id: road-text | |
705 | geometry: line | |
706 | Datasource: | |
707 | <<: *osm2pgsql | |
708 | table: *road_sql | |
709 | properties: | |
710 | minzoom: 14 | |
711 | - id: road-text-minority | |
712 | geometry: line | |
713 | Datasource: | |
714 | <<: *osm2pgsql | |
715 | table: *road_sql | |
716 | properties: | |
717 | minzoom: 14 | |
2 | 718 | - id: foot-routes-text |
719 | geometry: linestring | |
720 | <<: *extents | |
721 | Datasource: | |
722 | <<: *osm2pgsql | |
723 | table: |- | |
724 | (SELECT | |
725 | way, | |
726 | name, | |
727 | ref, | |
728 | route | |
729 | FROM planet_osm_routes | |
730 | WHERE "route" IN ('hiking', 'foot', 'bicycle_lcn', 'bicycle_rcn', 'bicycle_ncn', 'bicycle_icn') | |
731 | ORDER BY | |
732 | CASE | |
733 | WHEN route = 'bicycle_icn' THEN 30 | |
734 | WHEN route = 'bicycle_ncn' THEN 31 | |
735 | WHEN route = 'bicycle_rcn' THEN 32 | |
736 | WHEN route = 'bicycle_lcn' THEN 33 | |
737 | WHEN route = 'foot' THEN 34 | |
738 | WHEN route = 'hiking' THEN 35 | |
739 | END DESC NULLS LAST | |
740 | ) AS foot_routes | |
741 | properties: | |
742 | minzoom: 15 | |
0 | 743 | - id: roads-text-ref |
744 | geometry: linestring | |
745 | <<: *extents | |
746 | Datasource: | |
747 | <<: *osm2pgsql | |
748 | table: &road-ref-sql |- | |
749 | (SELECT | |
750 | way, | |
751 | highway, | |
752 | refs, | |
753 | ref_1, | |
754 | ref_2, | |
755 | ref_3, | |
756 | ref_4, | |
757 | ref_5, | |
758 | ref_6, | |
759 | ref_class_1, | |
760 | ref_class_2, | |
761 | ref_class_3, | |
762 | ref_class_4, | |
763 | ref_class_5, | |
764 | ref_class_6, | |
765 | ref_length_1, | |
766 | ref_length_2, | |
767 | ref_length_3, | |
768 | ref_length_4, | |
769 | ref_length_5, | |
770 | ref_length_6 | |
771 | FROM ( | |
772 | SELECT | |
773 | osm_id, | |
774 | way, | |
775 | highway, | |
776 | array_to_string(refs, E'\n') AS refs, | |
777 | refs[1] as ref_1, | |
778 | refs[2] as ref_2, | |
779 | refs[3] as ref_3, | |
780 | refs[4] as ref_4, | |
781 | refs[5] as ref_5, | |
782 | refs[6] as ref_6, | |
783 | ref_classes[1] as ref_class_1, | |
784 | ref_classes[2] as ref_class_2, | |
785 | ref_classes[3] as ref_class_3, | |
786 | ref_classes[4] as ref_class_4, | |
787 | ref_classes[5] as ref_class_5, | |
788 | ref_classes[6] as ref_class_6, | |
789 | ref_widths[1] as ref_length_1, | |
790 | ref_widths[2] as ref_length_2, | |
791 | ref_widths[3] as ref_length_3, | |
792 | ref_widths[4] as ref_length_4, | |
793 | ref_widths[5] as ref_length_5, | |
794 | ref_widths[6] as ref_length_6 | |
795 | FROM ( | |
796 | SELECT | |
797 | osm_id, | |
798 | way, | |
799 | highway, | |
800 | string_to_array(ref, ';') AS refs, | |
801 | string_to_array(ref_class, ';') AS ref_classes, | |
802 | string_to_array(ref_width, ';') AS ref_widths | |
803 | FROM planet_osm_line | |
804 | WHERE (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary')) | |
805 | AND ref IS NOT NULL | |
806 | ) AS p) AS q | |
807 | ORDER BY | |
808 | CASE | |
809 | WHEN highway = 'motorway' THEN 38 | |
810 | WHEN highway = 'trunk' THEN 37 | |
811 | WHEN highway = 'primary' THEN 36 | |
812 | WHEN highway = 'secondary' THEN 35 | |
813 | WHEN highway = 'tertiary' THEN 34 | |
814 | WHEN highway = 'taxiway' THEN 5 | |
815 | END DESC NULLS LAST, | |
816 | refs, | |
817 | osm_id | |
818 | ) AS roads_text_ref | |
819 | properties: | |
820 | minzoom: 8 | |
821 | - id: roads-text-ref2 | |
822 | geometry: linestring | |
823 | <<: *extents | |
824 | Datasource: | |
825 | <<: *osm2pgsql | |
826 | table: *road-ref-sql | |
827 | properties: | |
828 | minzoom: 10 | |
829 | - id: roads-text-ref3 | |
830 | geometry: linestring | |
831 | <<: *extents | |
832 | Datasource: | |
833 | <<: *osm2pgsql | |
834 | table: *road-ref-sql | |
835 | properties: | |
836 | minzoom: 10 | |
837 | - id: roads-text-ref4 | |
838 | geometry: linestring | |
839 | <<: *extents | |
840 | Datasource: | |
841 | <<: *osm2pgsql | |
842 | table: *road-ref-sql | |
843 | properties: | |
844 | minzoom: 10 | |
845 | - id: roads-text-ref5 | |
846 | geometry: linestring | |
847 | <<: *extents | |
848 | Datasource: | |
849 | <<: *osm2pgsql | |
850 | table: *road-ref-sql | |
851 | properties: | |
852 | minzoom: 10 | |
853 | - id: roads-text-ref6 | |
854 | geometry: linestring | |
855 | <<: *extents | |
856 | Datasource: | |
857 | <<: *osm2pgsql | |
858 | table: *road-ref-sql | |
859 | properties: | |
860 | minzoom: 10 | |
861 | - id: railway-platform-ref | |
862 | geometry: linestring | |
863 | <<: *extents | |
864 | Datasource: | |
865 | <<: *osm2pgsql | |
866 | table: |- | |
867 | (SELECT | |
868 | way, | |
869 | COALESCE(tags->'local_ref', ref) AS ref | |
870 | FROM planet_osm_line | |
871 | WHERE "railway" = 'platform_edge' | |
872 | ORDER BY ref | |
873 | ) AS railway_platform_edge_ref | |
874 | properties: | |
875 | minzoom: 17 |