-
Notifications
You must be signed in to change notification settings - Fork 1
/
openstreetmap-carto.toml
2721 lines (2572 loc) · 104 KB
/
openstreetmap-carto.toml
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
[cache]
basepath = "/tmp/tegola-cache"
type = "file"
[[maps]]
name = "osm"
[[maps.layers]]
max_zoom = 9
min_zoom = 5
provider_layer = "osm.landcover-low-zoom"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.landcover"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.landcover-line"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.water-lines-casing"
[[maps.layers]]
max_zoom = 11
min_zoom = 8
provider_layer = "osm.water-lines-low-zoom"
[[maps.layers]]
max_zoom = 14
min_zoom = 12
provider_layer = "osm.water-lines"
[[maps.layers]]
max_zoom = 14
min_zoom = 0
provider_layer = "osm.water-areas"
[[maps.layers]]
max_zoom = 14
min_zoom = 5
provider_layer = "osm.landcover-area-symbols"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.marinas-area"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.water-barriers-line"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.water-barriers-poly"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.springs"
[[maps.layers]]
max_zoom = 14
min_zoom = 12
provider_layer = "osm.piers-poly"
[[maps.layers]]
max_zoom = 14
min_zoom = 12
provider_layer = "osm.piers-line"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.water-barriers-point"
[[maps.layers]]
max_zoom = 14
min_zoom = 12
provider_layer = "osm.bridge"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.buildings"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.tunnels"
[[maps.layers]]
max_zoom = 14
min_zoom = 8
provider_layer = "osm.landuse-overlay"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.tourism-boundary"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.barriers"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.cliffs"
[[maps.layers]]
max_zoom = 14
min_zoom = 8
provider_layer = "osm.ferry-routes"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.turning-circle-casing"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.highway-area-casing"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.roads-casing"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.highway-area-fill"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.roads-fill"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.turning-circle-fill"
[[maps.layers]]
max_zoom = 14
min_zoom = 12
provider_layer = "osm.aerialways"
[[maps.layers]]
max_zoom = 9
min_zoom = 6
provider_layer = "osm.roads-low-zoom"
[[maps.layers]]
max_zoom = 14
min_zoom = 12
provider_layer = "osm.waterway-bridges"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.bridges"
[[maps.layers]]
max_zoom = 14
min_zoom = 11
provider_layer = "osm.guideways"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.entrances"
[[maps.layers]]
max_zoom = 14
min_zoom = 11
provider_layer = "osm.aeroways"
[[maps.layers]]
max_zoom = 10
min_zoom = 4
provider_layer = "osm.admin-low-zoom"
[[maps.layers]]
max_zoom = 12
min_zoom = 11
provider_layer = "osm.admin-mid-zoom"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.admin-high-zoom"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.power-minorline"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.power-line"
[[maps.layers]]
max_zoom = 14
min_zoom = 8
provider_layer = "osm.protected-areas"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.trees"
[[maps.layers]]
max_zoom = 14
min_zoom = 2
provider_layer = "osm.country-names"
[[maps.layers]]
max_zoom = 14
min_zoom = 3
provider_layer = "osm.capital-names"
[[maps.layers]]
max_zoom = 14
min_zoom = 4
provider_layer = "osm.state-names"
[[maps.layers]]
max_zoom = 14
min_zoom = 4
provider_layer = "osm.placenames-medium"
[[maps.layers]]
max_zoom = 14
min_zoom = 12
provider_layer = "osm.placenames-small"
[[maps.layers]]
max_zoom = 14
min_zoom = 12
provider_layer = "osm.stations"
[[maps.layers]]
max_zoom = 14
min_zoom = 11
provider_layer = "osm.junctions"
[[maps.layers]]
max_zoom = 14
min_zoom = 11
provider_layer = "osm.bridge-text"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.amenity-points"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.amenity-line"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.power-towers"
[[maps.layers]]
max_zoom = 12
min_zoom = 10
provider_layer = "osm.roads-text-ref-low-zoom"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.roads-text-ref"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.roads-area-text-name"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.roads-text-name"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.paths-text-name"
[[maps.layers]]
max_zoom = 14
min_zoom = 11
provider_layer = "osm.railways-text-name"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.roads-text-ref-minor"
[[maps.layers]]
max_zoom = 9
min_zoom = 0
provider_layer = "osm.text-poly-low-zoom"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.text-line"
[[maps.layers]]
max_zoom = 14
min_zoom = 10
provider_layer = "osm.text-point"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.building-text"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.interpolation"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.addresses"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.water-lines-text"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.ferry-routes-text"
[[maps.layers]]
max_zoom = 14
min_zoom = 11
provider_layer = "osm.admin-text"
[[maps.layers]]
max_zoom = 14
min_zoom = 13
provider_layer = "osm.protected-areas-text"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.amenity-low-priority"
[[maps.layers]]
max_zoom = 14
min_zoom = 14
provider_layer = "osm.text-low-priority"
[[providers]]
database = "${PGDATABASE}"
host = "${PGHOST}"
max_connections = 100
name = "osm"
password = "${PGPASSWORD}"
port = "${PGPORT}"
srid = 3857
type = "postgis"
user = "${PGUSER}"
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "landcover-low-zoom"
sql = """
SELECT ST_AsBinary(way) AS geom, \"way_pixels\", \"feature\" FROM (SELECT
way, way_pixels,
COALESCE(wetland, landuse, \"natural\") AS feature
FROM (SELECT
way,
('landuse_' || (CASE WHEN landuse IN ('forest', 'farmland', 'residential', 'commercial', 'retail', 'industrial',
'meadow', 'grass', 'village_green', 'vineyard', 'orchard') THEN landuse ELSE NULL END)) AS landuse,
('natural_' || (CASE WHEN \"natural\" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub') THEN \"natural\" ELSE NULL END)) AS \"natural\",
('wetland_' || (CASE WHEN \"natural\" IN ('wetland', 'mud') THEN (CASE WHEN \"natural\" IN ('mud') THEN \"natural\" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
way_area
FROM planet_osm_polygon
WHERE (landuse IN ('forest', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow', 'grass', 'village_green', 'vineyard', 'orchard')
OR \"natural\" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub'))
AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real
AND building IS NULL
) AS features
ORDER BY way_area DESC, feature
) AS landcover_low_zoom WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "landcover"
sql = """
SELECT ST_AsBinary(way) AS geom, \"name\", \"religion\", \"way_pixels\", \"is_building\", \"feature\" FROM (SELECT
way, name, religion, way_pixels, is_building,
COALESCE(aeroway, amenity, wetland, power, landuse, leisure, man_made, \"natural\", shop, 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 ('bicycle_parking', 'motorcycle_parking', 'university', 'college', 'school', 'taxi',
'hospital', 'kindergarten', 'grave_yard', 'prison', 'place_of_worship', 'clinic', 'ferry_terminal',
'marketplace', 'community_centre', 'social_facility', 'arts_centre', 'parking_space', 'bus_station',
'fire_station', 'police')
OR amenity IN ('parking') AND (tags->'parking' NOT IN ('underground') OR (tags->'parking') IS NULL) THEN amenity ELSE NULL END)) AS amenity,
('landuse_' || (CASE WHEN landuse IN ('quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass',
'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture',
'recreation_ground', 'village_green', 'retail', 'industrial', 'railway', 'commercial',
'brownfield', 'landfill', 'construction', 'plant_nursery', 'religious') THEN landuse ELSE NULL END)) AS landuse,
('shop_' || (CASE WHEN shop IN ('mall') AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) THEN shop ELSE NULL END)) AS shop,
('leisure_' || (CASE WHEN leisure IN ('swimming_pool', 'playground', 'park', 'recreation_ground', 'garden',
'golf_course', 'miniature_golf', 'sports_centre', 'stadium', 'pitch', 'ice_rink',
'track', 'dog_park', 'fitness_station') THEN leisure ELSE NULL END)) AS leisure,
('man_made_' || (CASE WHEN man_made IN ('works', 'wastewater_plant', 'water_works') THEN man_made ELSE NULL END)) AS man_made,
('natural_' || (CASE WHEN \"natural\" IN ('beach', 'shoal', 'heath', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') THEN \"natural\" ELSE NULL END)) AS \"natural\",
('wetland_' || (CASE WHEN \"natural\" IN ('wetland', 'mud') THEN (CASE WHEN \"natural\" = 'mud' THEN \"natural\" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland,
('power_' || (CASE WHEN power IN ('station', 'sub_station', 'substation', 'generator') THEN power ELSE NULL END)) AS power,
('tourism_' || (CASE WHEN tourism IN ('camp_site', 'caravan_site', 'picnic_site') 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', 'muslim') THEN religion ELSE 'INT-generic'::text END AS religion,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building,
way_area
FROM planet_osm_polygon
WHERE (landuse IS NOT NULL
OR leisure IS NOT NULL
OR aeroway IN ('apron', 'aerodrome')
OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'taxi', 'university', 'college', 'school', 'hospital', 'kindergarten',
'grave_yard', 'place_of_worship', 'prison', 'clinic', 'ferry_terminal', 'marketplace', 'community_centre', 'social_facility',
'arts_centre', 'parking_space', 'bus_station', 'fire_station', 'police')
OR man_made IN ('works', 'wastewater_plant','water_works')
OR \"natural\" IN ('beach', 'shoal', 'heath', 'mud', 'wetland', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub')
OR power IN ('station', 'sub_station', 'substation', 'generator')
OR shop IN ('mall')
OR tourism IN ('camp_site', 'caravan_site', 'picnic_site')
OR highway IN ('services', 'rest_area')
OR railway = 'station')
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
) AS landcover
ORDER BY way_area DESC, feature
) AS features WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "landcover-line"
sql = """
SELECT ST_AsBinary(way) AS geom FROM (SELECT
way
FROM planet_osm_line
WHERE man_made = 'cutline'
) AS landcover_line WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "water-lines-casing"
sql = """
SELECT ST_AsBinary(way) AS geom, \"waterway\", \"int_intermittent\", \"int_tunnel\" FROM (SELECT
way,
waterway,
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_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 WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "water-lines-low-zoom"
sql = """
SELECT ST_AsBinary(way) AS geom, \"waterway\", \"int_intermittent\" FROM (SELECT
way,
waterway,
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_intermittent
FROM planet_osm_line
WHERE waterway = 'river'
) AS water_lines_low_zoom WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "water-lines"
sql = """
SELECT ST_AsBinary(way) AS geom, \"waterway\", \"name\", \"int_intermittent\", \"int_tunnel\", \"bridge\" FROM (SELECT
way,
waterway,
name,
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
THEN 'yes' ELSE 'no' END AS int_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 ('river', 'canal', 'stream', 'drain', 'ditch')
AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct'))
ORDER BY COALESCE(layer,0)
) AS water_lines WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "water-areas"
sql = """
SELECT ST_AsBinary(way) AS geom, \"natural\", \"waterway\", \"landuse\", \"way_pixels\", \"int_intermittent\" FROM (SELECT
way,
\"natural\",
waterway,
landuse,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
CASE WHEN tags->'intermittent' IN ('yes')
OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season')
OR tags->'basin' IN ('detention', 'infiltration')
THEN 'yes' ELSE 'no' END AS int_intermittent
FROM planet_osm_polygon
WHERE
(waterway IN ('dock', 'riverbank')
OR landuse IN ('reservoir', 'basin')
OR \"natural\" IN ('water', 'glacier'))
AND building IS NULL
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY COALESCE(layer,0), way_area DESC
) AS water_areas WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "landcover-area-symbols"
sql = """
SELECT ST_AsBinary(way) AS geom, \"surface\", \"natural\", \"int_wetland\", \"leaf_type\", \"way_pixels\" FROM (SELECT
way, surface,
COALESCE(CASE WHEN landuse = 'forest' THEN 'wood' ELSE NULL END, \"natural\") AS \"natural\",
CASE WHEN \"natural\" = 'mud'
THEN \"natural\"
ELSE CASE WHEN (\"natural\" = 'wetland' AND NOT tags ? 'wetland')
THEN 'wetland'
ELSE CASE WHEN (\"natural\" = 'wetland')
THEN tags->'wetland'
ELSE NULL
END
END
END AS int_wetland,
tags->'leaf_type' AS leaf_type,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE (\"natural\" IN ('mud', 'wetland', 'wood', 'beach', 'shoal', 'reef', 'scrub', 'sand') OR landuse = 'forest')
AND building IS NULL
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY COALESCE(layer,0), way_area DESC
) AS landcover_area_symbols WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "marinas-area"
sql = """
SELECT ST_AsBinary(way) AS geom FROM (SELECT
way
FROM planet_osm_polygon
WHERE leisure = 'marina'
) AS marinas_area WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "water-barriers-line"
sql = """
SELECT ST_AsBinary(way) AS geom, \"waterway\" FROM (SELECT
way,
waterway
FROM planet_osm_line
WHERE waterway IN ('dam', 'weir', 'lock_gate')
) AS water_barriers_line WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "water-barriers-poly"
sql = """
SELECT ST_AsBinary(way) AS geom, \"waterway\" FROM (SELECT
way,
waterway
FROM planet_osm_polygon
WHERE waterway IN ('dam', 'weir', 'lock_gate')
) AS water_barriers_poly WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Point"
name = "springs"
sql = """
SELECT ST_AsBinary(way) AS geom, \"natural\" FROM (SELECT
way,
\"natural\"
FROM
(SELECT
ST_PointOnSurface(way) AS way,
\"natural\"
FROM planet_osm_polygon
WHERE way && !bbox!
UNION ALL
SELECT
way,
\"natural\"
FROM planet_osm_point
WHERE way && !bbox!
) _
WHERE \"natural\" IN ('spring')
) AS springs WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "piers-poly"
sql = """
SELECT ST_AsBinary(way) AS geom, \"man_made\" FROM (SELECT
way, man_made
FROM planet_osm_polygon
WHERE man_made IN ('pier', 'breakwater', 'groyne')
) AS piers_poly WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "piers-line"
sql = """
SELECT ST_AsBinary(way) AS geom, \"man_made\" FROM (SELECT
way, man_made
FROM planet_osm_line
WHERE man_made IN ('pier', 'breakwater', 'groyne')
) AS piers_line WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Point"
name = "water-barriers-point"
sql = """
SELECT ST_AsBinary(way) AS geom, \"waterway\" FROM (SELECT
way, waterway
FROM planet_osm_point
WHERE waterway IN ('dam', 'weir', 'lock_gate')
) AS water_barriers_points WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "bridge"
sql = """
SELECT ST_AsBinary(way) AS geom, \"man_made\" FROM (SELECT
way,
man_made
FROM planet_osm_polygon
WHERE man_made = 'bridge'
) AS bridge WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "buildings"
sql = """
SELECT ST_AsBinary(way) AS geom, \"building\", \"amenity\", \"aeroway\", \"aerialway\", \"public_transport\" FROM (SELECT
way,
building,
amenity,
aeroway,
aerialway,
tags->'public_transport' as public_transport
FROM planet_osm_polygon
WHERE building IS NOT NULL
AND building != 'no'
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY COALESCE(layer,0), way_area DESC
) AS buildings WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "tunnels"
sql = """
SELECT ST_AsBinary(way) AS geom, \"feature\", \"horse\", \"foot\", \"bicycle\", \"tracktype\", \"int_surface\", \"access\", \"construction\", \"service\", \"link\", \"layernotnull\" FROM (SELECT
way,
(CASE WHEN feature IN ('highway_motorway_link', 'highway_trunk_link', 'highway_primary_link', 'highway_secondary_link', 'highway_tertiary_link') THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,
horse,
foot,
bicycle,
tracktype,
int_surface,
access,
construction,
service,
link,
layernotnull
FROM ( -- subselect that contains both roads and rail
SELECT
way,
'highway_' || highway AS feature, --only motorway to tertiary links are accepted later on
horse,
foot,
bicycle,
tracktype,
CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',
'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved'
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',
'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved'
ELSE NULL
END AS int_surface,
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 highway IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link') THEN 'yes'
ELSE 'no'
END AS link,
COALESCE(layer,0) AS layernotnull,
z_order
FROM planet_osm_line
WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes')
AND highway IS NOT NULL -- end of road select
UNION ALL
SELECT
way,
'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'
WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service'
ELSE railway END) AS feature,
horse,
foot,
bicycle,
tracktype,
'null',
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,
'no' AS link,
COALESCE(layer,0) AS layernotnull,
z_order
FROM planet_osm_line
WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes')
AND (railway NOT IN ('platform') AND railway IS NOT NULL) -- end of rail select
) AS features
ORDER BY
layernotnull,
z_order,
CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END,
CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END,
CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,
CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END
) AS tunnels WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "landuse-overlay"
sql = """
SELECT ST_AsBinary(way) AS geom, \"landuse\", \"military\", \"way_pixels\" FROM (SELECT
way,
landuse,
military,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE (landuse = 'military'
OR military = 'danger_area')
AND building IS NULL
) AS landuse_overlay WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "tourism-boundary"
sql = """
SELECT ST_AsBinary(way) AS geom, \"way_pixels\", \"tourism\" FROM (SELECT
way,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
tourism
FROM planet_osm_polygon
WHERE tourism = 'theme_park'
OR tourism = 'zoo'
) AS tourism_boundary WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "barriers"
sql = """
SELECT ST_AsBinary(way) AS geom, \"feature\" FROM (SELECT
way, COALESCE(historic, barrier) AS feature
FROM
(SELECT way,
('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'ditch', 'fence', 'guard_rail',
'handrail', 'hedge', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier,
('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic
FROM
(SELECT
way,
historic,
barrier,
waterway
FROM planet_osm_polygon
WHERE way && !bbox!
UNION ALL
SELECT
way,
historic,
barrier,
waterway
FROM planet_osm_line
WHERE way && !bbox!
) _
WHERE barrier IN ('chain', 'city_wall', 'ditch', 'fence', 'guard_rail',
'handrail', 'hedge', 'retaining_wall', 'wall')
OR historic = 'citywalls'
AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'stream', 'drain', 'ditch'))
) AS features
) AS line_barriers WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "cliffs"
sql = """
SELECT ST_AsBinary(way) AS geom, \"natural\", \"man_made\" FROM (SELECT
way, \"natural\", man_made
FROM planet_osm_line
WHERE \"natural\" = 'cliff' OR man_made = 'embankment'
) AS cliffs WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "ferry-routes"
sql = """
SELECT ST_AsBinary(way) AS geom FROM (SELECT
way
FROM planet_osm_line
WHERE route = 'ferry'
AND osm_id > 0
) AS ferry_routes WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Point"
name = "turning-circle-casing"
sql = """
SELECT ST_AsBinary(way) AS geom, \"int_tc_type\", \"int_tc_service\" FROM (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),
('track', 6)
) 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_sql WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "Polygon"
name = "highway-area-casing"
sql = """
SELECT ST_AsBinary(way) AS geom, \"feature\" FROM (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')
AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL)
AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL)
AND (covered NOT IN ('yes') OR covered IS NULL))
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')
AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL)
AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL)
AND (covered NOT IN ('yes') OR covered IS NULL))
ORDER BY COALESCE(layer,0), way_area DESC
) AS highway_area_casing WHERE way && !BBOX!"""
[[providers.layers]]
geometry_fieldname = "geom"
geometry_type = "LineString"
name = "roads-casing"
sql = """
SELECT ST_AsBinary(way) AS geom, \"feature\", \"horse\", \"foot\", \"bicycle\", \"tracktype\", \"int_surface\", \"access\", \"construction\", \"service\", \"link\", \"layernotnull\" FROM (SELECT
way,
(CASE WHEN feature IN ('highway_motorway_link', 'highway_trunk_link', 'highway_primary_link', 'highway_secondary_link', 'highway_tertiary_link') THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,
horse,
foot,
bicycle,
tracktype,
int_surface,
access,
construction,
service,
link,
layernotnull
FROM ( -- subselect that contains both roads and rail/aero
SELECT
way,
('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on
horse,
foot,
bicycle,
tracktype,
CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',
'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved'
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',
'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved'
ELSE NULL
END AS int_surface,
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') OR leisure IN ('slipway') THEN 'INT-minor'::text
ELSE 'INT-normal'::text
END AS service,
CASE
WHEN highway IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link') THEN 'yes'
ELSE 'no'
END AS link,
COALESCE(layer,0) AS layernotnull,
osm_id,
z_order
FROM planet_osm_line
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'))
AND highway IS NOT NULL -- end of road select
UNION ALL
SELECT
way,
('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'
WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service'
ELSE railway END)) AS feature,
horse,
foot,
bicycle,
tracktype,
'null',
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') OR leisure IN ('slipway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,
'no' AS link,
COALESCE(layer,0) AS layernotnull,
osm_id,