forked from gravitystorm/openstreetmap-carto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.yaml
1845 lines (1843 loc) · 73.7 KB
/
project.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
scale: 1
metatile: 2
name: "OpenStreetMap Carto"
description: "A faithful reimplementation of the standard OpenStreetMap style"
bounds: &world
- -180
- -85.05112877980659
- 180
- 85.05112877980659
center:
- 0
- 0
- 4
format: "png"
interactivity: false
minzoom: 0
maxzoom: 22
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"
# Various parts to be included later on
_parts:
# Extents are used for tilemill, and don't actually make it to the generated XML
extents: &extents
extent: *world
srs-name: "900913"
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"
extents84: &extents84
extent: *world
srs-name: "WGS84"
srs: "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
osm2pgsql: &osm2pgsql
type: "postgis"
dbname: "gis"
key_field: ""
geometry_field: "way"
extent: "-20037508,-20037508,20037508,20037508"
Stylesheet:
- "style.mss"
- "shapefiles.mss"
- "landcover.mss"
- "water.mss"
- "water-features.mss"
- "roads.mss"
- "power.mss"
- "citywalls.mss"
- "placenames.mss"
- "buildings.mss"
- "stations.mss"
- "amenity-points.mss"
- "ferry-routes.mss"
- "aerialways.mss"
- "admin.mss"
- "addressing.mss"
Layer:
- id: "world"
name: "world"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
file: "data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp"
type: "shape"
advanced: {}
properties:
maxzoom: 9
- id: "coast-poly"
name: "coast-poly"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
file: "data/land-polygons-split-3857/land_polygons.shp"
type: "shape"
properties:
minzoom: 10
advanced: {}
- id: "builtup"
name: "builtup"
geometry: "polygon"
class: ""
extent: *world
srs-name: "mercator"
srs: "+proj=merc +datum=WGS84 +over"
Datasource:
file: "data/world_boundaries/builtup_area.shp"
type: "shape"
properties:
minzoom: 8
maxzoom: 9
advanced: {}
- id: "necountries"
name: "necountries"
class: ""
geometry: "linestring"
<<: *extents84
Datasource:
file: "data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp"
type: "shape"
properties:
minzoom: 1
maxzoom: 3
advanced: {}
- id: "landcover-low-zoom"
name: "landcover-low-zoom"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, name, way_pixels,
COALESCE(landuse, "natural") AS feature
FROM (SELECT
way, COALESCE(name, '') AS name,
('landuse_' || (CASE WHEN landuse IN ('forest') THEN landuse ELSE NULL END)) AS landuse,
('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock') THEN "natural" ELSE NULL END)) AS "natural",
way_area/(!pixel_width!*!pixel_height!) AS way_pixels
FROM planet_osm_polygon
WHERE (landuse IN ('forest')
OR "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock'))
AND way_area/(!pixel_width!*!pixel_height!) > 0.01
AND building IS NULL
ORDER BY z_order, way_area DESC
) AS features
) AS landcover_low_zoom
properties:
maxzoom: 9
advanced: {}
- id: "landcover"
name: "landcover"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, name, religion, way_pixels,
COALESCE(aeroway, amenity, landuse, leisure, military, "natural", power, tourism, highway, railway) AS feature
FROM (SELECT
way, COALESCE(name, '') AS name,
('aeroway_' || (CASE WHEN aeroway IN ('apron', 'aerodrome') THEN aeroway ELSE NULL END)) AS aeroway,
('amenity_' || (CASE WHEN amenity IN ('parking', 'university', 'college', 'school', 'hospital', 'kindergarten', 'grave_yard', 'prison', 'place_of_worship') THEN amenity ELSE NULL END)) AS amenity,
('landuse_' || (CASE WHEN landuse IN ('quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'recreation_ground', 'conservation', 'village_green', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction') THEN landuse ELSE NULL END)) AS landuse,
('leisure_' || (CASE WHEN leisure IN ('swimming_pool', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'golf_course', 'miniature_golf', 'picnic_table', 'sports_centre', 'stadium', 'pitch', 'track') THEN leisure ELSE NULL END)) AS leisure,
('military_' || (CASE WHEN military IN ('danger_area') THEN military ELSE NULL END)) AS military,
('natural_' || (CASE WHEN "natural" IN ('beach', 'heath', 'mud', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') THEN "natural" ELSE NULL END)) AS "natural",
('power_' || (CASE WHEN power IN ('station', 'sub_station', 'substation', 'generator') THEN power ELSE NULL END)) AS power,
('tourism_' || (CASE WHEN tourism IN ('attraction', 'camp_site', 'caravan_site', 'picnic_site', 'zoo') THEN tourism ELSE NULL END)) AS tourism,
('highway_' || (CASE WHEN highway IN ('services', 'rest_area') THEN highway ELSE NULL END)) AS highway,
('railway_' || (CASE WHEN railway = 'station' THEN railway ELSE NULL END)) AS railway,
CASE WHEN religion IN ('christian', 'jewish') THEN religion ELSE 'INT-generic'::text END AS religion,
way_area/(!pixel_width!*!pixel_height!) AS way_pixels
FROM planet_osm_polygon
WHERE (landuse IS NOT NULL
OR leisure IS NOT NULL
OR aeroway IN ('apron', 'aerodrome')
OR amenity IN ('parking', 'university', 'college', 'school', 'hospital', 'kindergarten', 'grave_yard', 'place_of_worship', 'prison')
OR military IN ('danger_area')
OR "natural" IN ('beach', 'heath', 'mud', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub')
OR power IN ('station', 'sub_station', 'substation', 'generator')
OR tourism IN ('attraction', 'camp_site', 'caravan_site', 'picnic_site', 'zoo')
OR highway IN ('services', 'rest_area')
OR railway = 'station')
AND way_area/(!pixel_width!*!pixel_height!) > 0.01
ORDER BY z_order, way_area DESC
) AS landcover
) AS features
properties:
minzoom: 10
advanced: {}
- id: "landcover-line"
name: "landcover-line"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE man_made = 'cutline'
) AS landcover_line
advanced: {}
properties:
minzoom: 14
- id: "water-lines-casing"
name: "water-lines-casing"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, waterway, intermittent,
CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel
FROM planet_osm_line
WHERE waterway IN ('stream', 'drain', 'ditch')
) AS water_lines_casing
properties:
minzoom: 13
advanced: {}
- id: "water-lines-low-zoom"
name: "water-lines-low-zoom"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT way, waterway
FROM planet_osm_line
WHERE waterway = 'river'
) AS water_lines_low_zoom
properties:
minzoom: 8
maxzoom: 11
advanced: {}
- id: "water-areas"
name: "water-areas"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, "natural", waterway, landuse, name, way_area/(!pixel_width!*!pixel_height!) AS way_pixels
FROM planet_osm_polygon
WHERE
(waterway IN ('dock', 'riverbank', 'canal')
OR landuse IN ('reservoir', 'basin')
OR "natural" IN ('water', 'glacier', 'mud'))
AND building IS NULL
AND way_area/(!pixel_width!*!pixel_height!) > 0.01
ORDER BY z_order, way_area DESC
) AS water_areas
properties:
minzoom: 4
advanced: {}
- id: "water-areas-overlay"
name: "water-areas-overlay"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, "natural"
FROM planet_osm_polygon
WHERE "natural" IN ('marsh', 'wetland') AND building IS NULL
ORDER BY z_order, way_area DESC
) AS water_areas_overlay
properties:
minzoom: 10
advanced: {}
- id: "water-lines"
name: "water-lines"
class: "water-lines"
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, waterway, lock, name, intermittent,
CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel,
'no' AS bridge
FROM planet_osm_line
WHERE waterway IN ('weir', 'river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')
AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct'))
ORDER BY z_order
) AS water_lines
properties:
minzoom: 12
advanced: {}
- id: "dam"
name: "dam"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT way, name
FROM planet_osm_line
WHERE waterway = 'dam'
) AS dam
properties:
minzoom: 13
advanced: {}
- id: "marinas-area"
name: "marinas-area"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_polygon
WHERE leisure = 'marina'
) AS marinas_area
properties:
minzoom: 14
advanced: {}
- id: "piers-area"
name: "piers-area"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, man_made
FROM planet_osm_polygon
WHERE man_made IN ('pier', 'breakwater', 'groyne')
) AS piers_area
properties:
minzoom: 12
advanced: {}
- id: "piers"
name: "piers"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, man_made
FROM planet_osm_line
WHERE man_made IN ('pier', 'breakwater', 'groyne')
) AS piers
properties:
minzoom: 12
advanced: {}
- id: "locks"
name: "locks"
class: ""
geometry: "point"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, waterway
FROM planet_osm_point
WHERE waterway = 'lock_gate'
) AS locks
properties:
minzoom: 17
advanced: {}
- id: "buildings"
name: "buildings"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, building
FROM planet_osm_polygon
WHERE (building IS NOT NULL)
AND building != 'no'
ORDER BY z_order, way_area DESC
) AS buildings
properties:
minzoom: 12
advanced: {}
- id: "buildings-major"
name: "buildings-major"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT way, building, amenity, aeroway
FROM planet_osm_polygon
WHERE (building IS NOT NULL)
AND building != 'no'
AND (aeroway = 'terminal' OR amenity = 'place_of_worship')
ORDER BY z_order,way_area DESC)
AS buildings_major
properties:
minzoom: 12
advanced: {}
- id: "tunnels"
name: "tunnels"
class: "tunnels-fill tunnels-casing access directions"
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT *
FROM (
(SELECT
way, prio,
('highway_' || (CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway END)) AS feature,
horse, foot, segregated, bicycle, tracktype,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
ELSE NULL
END AS access,
construction,
CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text
ELSE 'INT-normal'::text
END AS service,
CASE WHEN oneway IN ('yes', '-1') THEN oneway ELSE NULL END AS oneway,
CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'
ELSE 'no' END AS link,
CASE WHEN layer~E'^-?\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull
FROM planet_osm_line
JOIN (VALUES
('highway_motorway', 380),
('highway_trunk', 370),
('highway_primary', 360),
('highway_secondary', 350),
('highway_tertiary', 340),
('highway_residential', 330),
('highway_unclassified', 330),
('highway_road', 330),
('highway_living_street', 320),
('highway_pedestrian', 310),
('highway_raceway', 300),
('highway_motorway_link', 240),
('highway_trunk_link', 230),
('highway_primary_link', 220),
('highway_secondary_link', 210),
('highway_tertiary_link', 200),
('highway_service', 150),
('highway_track', 110),
('highway_path', 100),
('highway_footway', 100),
('highway_bridleway', 100),
('highway_cycleway', 100),
('highway_steps', 100),
('highway_platform', 90),
('highway_proposed', 20),
('highway_construction', 10)
) AS ordertable (feature, prio)
ON ('highway_' || planet_osm_line.highway) = ordertable.feature
WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes'))
UNION ALL
(SELECT
way, prio,
COALESCE(('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' ELSE railway END)),
('aeroway_' || aeroway)) AS feature,
horse, foot, segregated, bicycle, tracktype,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
ELSE NULL
END AS access,
construction,
CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,
NULL AS oneway,
'no' AS link,
CASE WHEN layer~E'^-?\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull
FROM planet_osm_line
JOIN (VALUES
('railway_rail', 430),
('railway_spur', 430),
('railway_siding', 430),
('railway_subway', 420),
('railway_narrow_gauge', 420),
('railway_light_rail', 420),
('railway_preserved', 420),
('railway_funicular', 420),
('railway_monorail', 420),
('railway_miniature', 420),
('railway_turntable', 420),
('railway_tram', 410),
('railway_disused', 400),
('railway_construction', 400),
('aeroway_runway', 60),
('aeroway_taxiway', 50),
('railway_platform', 90)
) AS ordertable (feature, prio)
ON COALESCE(('railway_' || planet_osm_line.railway), ('aeroway_' || planet_osm_line.aeroway)) = ordertable.feature
WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes')
)) AS features
ORDER BY layernotnull, prio, CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END
) AS tunnels
properties:
group-by: "layernotnull"
minzoom: 10
advanced: {}
- id: "citywalls"
name: "citywalls"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE historic = 'citywalls')
AS citywalls
advanced: {}
- id: "castlewalls"
name: "castlewalls"
class: "castlewalls"
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE historic = 'castle_walls'
) AS castlewalls
properties:
minzoom: 14
advanced: {}
- id: "castlewalls-poly"
name: "castlewalls-poly"
class: "castlewalls"
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_polygon
WHERE historic = 'castle_walls'
) AS castlewalls_poly
properties:
minzoom: 14
advanced: {}
- id: "landuse-overlay"
name: "landuse-overlay"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, landuse, leisure
FROM planet_osm_polygon
WHERE (landuse = 'military') AND building IS NULL
) AS landuse_overlay
properties:
minzoom: 10
advanced: {}
- id: "line-barriers"
name: "line-barriers"
class: "barriers"
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, barrier
FROM planet_osm_line
WHERE barrier IS NOT NULL
) AS line_barriers
properties:
minzoom: 16
advanced: {}
- id: "cliffs"
name: "cliffs"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, "natural", man_made
FROM planet_osm_line
WHERE "natural" = 'cliff' OR man_made = 'embankment'
) AS cliffs
properties:
minzoom: 13
advanced: {}
- id: "area-barriers"
name: "area-barriers"
class: "barriers"
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, barrier
FROM planet_osm_polygon
WHERE barrier IS NOT NULL
) AS area_barriers
properties:
minzoom: 16
advanced: {}
- id: "tree-row"
name: "tree-row"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,"natural"
FROM planet_osm_line
WHERE "natural" = 'tree_row'
) AS tree_row
properties:
minzoom: 16
advanced: {}
- id: "ferry-routes"
name: "ferry-routes"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE route = 'ferry'
) AS ferry_routes
properties:
minzoom: 7
advanced: {}
- id: "turning-circle-casing"
name: "turning-circle-casing"
class: ""
geometry: "point"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT DISTINCT ON (p.way)
p.way AS way, l.highway AS int_tc_type,
CASE WHEN l.service IN ('parking_aisle', 'drive-through', 'driveway')
THEN 'INT-minor'::text
ELSE 'INT-normal'::text
END AS int_tc_service
FROM planet_osm_point p
JOIN planet_osm_line l ON ST_DWithin(p.way, l.way, 0.1) -- Assumes Mercator
JOIN (VALUES
('tertiary', 1),
('unclassified', 2),
('residential', 3),
('living_street', 4),
('service', 5)
) AS v (highway, prio)
ON v.highway=l.highway
WHERE p.highway = 'turning_circle'
OR p.highway = 'turning_loop'
ORDER BY p.way, v.prio
) AS turning_circle_casing
properties:
minzoom: 15
advanced: {}
- id: "highway-area-casing"
name: "highway-area-casing"
class: ""
geometry: "polygon"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
COALESCE((
'highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'track', 'path', 'platform') THEN highway ELSE NULL END)),
('railway_' || (CASE WHEN railway IN ('platform') THEN railway ELSE NULL END))
) AS feature
FROM planet_osm_polygon
WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'track', 'path', 'platform')
OR railway IN ('platform')
ORDER BY z_order, way_area DESC
) AS highway_area_casing
properties:
minzoom: 14
advanced: {}
- name: "roads-casing"
id: "roads-casing"
class: "roads-casing"
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
*
FROM
(
(SELECT
way, prio,
('highway_' || (CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway END)) AS feature,
horse, foot, segregated, bicycle, tracktype,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
ELSE NULL
END AS access,
construction,
CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,
CASE WHEN oneway IN ('yes', '-1') THEN oneway ELSE NULL END AS oneway,
CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes' ELSE 'no' END AS link,
CASE WHEN layer~E'^-?\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull
FROM planet_osm_line
JOIN (VALUES
('highway_motorway',380),
('highway_trunk',370),
('highway_primary',360),
('highway_secondary',350),
('highway_tertiary',340),
('highway_residential',330),
('highway_unclassified',330),
('highway_road',330),
('highway_living_street',320),
('highway_pedestrian',310),
('highway_raceway',300),
('highway_motorway_link',240),
('highway_trunk_link',230),
('highway_primary_link',220),
('highway_secondary_link',210),
('highway_tertiary_link',200),
('highway_service',150),
('highway_track',110),
('highway_path',100),
('highway_footway',100),
('highway_bridleway',100),
('highway_cycleway',100),
('highway_steps',100),
('highway_platform',90),
('highway_proposed',20),
('highway_construction',10)
) AS ordertable (feature, prio)
ON ('highway_' || planet_osm_line.highway) = ordertable.feature
WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))
AND (covered IS NULL OR NOT covered = 'yes')
AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')))
UNION ALL
(SELECT
way, prio,
COALESCE(('railway_' ||(CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' ELSE railway end)), ('aeroway_' || aeroway)) AS feature,
horse, foot, segregated, bicycle, tracktype,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
ELSE NULL
END AS access,
construction, CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,
NULL AS oneway, 'no' AS link,
CASE WHEN layer~E'^-?\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull
FROM planet_osm_line
JOIN (VALUES
('railway_rail', 430),
('railway_spur', 430),
('railway_siding', 430),
('railway_subway', 420),
('railway_narrow_gauge', 420),
('railway_light_rail', 420),
('railway_preserved', 420),
('railway_funicular', 420),
('railway_monorail', 420),
('railway_miniature', 420),
('railway_turntable', 420),
('railway_tram', 410),
('railway_disused', 400),
('railway_construction', 400),
('aeroway_runway', 60),
('aeroway_taxiway', 50),
('railway_platform', 90)
) AS ordertable (feature, prio)
ON COALESCE(('railway_' || planet_osm_line.railway), ('aeroway_' || planet_osm_line.aeroway)) = ordertable.feature
WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))
AND (covered IS NULL OR NOT covered = 'yes')
AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))
)
) AS features
ORDER BY prio
) AS roads_casing
properties:
minzoom: 10
advanced: {}
- id: "highway-area-fill"
name: "highway-area-fill"
class: ""
# FIXME: No geometry?
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
COALESCE(
('highway_' || (CASE WHEN highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'living_street', 'track', 'path', 'platform', 'services') THEN highway ELSE NULL END)),
('railway_' || (CASE WHEN railway IN ('platform') THEN railway ELSE NULL END)),
(('aeroway_' || CASE WHEN aeroway IN ('runway', 'taxiway', 'helipad') THEN aeroway ELSE NULL END))
) AS feature
FROM planet_osm_polygon
WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'living_street', 'track', 'path', 'platform', 'services')
OR railway IN ('platform')
OR aeroway IN ('runway', 'taxiway', 'helipad')
ORDER BY z_order, way_area desc
) AS highway_area_fill
properties:
minzoom: 14
advanced: {}
- id: "roads-fill"
name: "roads-fill"
class: "roads-fill access directions"
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
*
FROM
(
(SELECT
way, prio,
('highway_' || (CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway end)) AS feature,
horse, foot, segregated, bicycle, tracktype,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
ELSE NULL
END AS access,
construction,
CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,
CASE WHEN oneway IN ('yes', '-1') THEN oneway ELSE NULL END AS oneway,
CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes' ELSE 'no' END AS link,
CASE WHEN layer~E'^-?\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull
FROM planet_osm_line
JOIN (VALUES
('highway_motorway',380),
('highway_trunk',370),
('highway_primary',360),
('highway_secondary',350),
('highway_tertiary',340),
('highway_residential',330),
('highway_unclassified',330),
('highway_road',330),
('highway_living_street',320),
('highway_pedestrian',310),
('highway_raceway',300),
('highway_motorway_link',240),
('highway_trunk_link',230),
('highway_primary_link',220),
('highway_secondary_link',210),
('highway_tertiary_link',200),
('highway_service',150),
('highway_track',110),
('highway_path',100),
('highway_footway',100),
('highway_bridleway',100),
('highway_cycleway',100),
('highway_steps',100),
('highway_platform',90),
('highway_proposed',20),
('highway_construction',10)
) AS ordertable (feature, prio)
on ('highway_' || planet_osm_line.highway) = ordertable.feature
WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))
AND (covered IS NULL OR NOT covered = 'yes')
AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')))
UNION ALL
(SELECT
way, prio,
COALESCE(
('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' ELSE railway END)),
('aeroway_' || aeroway)
) AS feature,
horse, foot, segregated, bicycle, tracktype,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
ELSE NULL
END AS access,
construction,
CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text
ELSE 'INT-normal'::text
END AS service,
NULL AS oneway,
'no' AS link,
CASE WHEN layer~E'^-?\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull
FROM planet_osm_line
JOIN (VALUES
('railway_rail',430),
('railway_spur',430),
('railway_siding',430),
('railway_subway',420),
('railway_narrow_gauge',420),
('railway_light_rail',420),
('railway_preserved',420),
('railway_funicular',420),
('railway_monorail',420),
('railway_miniature',420),
('railway_turntable',420),
('railway_tram',410),
('railway_disused',400),
('railway_construction',400),
('aeroway_runway',60),
('aeroway_taxiway',50),
('railway_platform',90)) AS ordertable (feature, prio)
ON COALESCE(('railway_' || planet_osm_line.railway), ('aeroway_' || planet_osm_line.aeroway)) = ordertable.feature
WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))
AND (covered IS NULL OR NOT covered = 'yes')
AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))
)
) AS features
ORDER BY prio, CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END
) AS roads_fill
properties:
minzoom: 10
advanced: {}
- id: "turning-circle-fill"
name: "turning-circle-fill"
class: ""
geometry: "point"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
DISTINCT on (p.way)
p.way AS way, l.highway AS int_tc_type,
CASE WHEN l.service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text
ELSE 'INT-normal'::text END AS int_tc_service
FROM planet_osm_point p
JOIN planet_osm_line l
ON ST_DWithin(p.way, l.way, 0.1)
JOIN (VALUES
('tertiary', 1),
('unclassified', 2),
('residential', 3),
('living_street', 4),
('service', 5)
) AS v (highway, prio)
ON v.highway=l.highway
WHERE p.highway = 'turning_circle' OR p.highway = 'turning_loop'
ORDER BY p.way, v.prio
) AS turning_circle_fill
properties:
minzoom: 15
advanced: {}
- id: "aerialways"
name: "aerialways"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |2-
(SELECT way, aerialway FROM planet_osm_line WHERE aerialway IS NOT NULL) AS aerialways
properties:
minzoom: 12
advanced: {}
- id: "roads-low-zoom"
name: "roads-low-zoom"
class: ""
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |2-
(SELECT way, COALESCE(('highway_' || (CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway end)), ('railway_' || (CASE WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' WHEN railway IN ('rail', 'tram', 'light_rail', 'funicular', 'narrow_gauge') THEN railway ELSE NULL END))) AS feature, tunnel
FROM planet_osm_roads
WHERE highway IS NOT NULL
OR (railway IS NOT NULL AND railway != 'preserved' AND (service IS NULL OR service NOT IN ('spur', 'siding', 'yard')))
ORDER BY z_order
) AS roads_low_zoom
properties:
minzoom: 5
maxzoom: 12
advanced: {}
- id: "waterway-bridges"
name: "waterway-bridges"
class: "water-lines"
geometry: "linestring"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |2-
(SELECT way, waterway, name, intermittent, CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel, 'yes' AS bridge FROM planet_osm_line WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi') AND bridge IN ('yes', 'aqueduct') ORDER BY z_order) AS waterway_bridges
properties:
minzoom: 15
advanced: {}
- id: "bridges"
name: "bridges"
class: "bridges-fill bridges-casing access directions"
geometry: "linestring"