-
Notifications
You must be signed in to change notification settings - Fork 44
/
project.mml
1960 lines (1957 loc) · 56.4 KB
/
project.mml
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
name: CyclOSM
description: 'Cycle oriented CartoCSS style.'
attribution: Data © OpenStreetMap (and) contributors, ODbL
bounds: &world
- -180
- -85.05112877980659
- 180
- 85.05112877980659
center:
- 0
- 0
- 4
format: png
interactivity: false
minzoom: 0
maxzoom: 20
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 dont 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: "osm"
key_field: ""
geometry_field: "way"
extent: "-20037508,-20037508,20037508,20037508"
Stylesheet:
- palette.mss
- road-colors.mss
- fonts.mss
- base.mss
- aerialways.mss
- ferry-routes.mss
- roads.mss
- amenities.mss
- labels.mss
- placenames.mss
- addressing.mss
- power.mss
- admin.mss
- gpx.mss
- legend.mss
Layer:
- id: land-low
<<: *extents
Datasource:
file: http://osmdata.openstreetmap.de/download/simplified-land-polygons-complete-3857.zip
type: shape
class: shp
geometry: polygon
properties:
maxzoom: 9
- id: land-high
<<: *extents
Datasource:
file: http://osmdata.openstreetmap.de/download/land-polygons-split-3857.zip
type: shape
class: shp
geometry: polygon
properties:
minzoom: 10
- id: landuse_gen0
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
ST_Snaptogrid(way, !pixel_width! / 4) AS way,
way_area AS area,
COALESCE(
CASE WHEN landuse IS NOT NULL THEN ('landuse_' || landuse) ELSE NULL END,
CASE WHEN "natural" IS NOT NULL THEN ('natural_' || "natural") ELSE NULL END,
CASE WHEN leisure IS NOT NULL THEN ('leisure_' || leisure) ELSE NULL END,
CASE WHEN amenity IS NOT NULL THEN ('amenity_' || amenity) ELSE NULL END,
CASE WHEN highway IN ('pedestrian') THEN ('highway_' || highway) ELSE NULL END
) AS type,
sport
FROM planet_osm_polygon
WHERE (
landuse IN ('cemetery', 'commercial', 'forest', 'grass', 'industrial', 'meadow', 'farmland', 'vineyard', 'orchard', 'religious', 'residential', 'retail', 'village_green')
OR "natural" IN ('grassland', 'glacier', 'heath', 'scrub', 'wood', 'wetland', 'sand', 'beach', 'dune', 'bare_rock', 'shingle', 'scree')
OR leisure IN ('common', 'golf_course', 'garden', 'park', 'pitch', 'sports_centre', 'stadium', 'track')
OR amenity IN ('college', 'hospital', 'parking', 'school', 'university')
OR highway IN ('pedestrian')
)
AND way_area > 0.1*!pixel_width!::real*!pixel_height!::real
AND way && !bbox!
ORDER BY way_area DESC
) AS data
geometry: polygon
properties:
minzoom: 2
maxzoom: 9
- id: landuse_gen1
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
way_area AS area,
COALESCE(
CASE WHEN landuse IS NOT NULL THEN ('landuse_' || landuse) ELSE NULL END,
CASE WHEN "natural" IS NOT NULL THEN ('natural_' || "natural") ELSE NULL END,
CASE WHEN leisure IS NOT NULL THEN ('leisure_' || leisure) ELSE NULL END,
CASE WHEN amenity IS NOT NULL THEN ('amenity' || amenity) ELSE NULL END,
CASE WHEN highway IS NOT NULL THEN ('highway_' || highway) ELSE NULL END
) AS type,
sport
FROM planet_osm_polygon
WHERE (
landuse IN ('allotments', 'brownfield', 'cemetery', 'commercial', 'construction', 'forest', 'grass', 'greenhouse_horticulture', 'industrial', 'landfill', 'meadow', 'farmland', 'vineyard', 'orchard', 'plant_nursery', 'quarry', 'religious', 'residential', 'retail', 'village_green')
OR "natural" IN ('grassland', 'glacier', 'heath', 'scrub', 'wood', 'wetland', 'sand', 'beach', 'dune', 'bare_rock', 'shingle', 'scree')
OR leisure IN ('common', 'golf_course', 'garden', 'park', 'pitch', 'sports_centre', 'stadium', 'track')
OR amenity IN ('college', 'grave_yard', 'hospital', 'parking', 'school', 'university')
OR highway IN ('pedestrian')
)
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY way_area DESC
) AS data
geometry: polygon
properties:
cache-features: true
minzoom: 10
maxzoom: 12
- id: landuse
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
way_area AS area,
COALESCE(
CASE WHEN landuse IS NOT NULL THEN ('landuse_' || landuse) ELSE NULL END,
CASE WHEN leisure IS NOT NULL THEN ('leisure_' || leisure) ELSE NULL END,
CASE WHEN "natural" IS NOT NULL THEN ('natural_' || "natural") ELSE NULL END,
CASE WHEN highway IS NOT NULL THEN ('highway_' || highway) ELSE NULL END,
CASE WHEN amenity IS NOT NULL THEN ('amenity_' || amenity) ELSE NULL END,
CASE WHEN man_made IN ('works', 'wastewater_plant', 'water_works') THEN 'landuse_industrial' ELSE NULL END
) AS type,
sport
FROM planet_osm_polygon
WHERE landuse IN ('allotments', 'brownfield', 'cemetery', 'commercial', 'construction', 'forest', 'grass', 'greenhouse_horticulture', 'industrial', 'landfill', 'meadow', 'farmland', 'vineyard', 'orchard', 'plant_nursery', 'quarry', 'religious', 'residential', 'retail', 'village_green')
OR leisure IN ('common', 'garden', 'golf_course', 'park', 'pitch', 'sports_centre', 'stadium', 'track')
OR "natural" IN ('grassland', 'glacier', 'heath', 'scrub', 'wood', 'wetland', 'sand', 'beach', 'dune', 'bare_rock', 'shingle', 'scree')
OR highway IN ('pedestrian', 'footway')
OR amenity IN ('college', 'grave_yard', 'hospital', 'parking', 'school', 'university')
OR man_made IN ('works', 'wastewater_plant', 'water_works')
ORDER BY way_area DESC
) AS data
geometry: polygon
properties:
minzoom: 13
- id: landuse-overlay
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
COALESCE(CASE WHEN landuse = 'forest' THEN 'wood' ELSE NULL END, "natural", landuse) AS type,
tags->'leaf_type' AS leaf_type,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
FROM planet_osm_polygon
WHERE
("natural" = 'wood' OR landuse = 'forest')
AND building IS NULL
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY way_area DESC
) AS data
geometry: polygon
properties:
minzoom: 7
- id: hillshade
<<: *extents84
Datasource:
type: gdal
file: dem/shade.vrt
geometry: raster
properties:
status: off
- id: contours100
class: contours
<<: *extents
Datasource:
<<: *osm2pgsql
dbname: "contours"
geometry_field: "geometry"
table: |-
(
SELECT
geometry, height
FROM contours
WHERE height IS NOT NULL AND MOD(height::numeric, 100) = 0
) AS data
geometry: line
properties:
minzoom: 11
status: off
- id: contours50
class: contours
<<: *extents
Datasource:
<<: *osm2pgsql
dbname: "contours"
geometry_field: "geometry"
table: |-
(
SELECT
geometry, height
FROM contours
WHERE height IS NOT NULL AND MOD(height::numeric, 100) != 0 AND MOD(height::numeric, 50) = 0
) AS data
geometry: line
properties:
minzoom: 11
status: off
- id: contours20
class: contours
<<: *extents
Datasource:
<<: *osm2pgsql
dbname: "contours"
geometry_field: "geometry"
table: |-
(
SELECT
geometry, height
FROM contours
WHERE height IS NOT NULL AND MOD(height::numeric, 100) != 0 AND MOD(height::numeric, 20) = 0
) AS data
geometry: line
properties:
minzoom: 12
status: off
- id: contours10
class: contours
<<: *extents
Datasource:
<<: *osm2pgsql
dbname: "contours"
geometry_field: "geometry"
table: |-
(
SELECT
geometry, height
FROM contours
WHERE height IS NOT NULL AND MOD(height::numeric, 50) != 0 AND MOD(height::numeric, 10) = 0
) AS data
geometry: line
properties:
minzoom: 13
status: off
- id: waterway_low
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT ST_Snaptogrid(way, !pixel_width! / 4) AS way, waterway AS type
FROM planet_osm_line
WHERE
waterway IN ('river', 'canal')
AND (tunnel IS NULL OR tunnel NOT IN ('yes', 'culvert'))
AND way && !bbox!
) AS data
geometry: linestring
properties:
minzoom: 8
maxzoom: 12
- id: waterway_med
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT way, waterway AS type
FROM planet_osm_line
WHERE
waterway IN ('river', 'canal', 'stream')
AND (tunnel IS NULL OR tunnel NOT IN ('yes', 'culvert'))
) AS data
geometry: linestring
properties:
minzoom: 13
maxzoom: 14
- id: waterway_high
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT way, waterway AS type
FROM planet_osm_line
WHERE
waterway IN ('river', 'canal', 'stream', 'ditch', 'drain')
AND (tunnel IS NULL OR tunnel NOT IN ('yes', 'culvert'))
) AS data
geometry: linestring
properties:
minzoom: 15
- id: water_gen0
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
way_area AS area,
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 intermittent
FROM planet_osm_polygon
WHERE
(
"natural" IN ('water', 'pond')
OR waterway IN ('basin', 'canal', 'dock', 'mill_pond', 'pond', 'riverbank', 'stream')
OR landuse in ('basin', 'reservoir')
)
AND way_area > 0.1*!pixel_width!::real*!pixel_height!::real
AND (tunnel IS NULL OR tunnel NOT IN ('yes', 'culvert'))
) AS data
geometry: polygon
properties:
minzoom: 2
maxzoom: 9
- id: water_gen1
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
way_area AS area,
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 intermittent
FROM planet_osm_polygon
WHERE
(
"natural" IN ('water', 'pond')
OR waterway IN ('basin', 'canal', 'dock', 'mill_pond', 'pond', 'riverbank', 'stream')
OR landuse in ('basin', 'reservoir')
)
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
AND (tunnel IS NULL OR tunnel NOT IN ('yes', 'culvert'))
) AS data
geometry: polygon
properties:
minzoom: 10
maxzoom: 12
- id: water
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
way_area AS area,
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 intermittent
FROM planet_osm_polygon
WHERE
(
"natural" IN ('water', 'pond')
OR waterway IN ('basin', 'canal', 'dock', 'mill_pond', 'pond', 'riverbank', 'stream')
OR landuse in ('basin', 'reservoir')
)
AND (tunnel IS NULL OR tunnel NOT IN ('yes', 'culvert'))
) AS data
geometry: polygon
properties:
minzoom: 13
- id: buildings
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
building AS type,
waterway
FROM planet_osm_polygon
WHERE ((building IS NOT NULL AND building != 'no')
OR (man_made='bridge')
OR (waterway='dam'))
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
AND (tags->'location' IS NULL OR tags->'location' != 'underground')
ORDER BY z_order ASC, way_area DESC
) AS data
geometry: polygon
properties:
minzoom: 16
- id: piers-poly
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, man_made
FROM planet_osm_polygon
WHERE man_made IN ('pier', 'breakwater', 'groyne')
) AS piers_poly
properties:
minzoom: 12
- id: piers-line
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, man_made
FROM planet_osm_line
WHERE man_made IN ('pier', 'breakwater', 'groyne')
) AS piers_line
properties:
minzoom: 12
- id: aeroway
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT way, aeroway AS type
FROM planet_osm_line
WHERE aeroway IN ('runway', 'taxiway')
) AS data
geometry: linestring
properties:
minzoom: 11
- id: tunnel
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
type,
access,
maxspeed_kmh,
bicycle,
motor_vehicle,
cyclestreet,
oneway,
cycleway_left_render,
cycleway_right_render,
cycleway_left_oneway,
cycleway_right_oneway,
can_bicycle,
segregated,
oneway_bicycle,
has_ramp,
surface_type,
service,
mtb_scale,
mtb_scale_imba,
tunnel
FROM cyclosm_ways
WHERE tunnel NOT IN ('no')
) AS data
geometry: linestring
properties:
cache-features: true
minzoom: 11
- id: turning_circle_case
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT way
FROM planet_osm_point
WHERE highway = 'turning_circle'
) AS data
geometry: point
properties:
minzoom: 14
- id: leisure_track
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
sport
FROM planet_osm_line
WHERE leisure = 'track'
) AS data
geometry: linestring
properties:
cache-features: true
minzoom: 11
- id: roads_high
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
type,
access,
maxspeed_kmh,
bicycle,
motor_vehicle,
cyclestreet,
oneway,
cycleway_left_render,
cycleway_right_render,
cycleway_left_oneway,
cycleway_right_oneway,
can_bicycle,
segregated,
oneway_bicycle,
has_ramp,
surface_type,
service,
mtb_scale,
mtb_scale_imba
FROM cyclosm_ways
WHERE (tunnel IS NULL OR tunnel = 'no')
AND (bridge IS NULL OR bridge = 'no')
) AS data
geometry: linestring
properties:
cache-features: true
minzoom: 11
- id: roads_med
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
ST_Snaptogrid(way, !pixel_width! / 4) AS way,
COALESCE(
highway,
CASE
WHEN railway IN ('rail') THEN 'railway'
ELSE 'other'
END
) AS type,
CASE
WHEN bicycle IN ('no', 'private', 'use_sidepath') THEN 'no'
WHEN bicycle IS NOT NULL THEN bicycle
WHEN tags->'motorroad' IN ('yes') THEN 'no'
WHEN highway NOT IN ('motorway', 'motorway_link') AND tags->'vehicle' IN ('no', 'private') THEN 'no'
WHEN highway NOT IN ('motorway', 'motorway_link') AND tags->'vehicle' IS NOT NULL THEN tags->'vehicle'
WHEN highway NOT IN ('motorway', 'motorway_link') AND access IN ('no', 'private') THEN 'no'
WHEN highway NOT IN ('motorway', 'motorway_link') AND access IS NOT NULL THEN access
ELSE NULL
END AS can_bicycle
FROM planet_osm_roads
WHERE (((railway IN ('rail') AND (service IS NULL OR service NOT IN ('spur', 'siding', 'yard')))
OR highway IN ('motorway', 'trunk', 'primary', 'secondary')))
AND way && !bbox!
ORDER BY CASE
WHEN railway IS NOT NULL THEN 0
WHEN highway IS NOT NULL THEN 1
END DESC
) AS data
geometry: linestring
properties:
minzoom: 9
maxzoom: 10
- id: roads_low
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
ST_Snaptogrid(way, !pixel_width! / 4) AS way,
COALESCE(
highway,
CASE
WHEN railway IN ('rail') THEN 'railway'
ELSE 'other'
END
) AS type,
bridge,
tunnel,
bicycle
FROM planet_osm_roads
WHERE ((railway IN ('rail') AND (service IS NULL OR service NOT IN ('spur', 'siding', 'yard')))
OR highway IN ('motorway', 'trunk'))
AND way && !bbox!
ORDER BY CASE
WHEN railway IS NOT NULL THEN 0
WHEN highway IS NOT NULL THEN 1
END DESC
) AS data
geometry: linestring
properties:
cache-features: true
minzoom: 5
maxzoom: 8
- id: turning_circle_fill
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT way
FROM planet_osm_point
WHERE highway = 'turning_circle'
) AS data
geometry: point
properties:
minzoom: 14
- id: aerialways
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
aerialway,
name,
CASE
WHEN tags->'aerialway:bicycle' IN ('yes', 'summer') THEN 'yes'
WHEN aerialway IN ('cablecar', 'gondola', 'mixed_lift') AND (tags->'aerialway:bicycle' IS NULL OR tags->'aerialway:bicycle' != 'no') THEN 'yes'
ELSE 'no'
END AS bicycle
FROM planet_osm_line
WHERE aerialway IS NOT NULL
) AS data
properties:
minzoom: 12
- id: bridge
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
type,
access,
maxspeed_kmh,
bicycle,
motor_vehicle,
cyclestreet,
oneway,
cycleway_left_render,
cycleway_right_render,
cycleway_left_oneway,
cycleway_right_oneway,
can_bicycle,
segregated,
oneway_bicycle,
has_ramp,
surface_type,
service,
mtb_scale,
mtb_scale_imba,
bridge
FROM cyclosm_ways
WHERE bridge NOT IN ('no')
) AS data
geometry: linestring
properties:
cache-features: true
minzoom: 11
- id: admin-low-zoom
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
admin_level
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4')
AND osm_id < 0
ORDER BY admin_level DESC
) AS admin_low_zoom
properties:
minzoom: 4
maxzoom: 10
- id: admin-mid-zoom
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
admin_level
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8')
AND osm_id < 0
ORDER BY admin_level DESC
) AS admin_mid_zoom
properties:
minzoom: 11
maxzoom: 12
- id: admin-high-zoom
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
admin_level
FROM planet_osm_roads
WHERE boundary = 'administrative'
AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
AND osm_id < 0
ORDER BY admin_level::integer DESC -- With 10 as a valid value, we need to do a numeric ordering, not a text ordering
) AS admin_high_zoom
properties:
minzoom: 13
- id: ferry-routes
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
bicycle
FROM planet_osm_line
WHERE route = 'ferry'
AND osm_id > 0
) AS ferry_routes
properties:
minzoom: 8
- id: bicycle_routes_gen0
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT ST_Simplify(way, !pixel_width!/4, TRUE) AS way, route, tags->'network' AS type, tags->'state' AS state
FROM planet_osm_line
WHERE (route='bicycle' OR route='mtb')
AND tags->'network'='icn'
AND way && !bbox!
ORDER BY z_order
) AS data
geometry: linestring
properties:
minzoom: 2
maxzoom: 4
- id: bicycle_routes_gen1
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT ST_Simplify(way, !pixel_width!/4, TRUE) AS way, route, tags->'network' AS type, tags->'state' AS state
FROM planet_osm_line
WHERE (route='bicycle' OR route='mtb')
AND tags->'network' IN ('icn', 'ncn')
AND way && !bbox!
ORDER BY CASE
WHEN tags->'network' = 'icn' THEN 0
WHEN tags->'network' = 'ncn' THEN 1
END DESC
) AS data
geometry: linestring
properties:
minzoom: 5
maxzoom: 7
- id: bicycle_routes_gen2
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT ST_Simplify(way, !pixel_width!/4, TRUE) AS way, route, tags->'network' AS type, tags->'state' AS state
FROM planet_osm_line
WHERE (route='bicycle' OR route='mtb')
AND tags->'network' IN ('icn', 'ncn', 'rcn')
AND (NOT ((tags->'network') IS NOT NULL AND (tags->'network:type') IS NOT NULL AND (tags->'network' = 'rcn') AND tags->'network:type' = 'node_network'))
AND way && !bbox!
ORDER BY CASE
WHEN tags->'network' = 'icn' THEN 0
WHEN tags->'network' = 'ncn' THEN 1
WHEN tags->'network' = 'rcn' THEN 2
END DESC
) AS data
geometry: linestring
properties:
minzoom: 8
maxzoom: 10
- id: bicycle_routes_bicycle_gen3
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT * FROM (
SELECT
way,
COALESCE(tags->'network', 'lcn') AS type,
tags->'state' AS state,
CASE
WHEN tags->'network' = 'icn' THEN 0
WHEN tags->'network' = 'ncn' THEN 1
WHEN tags->'network' = 'rcn' THEN 2
WHEN tags->'network' = 'lcn' THEN 3
ELSE 4
END as priority
FROM planet_osm_line
WHERE route='bicycle'
UNION ALL
SELECT way, 'lcn' as type, tags->'lcn' AS state, 4 as priority
FROM planet_osm_line
WHERE tags->'lcn' IS NOT NULL AND tags->'lcn' NOT IN ('no', 'none')
AND highway IS NOT NULL
) as routes_from_relations_and_ways
ORDER BY priority DESC
) AS data
geometry: linestring
properties:
minzoom: 11
- id: bicycle_routes_mtb_gen3
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT way, route, COALESCE(tags->'network', 'lcn') AS type, tags->'state' AS state
FROM planet_osm_line
WHERE route='mtb'
ORDER BY CASE
WHEN tags->'network' = 'icn' THEN 0
WHEN tags->'network' = 'ncn' THEN 1
WHEN tags->'network' = 'rcn' THEN 2
WHEN tags->'network' = 'lcn' THEN 3
ELSE 4
END DESC
) AS data
geometry: linestring
properties:
minzoom: 11
- id: route
<<: *extents84
Datasource:
file: '${gpxroute}'
type: ogr
layer: tracks
geometry: line
properties:
status: off
- id: power-minorline
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE power = 'minor_line'
) AS power_minorline
properties:
minzoom: 16
- id: power-line
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE power = 'line'
OR (power = 'cable' AND tags->'location' IN ('overground', 'overhead', 'surface', 'outdoor', 'platform'))
) AS power_line
properties:
minzoom: 14
- id: protected-areas
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
name,
boundary,
tags->'protect_class' AS protect_class,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE (boundary IN ('aboriginal_lands', 'national_park')
OR leisure = 'nature_reserve'
OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99')))
AND building IS NULL
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
) AS protected_areas
properties:
cache-features: true
minzoom: 7
- id: trees
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
"natural"
FROM planet_osm_point
WHERE "natural" = 'tree'
UNION ALL
SELECT
way,
"natural"
FROM planet_osm_line
WHERE "natural" = 'tree_row'
) AS data
properties:
cache-features: true
minzoom: 16
- id: barriers_line
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way, COALESCE(historic, barrier) AS feature
FROM
(SELECT way,
('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'ditch', 'fence', 'guard_rail',
'handrail', 'hedge', 'jersey_barrier', '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', 'jersey_barrier', 'retaining_wall', 'wall')
OR historic = 'citywalls'
AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'stream', 'drain', 'ditch'))
) AS features
) AS line_barriers
properties:
minzoom: 15
- id: cycle-junction-nodes
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
way,
RIGHT(
COALESCE(tags->'icn_ref', tags->'ncn_ref', tags->'rcn_ref', tags->'lcn_ref'),
4