diff --git a/osm-carto/.pc/ridges_valleys.diff/landcover.mss b/osm-carto/.pc/ridges_valleys.diff/landcover.mss new file mode 100644 index 0000000..3b11c46 --- /dev/null +++ b/osm-carto/.pc/ridges_valleys.diff/landcover.mss @@ -0,0 +1,753 @@ +// --- Parks, woods, other green things --- + +@grass: #cdebb0; // also meadow, common, garden, village_green +@golf_course: #b5e3b5; +@scrub: #b5e3b5; +@forest: #add19e; // Lch(80,30,135) +@forest-text: #46673b; // Lch(40,30,135) +@park: #c8facc; // Lch(94,30,145) also recreation_ground +@orchard: #aedfa3; + +// --- sports --- + +@stadium: #3c9; // also sports_centre +@track: #74dcba; +@pitch: #8ad3af; + +// --- "base" landuses --- + +@residential: #e0dfdf; // Lch(89,0,0) +@residential-line: #B9B9B9; // Lch(75,0,0) +@retail: #FFD6D1; // Lch(89,16,30) +@retail-line: #D99C95; // Lch(70,25,30) +@commercial: #F2DAD9; // Lch(89,8.5,25) +@commercial-line: #D1B2B0; // Lch(75,12,25) +@industrial: #EBDBE8; // Lch(89,9,330) +@industrial-line: #C6B3C3; // Lch(75,11,330) +@railway: @industrial; +@railway-line: @industrial-line; +@farmland: #fbecd7; // Lch(94,12,80) (Also used for farm) +@farmland-line: #d6c4ab; // Lch(80,15,80) + +@farmyard: #EFD6B5; // Lch(87,20,80) +@farmyard-line: #D1B48C; // Lch(75,25,80) + +// --- Other ---- + +@aerodrome: #e9e7e2; +@allotments: #e5c7ab; +@apron: #e9d1ff; +@bare_ground: #eee5dc; +@campsite: #def6c0; // also caravan_site, picnic_site +@cemetery: #aacbaf; // also grave_yard +@construction: #b6b592; +@danger_area: pink; +@garages: #dfddce; +@heath: #d6d99f; +@mud: rgba(203,177,154,0.3); // produces #e6dcd1 over @land +@parking: #f7efb7; +@place_of_worship: #cdccc9; +@place_of_worship_outline: #111; +@playground: #ccfff1; +@power: darken(@industrial, 5%); +@power-line: darken(@industrial-line, 5%); +@rest_area: #efc8c8; // also services +@sand: #f5e9c6; +@educational_areas_and_hospital: #f0f0d8; +@station: #d4aaaa; +@tourism: #734a08; +@quarry: #c5c3c3; +@military: #f55; +@beach: #fff1ba; + +#landcover-low-zoom[zoom < 10], +#landcover[zoom >= 10] { + + ::first { + [feature = 'wetland_mud'], + [feature = 'wetland_tidalflat'] { + [zoom >= 9] { + polygon-fill: @mud; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + } + + /* + [feature = 'leisure_swimming_pool'][zoom >= 14] { + polygon-fill: @water-color; + line-color: saturate(darken(@water-color, 40%), 30%); + line-width: 0.5; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + */ + + [feature = 'leisure_playground'][zoom >= 13] { + polygon-fill: @playground; + line-color: darken(@playground, 60%); + line-width: 0.3; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'tourism_camp_site'], + [feature = 'tourism_caravan_site'], + [feature = 'tourism_picnic_site'] { + [zoom >= 10] { + polygon-fill: @campsite; + line-color: saturate(darken(@campsite, 60%), 30%); + line-width: 0.3; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + + [feature = 'landuse_quarry'][zoom >= 10] { + polygon-fill: @quarry; + polygon-pattern-file: url('symbols/quarry.png'); + line-width: 0.5; + line-color: grey; + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + + // TODO: make them transparent + /* + [feature = 'landuse_vineyard'] { + [zoom >= 10] { + polygon-fill: @orchard; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + [zoom >= 14] { + polygon-pattern-file: url('symbols/vineyard.png'); + polygon-pattern-alignment: global; + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + */ + + // TODO: make them transparent + /* + [feature = 'landuse_orchard'] { + [zoom >= 10] { + polygon-fill: @orchard; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + [zoom >= 14] { + polygon-pattern-file: url('symbols/orchard.png'); + polygon-pattern-alignment: global; + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + */ + + [feature = 'landuse_cemetery'], + [feature = 'amenity_grave_yard'] { + [zoom >= 10] { + polygon-fill: @cemetery; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + [zoom >= 14] { + [religion = 'jewish'] { polygon-pattern-file: url('symbols/grave_yard_jewish.png'); } + [religion = 'christian'] { polygon-pattern-file: url('symbols/grave_yard_christian.png'); } + [religion = 'INT-generic'] { polygon-pattern-file: url('symbols/grave_yard_generic.png'); } + [religion = 'jewish'], + [religion = 'christian'], + [religion = 'INT-generic'] { + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + } + + [feature = 'amenity_place_of_worship'][zoom >= 13] { + polygon-fill: @place_of_worship; + polygon-clip: false; + [zoom >= 15] { + line-color: @place_of_worship_outline; + line-width: 0.3; + line-clip: false; + } + } + + [feature = 'amenity_prison'][zoom >= 10][way_pixels > 75] { + polygon-pattern-file: url('symbols/grey_vertical_hatch.png'); + polygon-pattern-alignment: global; + line-color: #888; + line-width: 3; + line-opacity: 0.329; + } + + [feature = 'landuse_residential'][zoom >= 10] { + polygon-fill: @residential; + [zoom >= 16] { + line-width: .5; + line-color: @residential-line; + [name != ''] { + line-width: 0.7; + } + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'landuse_garages'][zoom >= 13] { + polygon-fill: @garages; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'military_danger_area'] { + [zoom >= 9][zoom < 11] { + polygon-fill: @danger_area; + polygon-opacity: 0.3; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + [zoom >= 11] { + polygon-pattern-file: url('symbols/danger.png'); + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + + [feature = 'leisure_park'], + [feature = 'leisure_recreation_ground'] { + [zoom >= 10] { + polygon-fill: @park; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + + [feature = 'leisure_golf_course'][zoom >= 10], + [feature = 'leisure_miniature_golf'][zoom >= 15] { + polygon-fill: @golf_course; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + // TODO: make them transparent + /* + [feature = 'landuse_allotments'] { + [zoom >= 10][zoom < 14] { + polygon-fill: @allotments; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + [zoom >= 14] { + polygon-pattern-file: url('symbols/allotments.png'); + polygon-pattern-alignment: global; + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + */ + + // TODO: make them transparent + /* + [feature = 'landuse_forest'], + [feature = 'natural_wood'] { + [zoom >= 8] { + polygon-fill: @forest; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + */ + + // TODO: make them transparent + /* + [feature = 'landuse_farmyard'][zoom >= 10] { + polygon-fill: @farmyard; + [zoom >= 16] { + line-width: 0.5; + line-color: @farmyard-line; + [name != ''] { + line-width: 0.7; + } + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + */ + + // TODO: make them transparent + /* + [feature = 'landuse_farm'], + [feature = 'landuse_farmland'], + [feature = 'landuse_greenhouse_horticulture'] { + [zoom >= 10] { + polygon-fill: @farmland; + [zoom >= 16] { + line-width: .5; + line-color: @farmland-line; + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + */ + + // TODO: make them transparent + /* + [feature = 'landuse_meadow'], + [feature = 'natural_grassland'], + [feature = 'landuse_grass'], + */ + [feature = 'landuse_recreation_ground'], + [feature = 'landuse_village_green'], + [feature = 'leisure_common'], + [feature = 'leisure_garden'] { + [zoom >= 10] { + polygon-fill: @grass; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + + /* + [feature = 'landuse_retail'][zoom >= 10] { + polygon-fill: @retail; + [zoom >= 16] { + line-width: 0.5; + line-color: @retail-line; + [name != ''] { + line-width: 0.7; + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + */ + + /* + [feature = 'landuse_industrial'][zoom >= 10] { + polygon-fill: @industrial; + [zoom >= 16] { + line-width: .5; + line-color: @industrial-line; + [name != ''] { + line-width: 0.7; + } + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + */ + + [feature = 'landuse_railway'][zoom >= 10] { + polygon-fill: @railway; + [zoom >= 16][name != ''] { + line-width: 0.7; + line-color: @railway-line; + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + /* + [feature = 'power_station'][zoom >= 10], + [feature = 'power_generator'][zoom >= 10], + [feature = 'power_sub_station'][zoom >= 13], + [feature = 'power_substation'][zoom >= 13] { + polygon-fill: @industrial; + [zoom >= 15] { + polygon-fill: @power; + } + [zoom >= 16] { + line-width: 0.5; + line-color: @power-line; + [name != ''] { + line-width: 0.7; + } + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + */ + + [feature = 'landuse_commercial'][zoom >= 10] { + polygon-fill: @commercial; + [zoom >= 16] { + line-width: 0.5; + line-color: @commercial-line; + [name != ''] { + line-width: 0.7; + } + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + // TODO: make them transparent + /* + [feature = 'landuse_brownfield'], + [feature = 'landuse_landfill'], + */ + /* + [feature = 'landuse_construction'] { + [zoom >= 10] { + polygon-fill: @construction; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + */ + + [feature = 'natural_bare_rock'][zoom >= 9] { + /* + polygon-fill: @bare_ground; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + */ + [zoom >= 13] { + polygon-pattern-file: url('symbols/rock_overlay.png'); + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + + [feature = 'natural_scree'], + [feature = 'natural_shingle'] { + [zoom >= 9] { + /* + polygon-fill: @bare_ground; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + */ + [zoom >= 13] { + polygon-pattern-file: url('symbols/scree_overlay.png'); + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + } + + [feature = 'natural_sand'][zoom >= 9] { + polygon-fill: @sand; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + // TODO: make them transparent + /* + [feature = 'natural_heath'][zoom >= 10] { + polygon-fill: @heath; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + */ + + [feature = 'natural_scrub'] { + /* + [zoom >= 10] { + polygon-fill: @scrub; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + */ + [zoom >= 14] { + // polygon-pattern-file: url('symbols/scrub.png'); + polygon-pattern-file: url('symbols/scrub_trans.png'); + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + + [feature = 'wetland_swamp'][zoom >= 8] { + polygon-fill: @forest; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'wetland_bog'], + [feature = 'wetland_string_bog'] { + [zoom >= 10] { + polygon-fill: @heath; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + + [feature = 'wetland_wet_meadow'], + [feature = 'wetland_marsh'] { + [zoom >= 10] { + polygon-fill: @grass; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + + [feature = 'amenity_hospital'], + [feature = 'amenity_university'], + [feature = 'amenity_college'], + [feature = 'amenity_school'], + [feature = 'amenity_kindergarten'] { + [zoom >= 10] { + polygon-fill: @residential; + [zoom >= 12] { + polygon-fill: @educational_areas_and_hospital; + [zoom >= 13] { + line-width: 0.3; + line-color: brown; + } + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + + [feature = 'amenity_parking'][zoom >= 10], + [feature = 'amenity_bicycle_parking'][zoom >= 10], + [feature = 'amenity_motorcycle_parking'][zoom >= 10] { + polygon-fill: @parking; + [zoom >= 15] { + line-width: 0.3; + line-color: saturate(darken(@parking, 40%), 20%); + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'aeroway_apron'][zoom >= 10] { + polygon-fill: @apron; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'aeroway_aerodrome'][zoom >= 10] { + polygon-fill: @aerodrome; + line-width: 0.2; + line-color: saturate(darken(@aerodrome, 40%), 20%); + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'natural_beach'][zoom >= 10], + [feature = 'natural_shoal'][zoom >= 10] { + polygon-fill: @beach; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'highway_services'], + [feature = 'highway_rest_area'] { + [zoom >= 10] { + polygon-fill: @rest_area; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + + [feature = 'railway_station'][zoom >= 10] { + polygon-fill: @station; + } + + [feature = 'leisure_sports_centre'], + [feature = 'leisure_stadium'] { + [zoom >= 10] { + polygon-fill: @stadium; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + } + + [feature = 'leisure_track'][zoom >= 10] { + polygon-fill: @track; + [zoom >= 15] { + line-width: 0.5; + line-color: saturate(darken(@track, 40%), 20%); + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + + [feature = 'leisure_pitch'][zoom >= 10] { + polygon-fill: @pitch; + [zoom >= 15] { + line-width: 0.5; + line-color: saturate(darken(@pitch, 40%), 20%); + } + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } +} + +/* man_made=cutline */ +#landcover-line { + [zoom >= 14] { + line-width: 3; + line-join: round; + line-cap: square; + line-color: @grass; + [zoom >= 16] { + line-width: 6; + [zoom >= 18] { + line-width: 12; + } + } + } +} + +#landcover-area-symbols { + [int_wetland != null][zoom >= 10] { + polygon-pattern-file: url('symbols/wetland.png'); + polygon-pattern-alignment: global; + } + [natural = 'reef'][zoom >= 10] { + polygon-pattern-file: url('symbols/reef.png'); + polygon-pattern-alignment: global; + } + [zoom >= 14] { + [int_wetland = 'marsh'], + [int_wetland = 'saltmarsh'], + [int_wetland = 'wet_meadow'], + [int_wetland = 'fen'] { + polygon-pattern-file: url('symbols/wetland_marsh.png'); + polygon-pattern-alignment: global; + } + [int_wetland = 'reedbed'] { + polygon-pattern-file: url('symbols/wetland_reed.png'); + polygon-pattern-alignment: global; + } + [int_wetland = 'mangrove'] { + polygon-pattern-file: url('symbols/wetland_mangrove.png'); + polygon-pattern-alignment: global; + } + [int_wetland = 'swamp'] { + polygon-pattern-file: url('symbols/wetland_swamp.png'); + polygon-pattern-alignment: global; + } + [int_wetland = 'bog'], + [int_wetland = 'string_bog'] { + polygon-pattern-file: url('symbols/wetland_bog.png'); + polygon-pattern-alignment: global; + } + [natural = 'beach'], + [natural = 'shoal'] { + [surface = 'sand'] { + polygon-pattern-file: url('symbols/beach.png'); + polygon-pattern-alignment: global; + } + [surface = 'gravel'], + [surface = 'fine_gravel'], + [surface = 'pebbles'], + [surface = 'pebblestone'], + [surface = 'shingle'], + [surface = 'stones'], + [surface = 'shells'] { + polygon-pattern-file: url('symbols/beach_coarse.png'); + polygon-pattern-alignment: global; + } + } + } + //Also landuse = forest, converted in the SQL + [natural = 'wood'][zoom >= 13]::wood { + // polygon-pattern-file: url('symbols/forest.png'); // Lch(55,30,135) + polygon-pattern-file: url('symbols/forest_trans.png'); + polygon-pattern-alignment: global; + // opacity: 0.4; // The entire layer has opacity to handle overlapping forests + } +} + +#landuse-overlay { + [landuse = 'military'][zoom >= 7][way_pixels > 900], + [landuse = 'military'][zoom >= 8][way_pixels > 100], + [landuse = 'military'][zoom >= 10][way_pixels > 75] { + polygon-pattern-file: url('symbols/military_red_hatch.png'); + polygon-pattern-alignment: global; + line-color: @military; + line-width: 3; + line-opacity: 0.329; + } +} + +#cliffs { + [natural = 'cliff'][zoom >= 13] { + // line-pattern-file: url('symbols/cliff.png'); + line-pattern-file: url('symbols/cliff_mdione.png'); + [zoom >= 15] { + // line-pattern-file: url('symbols/cliff2.png'); + line-pattern-file: url('symbols/cliff2_mdione.png'); + } + } + [man_made = 'embankment'][zoom >= 15]::man_made { + line-pattern-file: url('symbols/embankment.png'); + } +} + +#area-barriers { + [zoom >= 16] { + line-color: #444; + line-width: 0.4; + [barrier = 'hedge'] { + polygon-fill: #aed1a0; + } + } +} + +.barriers { + [zoom >= 16] { + line-width: 0.4; + line-color: #444; + } + [barrier = 'embankment'][zoom >= 14] { + line-width: 0.4; + line-color: #444; + } + [barrier = 'hedge'][zoom >= 16] { + line-width: 3; + line-color: #aed1a0; + } +} + +#tourism-boundary { + [tourism = 'zoo'][zoom >= 10][way_pixels >= 20], + [tourism = 'theme_park'][zoom >= 10][way_pixels >= 20] { + a/line-width: 1; + a/line-offset: -0.5; + a/line-color: @tourism; + a/line-opacity: 0.5; + a/line-join: round; + a/line-cap: round; + [zoom >= 17], + [way_pixels >= 60] { + b/line-width: 4; + b/line-offset: -2; + b/line-color: @tourism; + b/line-opacity: 0.3; + b/line-join: round; + b/line-cap: round; + } + [zoom >= 17] { + a/line-width: 2; + a/line-offset: -1; + b/line-width: 6; + b/line-offset: -3; + } + } +} + +#text-line { + [feature = 'natural_cliff'][zoom >= 15], + [feature = 'man_made_embankment'][zoom >= 15] { + text-name: "[name]"; + text-halo-radius: 1; + text-halo-fill: rgba(255,255,255,0.6); + text-fill: #999; + text-size: 10; + text-face-name: @book-fonts; + text-placement: line; + text-dy: 8; + text-vertical-alignment: middle; + text-spacing: 400; + } +} diff --git a/osm-carto/.pc/ridges_valleys.diff/project.yaml b/osm-carto/.pc/ridges_valleys.diff/project.yaml new file mode 100644 index 0000000..dbcc102 --- /dev/null +++ b/osm-carto/.pc/ridges_valleys.diff/project.yaml @@ -0,0 +1,2568 @@ +scale: 1 +metatile: 2 +name: "OpenStreetMap Carto" +description: "A general-purpose OpenStreetMap mapnik style, in CartoCSS" +bounds: &world + - -180 + - -85.05112877980659 + - 180 + - 85.05112877980659 +center: + - 5.5 + - 43.25 + - 12 +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" + - "citywalls.mss" + - "placenames.mss" + - "buildings.mss" + - "stations.mss" + - "amenity-points.mss" + - "ferry-routes.mss" + - "aerialways.mss" + - "admin.mss" + - "addressing.mss" +Layer: + - id: "ocean-lz" + name: "ocean-lz" + class: "ocean" + geometry: "polygon" + <<: *extents + Datasource: + file: "data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp" + type: "shape" + advanced: {} + properties: + maxzoom: 9 + - id: "ocean" + name: "ocean" + class: "ocean" + geometry: "polygon" + <<: *extents + Datasource: + file: "data/water-polygons-split-3857/water_polygons.shp" + type: "shape" + properties: + minzoom: 10 + advanced: {} + - id: "terrain-small" + name: "terrain-small" + class: "terrain" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-terrain-small.tif" + type: "gdal" + advanced: {} + properties: + maxzoom: 6 + - id: "terrain-medium" + name: "terrain-medium" + class: "terrain" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-terrain-medium.tif" + type: "gdal" + advanced: {} + properties: + minzoom: 7 + maxzoom: 8 + - id: "terrain-big" + name: "terrain-big" + class: "terrain" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-terrain.vrt" + type: "gdal" + advanced: {} + properties: + minzoom: 8 + - 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: 6 + 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(wetland, landuse, "natural") AS feature + FROM (SELECT + way, COALESCE(name, '') AS name, + ('landuse_' || (CASE WHEN landuse IN ('forest', 'military') 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", + ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE wetland END) ELSE NULL END)) AS wetland, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE (landuse IN ('forest', 'military') + OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock')) + AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real + AND building IS NULL + ORDER BY CASE WHEN layer~E'^-?\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END, 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, wetland, power, landuse, leisure, military, "natural", 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', 'bicycle_parking', 'motorcycle_parking', 'university', 'college', 'school', + 'hospital', 'kindergarten', 'grave_yard', 'prison', 'place_of_worship', 'clinic') + 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', 'greenhouse_horticulture', + 'recreation_ground', 'village_green', 'retail', 'industrial', 'railway', 'commercial', + 'brownfield', 'landfill') 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', 'shoal', 'heath', 'grassland', 'wood', 'sand', 'scree', 'shingle', 'bare_rock', 'scrub') THEN "natural" ELSE NULL END)) AS "natural", + ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'marsh', 'mud') THEN (CASE WHEN "natural" IN ('marsh', 'mud') THEN "natural" ELSE 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 ('attraction', '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') THEN religion ELSE 'INT-generic'::text END AS religion, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) 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', 'bicycle_parking', 'motorcycle_parking', 'university', 'college', 'school', 'hospital', 'kindergarten', + 'grave_yard', 'place_of_worship', 'prison', 'clinic') + OR military IN ('danger_area') + OR "natural" IN ('beach', 'shoal', 'heath', 'mud', 'marsh', 'wetland', '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') + OR highway IN ('services', 'rest_area') + OR railway = 'station') + AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real + ORDER BY CASE WHEN layer~E'^-?\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END, 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: "shade-small" + name: "shade-small" + class: "shade-over" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-hillshade-small.tif" + type: "gdal" + advanced: {} + properties: + maxzoom: 6 + - id: "shade-medium-over" + name: "shade-medium-over" + class: "shade-over" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-hillshade-medium.tif" + type: "gdal" + advanced: {} + properties: + minzoom: 7 + maxzoom: 7 + - id: "shade-medium-overlay" + name: "shade-medium-overlay" + class: "shade-overlay" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-hillshade-medium.tif" + type: "gdal" + advanced: {} + properties: + minzoom: 8 + maxzoom: 10 + - id: "shade-big" + name: "shade-big" + class: "shade-overlay" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-hillshade.vrt" + type: "gdal" + advanced: {} + properties: + minzoom: 9 + - id: "slope-small" + name: "slope-small" + class: "slope-over" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-slopeshade-small.tif" + type: "gdal" + advanced: {} + properties: + maxzoom: 6 + - id: "slope-medium-over" + name: "slope-medium-over" + class: "slope-over" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-slopeshade-medium.tif" + type: "gdal" + advanced: {} + properties: + minzoom: 7 + maxzoom: 7 + - id: "slope-medium-overlay" + name: "slope-medium-overlay" + class: "slope-overlay" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-slopeshade-medium.tif" + type: "gdal" + advanced: {} + properties: + minzoom: 8 + maxzoom: 8 + - id: "slope-big" + name: "slope-big" + class: "slope-overlay" + geometry: "raster" + <<: *extents84 + Datasource: + file: "data/height/mixed-slopeshade.vrt" + type: "gdal" + advanced: {} + properties: + minzoom: 9 + - id: "contour-50" + name: "contour-50" + class: "" + geometry: "linestring" + <<: *extents84 + Datasource: + <<: *osm2pgsql + table: |- + (SELECT height, way + FROM contours + WHERE height::int%100 = 50 + ) as c50 + advanced: {} + - id: "contour-100" + name: "contour-100" + class: "" + geometry: "linestring" + <<: *extents84 + Datasource: + <<: *osm2pgsql + table: |- + (SELECT height, way + FROM contours + WHERE height::int%1000 in (100, 200, 300, 400, 600, 700, 800, 900) + ) as c100 + advanced: {} + - id: "contour-250" + name: "contour-250" + class: "" + geometry: "linestring" + <<: *extents84 + Datasource: + <<: *osm2pgsql + table: |- + (SELECT height, way + FROM contours + WHERE height::int%1000 in (250, 750) + ) as c250 + advanced: {} + - id: "contour-500" + name: "contour-500" + class: "" + geometry: "linestring" + <<: *extents84 + Datasource: + <<: *osm2pgsql + table: |- + (SELECT height, way + FROM contours + WHERE height::int%1000 = 500 + ) as c500 + advanced: {} + - id: "contour-1000" + name: "contour-1000" + class: "" + geometry: "linestring" + <<: *extents84 + Datasource: + <<: *osm2pgsql + table: |- + (SELECT height, way + FROM contours + WHERE height::int%1000 = 0 + ) as c1000 + advanced: {} + - 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', 'river') + ) AS water_lines_casing + properties: + minzoom: 6 + advanced: {} + - id: "water-lines-low-zoom" + name: "water-lines-low-zoom" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, waterway, intermittent + FROM planet_osm_line + WHERE waterway = 'river' + ) AS water_lines_low_zoom + properties: + minzoom: 8 + maxzoom: 11 + advanced: {} + - id: "icesheet-poly" + name: "icesheet-poly" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + file: "data/antarctica-icesheet-polygons-3857/icesheet_polygons.shp" + type: "shape" + properties: + minzoom: 4 + advanced: {} + - id: "water-areas" + name: "water-areas" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + "natural", + waterway, + landuse, + name, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE + (waterway IN ('dock', 'riverbank', 'canal') + OR landuse IN ('reservoir', 'basin') + OR "natural" IN ('water', 'glacier')) + AND building IS NULL + AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real + ORDER BY z_order, way_area DESC + ) AS water_areas + properties: + minzoom: 4 + advanced: {} + - id: "landcover-area-symbols" + name: "landcover-area-symbols" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, surface, + COALESCE(CASE WHEN landuse = 'forest' THEN 'wood' ELSE NULL END, "natural") AS "natural", + CASE WHEN "natural" IN ('marsh', 'mud') + THEN "natural" + ELSE CASE WHEN ("natural" = 'wetland' AND wetland IS NULL) + THEN 'wetland' + ELSE CASE WHEN ("natural" = 'wetland') + THEN wetland + ELSE NULL + END + END + END AS int_wetland + FROM planet_osm_polygon + WHERE ("natural" IN ('marsh', 'mud', 'wetland', 'wood', 'beach', 'shoal', 'reef') OR landuse = 'forest') + AND building IS NULL + AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real + ORDER BY z_order, way_area DESC + ) AS landcover_area_symbols + properties: + minzoom: 10 + advanced: {} + - id: "icesheet-outlines" + name: "icesheet-outlines" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + file: "data/antarctica-icesheet-outlines-3857/icesheet_outlines.shp" + type: "shape" + properties: + minzoom: 4 + advanced: {} + - id: "water-lines" + name: "water-lines" + class: "water-lines" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, waterway, 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 ('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: "water-barriers-line" + name: "water-barriers-line" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, waterway, name + FROM planet_osm_line + WHERE waterway IN ('dam', 'weir', 'lock_gate') + ) AS water_barriers_line + advanced: {} + properties: + minzoom: 13 + - id: "water-barriers-poly" + name: "water-barriers-poly" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, waterway, name + FROM planet_osm_polygon + WHERE waterway IN ('dam', 'weir', 'lock_gate') + ) AS water_barriers_poly + advanced: {} + properties: + minzoom: 13 + - 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: "nature-reserve-boundaries" + name: "nature-reserve-boundaries" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name, + boundary, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE (boundary = 'national_park' OR leisure = 'nature_reserve') + AND building IS NULL + AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real + ) AS national_park_boundaries + properties: + minzoom: 7 + advanced: {} + - id: "piers-poly" + name: "piers-poly" + class: "" + 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 + advanced: {} + - id: "piers-line" + name: "piers-line" + class: "" + 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 + advanced: {} + - id: "water-barriers-point" + name: "water-barriers-point" + class: "" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, waterway + FROM planet_osm_point + WHERE waterway IN ('dam', 'weir', 'lock_gate') + ) AS water_barriers_points + properties: + minzoom: 17 + advanced: {} + - id: "bridge" + name: "bridge" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, + man_made, + name + FROM planet_osm_polygon + WHERE man_made = 'bridge' + ) AS bridge + properties: + minzoom: 12 + 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' + AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real + ORDER BY z_order, way_area DESC + ) AS buildings + properties: + minzoom: 13 + 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') + AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real + ORDER BY z_order, way_area DESC) + AS buildings_major + properties: + minzoom: 13 + advanced: {} + - id: "tunnels" + name: "tunnels" + class: "tunnels-fill tunnels-casing access directions" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + # This query is quite large, having to deal with both roads, railways and + # runways. To allow for ways that are both railways and roads, a UNION + # ALL is present, and to use an ordering different than current osm2pgsql + # an order is generated in SQL. + table: |- + (SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, + horse, foot, bicycle, tracktype, int_surface, access, + service, oneway, 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') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') 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, + 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 + WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes' + 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 + WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') + AND highway IS NOT NULL -- end of road select + UNION ALL + SELECT + way, + 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' + WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)), + ('aeroway_' || aeroway) + ) 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, + 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 + WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') + AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select + ) AS features + JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results. + ('railway_rail', 440), + ('railway_INT-preserved-ssy', 430), + ('railway_INT-spur-siding-yard', 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_tram-service', 405), + ('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), + ('railway_platform', 90), + ('aeroway_runway', 60), + ('aeroway_taxiway', 50) + ) AS ordertable (feature, prio) + USING (feature) + ORDER BY + layernotnull, + prio, + 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 + properties: + group-by: "layernotnull" + minzoom: 9 + advanced: {} + - id: "citywalls" + name: "citywalls" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way + FROM planet_osm_line + WHERE historic = 'citywalls') + AS citywalls + advanced: {} + properties: + minzoom: 14 + - id: "landuse-overlay" + name: "landuse-overlay" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + landuse, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE landuse = 'military' + AND building IS NULL + ) AS landuse_overlay + properties: + minzoom: 7 + advanced: {} + - id: "line-barriers" + name: "line-barriers" + class: "barriers" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, barrier + FROM planet_osm_line + WHERE barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', + 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') + AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')) + ) AS line_barriers + properties: + minzoom: 14 + 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: "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 way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, + horse, foot, bicycle, tracktype, int_surface, access, + service, oneway, 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') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') 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, + 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 + WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes' + 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 + 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, + 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' + WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)), + ('aeroway_' || aeroway) + ) 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, + 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 + 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 (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select + ) AS features + JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results. + ('railway_rail', 440), + ('railway_INT-preserved-ssy', 430), + ('railway_INT-spur-siding-yard', 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_tram-service', 405), + ('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), + ('railway_platform', 90), + ('aeroway_runway', 60), + ('aeroway_taxiway', 50) + ) AS ordertable (feature, prio) + USING (feature) + ORDER BY + layernotnull, + prio, + 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 roads_casing + properties: + minzoom: 9 + 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 + # This is one of the most complex layers, so it bears explaining in some detail + # It is necessary to + # - Have roads and railways in the same layer to get ordering right + # - Return two linestrings for ways which are both a road and railway + # - Compute z_order here, rather than rely on osm2pgsql z_order + table: |- + (SELECT + way, + (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, + horse, + foot, + bicycle, + tracktype, + int_surface, + access, + service, + oneway, + link, + layernotnull + FROM ( -- begin "features" 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') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') 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, + 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 + WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes' + 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 + 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, + 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' + WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)), + ('aeroway_' || aeroway) + ) AS feature, + horse, + foot, + bicycle, + tracktype, + 'null' AS surface, -- Should be a SQL NULL? + CASE + WHEN access IN ('destination') THEN 'destination'::text + WHEN access IN ('no', 'private') THEN 'no'::text + ELSE NULL + END AS access, + 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 + 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 (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select + ) AS features + JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results. + ('railway_rail', 440), + ('railway_INT-preserved-ssy', 430), + ('railway_INT-spur-siding-yard', 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_tram-service', 405), + ('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), + ('railway_platform', 90), + ('aeroway_runway', 60), + ('aeroway_taxiway', 50) + ) AS ordertable (feature, prio) + USING (feature) + ORDER BY + layernotnull, + prio, + 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 roads_fill + properties: + minzoom: 10 + advanced: {} + - id: "pistes" + name: "pistes" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, + ('piste_' || "piste:type") AS feature, + "piste:difficulty" AS grade, + name + FROM planet_osm_line + WHERE + "piste:type" IN ('downhill') + ) AS pistes + 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), + ('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_fill + properties: + minzoom: 15 + advanced: {} + - id: "aerialways" + name: "aerialways" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (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: |- + (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, + CASE WHEN tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes' THEN 'yes' ELSE 'no' END AS int_tunnel, + CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes' ELSE 'no' END AS link, + CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', + 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' + ELSE NULL + END AS int_surface + 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: 9 + advanced: {} + - id: "waterway-bridges" + name: "waterway-bridges" + class: "water-lines" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (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" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, + horse, foot, bicycle, tracktype, int_surface, access, + service, oneway, 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') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') 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, + 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 + WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes' + 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 + WHERE 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, + 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' + WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)), + ('aeroway_' || aeroway) + ) 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, + 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 + WHERE bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct') + AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select + ) AS features + JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results. + ('railway_rail', 440), + ('railway_INT-preserved-ssy', 430), + ('railway_INT-spur-siding-yard', 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_tram-service', 405), + ('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), + ('railway_platform', 90), + ('aeroway_runway', 60), + ('aeroway_taxiway', 50) + ) AS ordertable (feature, prio) + USING (feature) + ORDER BY + layernotnull, + prio, + 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 bridges + properties: + group-by: "layernotnull" + minzoom: 9 + advanced: {} + - id: "guideways" + name: "guideways" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way + FROM planet_osm_line + WHERE highway = 'bus_guideway' + ) AS guideways + properties: + minzoom: 13 + advanced: {} + - name: "admin-low-zoom" + id: "admin-low-zoom" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + admin_level + FROM planet_osm_roads + WHERE boundary = 'administrative' + AND admin_level IN ('2', '3') + AND osm_id < 0 + ORDER BY admin_level DESC + ) AS admin_low_zoom + advanced: {} + - id: "tourism-boundary" + name: "tourism-boundary" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, + name, + tourism + FROM planet_osm_polygon + WHERE tourism = 'theme_park' + OR tourism = 'zoo' + ) AS tourism_boundary + properties: + minzoom: 10 + advanced: {} + - id: "placenames-large" + name: "placenames-large" + class: "country state" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, + name, + ref, + admin_level + FROM planet_osm_polygon + WHERE boundary = 'administrative' + AND admin_level IN ('2', '4') + AND name IS NOT NULL + AND way_area > 750*!pixel_width!::real*!pixel_height!::real -- only labels for larger areas are displayed + ORDER BY admin_level ASC, way_area DESC + ) AS placenames_large + properties: + minzoom: 2 + advanced: {} + - id: "placenames-medium" + name: "placenames-medium" + class: "" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name, + score, + CASE + WHEN (place = 'city' OR (capital = 'yes' AND score >= 100000)) THEN 1 + ELSE 2 + END as category + FROM + (SELECT + way, + place, + name, + capital, + ( + (CASE + WHEN (population ~ '^[0-9]{1,8}$') THEN population::INTEGER + WHEN (place = 'city') THEN 100000 + WHEN (place = 'town') THEN 1000 + ELSE 1 + END) + * + (CASE + WHEN (capital = 'yes') THEN 3 + WHEN (capital = '4') THEN 2 + ELSE 1 + END) + ) AS score + FROM planet_osm_point + WHERE place IN ('city', 'town') + AND name IS NOT NULL + ) as p + ORDER BY score DESC, length(name) DESC, name + ) AS placenames_medium + properties: + minzoom: 4 + maxzoom: 15 + advanced: {} + - id: "placenames-small" + name: "placenames-small" + class: "" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + place, + name + FROM planet_osm_point + WHERE place IN ('suburb', 'village', 'hamlet', 'neighbourhood', 'locality', 'isolated_dwelling', 'farm') + AND name IS NOT NULL + ORDER BY CASE + WHEN place = 'suburb' THEN 3 + WHEN place = 'village' THEN 4 + WHEN place = 'hamlet' THEN 5 + WHEN place = 'neighbourhood' THEN 6 + WHEN place = 'locality' THEN 7 + WHEN place = 'isolated_dwelling' THEN 8 + WHEN place = 'farm' THEN 9 + END ASC, length(name) DESC, name + ) AS placenames_small + properties: + minzoom: 12 + advanced: {} + - id: "stations" + class: "stations" + name: "stations" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name, + railway, + aerialway, + CASE railway + WHEN 'station' THEN 1 + WHEN 'subway_entrance' THEN 3 + ELSE 2 + END + AS prio + FROM planet_osm_point + WHERE railway IN ('station', 'halt', 'tram_stop', 'subway_entrance') + OR aerialway = 'station' + ORDER BY prio + ) AS stations + properties: + minzoom: 12 + advanced: {} + - id: "stations-poly" + name: "stations-poly" + class: "stations" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name, + railway, + aerialway + FROM planet_osm_polygon + WHERE railway IN ('station', 'halt', 'tram_stop') + OR aerialway = 'station' + ) AS stations_poly + properties: + minzoom: 12 + advanced: {} + - id: "amenity-points-poly" + name: "amenity-points-poly" + class: "points" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + COALESCE( + 'aeroway_' || CASE WHEN aeroway IN ('helipad', 'aerodrome') THEN aeroway ELSE NULL END, + 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'guest_house', + 'hostel', 'hotel', 'motel', 'information', 'museum', 'picnic_site') THEN tourism ELSE NULL END, + 'amenity_' || CASE WHEN amenity IN ('shelter', 'atm', 'bank', 'bar', 'bicycle_rental', 'bus_station', 'cafe', + 'car_rental', 'car_wash', 'cinema', 'clinic', 'community_centre', 'fire_station', 'fountain', + 'fuel', 'hospital', 'ice_cream', 'embassy', 'library', 'courthouse', 'townhall', 'parking', + 'bicycle_parking', 'motorcycle_parking', 'pharmacy', 'doctors', 'dentist', 'place_of_worship', + 'police', 'post_box', 'post_office', 'pub', 'biergarten', 'recycling', 'restaurant', 'food_court', + 'fast_food', 'telephone', 'emergency_phone', 'taxi', 'theatre', 'toilets', 'drinking_water', + 'prison', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility') THEN amenity ELSE NULL END, + 'shop_' || CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'books', 'butcher', 'clothes', 'computer', + 'confectionery', 'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist', + 'garden_centre', 'hairdresser', 'hifi', 'ice_cream', 'car', 'car_repair', 'bicycle', 'mall', 'pet', + 'photo', 'photo_studio', 'photography', 'seafood', 'shoes', 'alcohol', 'gift', 'furniture', 'kiosk', + 'mobile_phone', 'motorcycle', 'musical_instrument', 'newsagent', 'optician', 'jewelry', 'jewellery', + 'electronics', 'chemist', 'toys', 'travel_agency', 'car_parts', 'greengrocer', 'farm', 'stationery', + 'laundry', 'dry_cleaning', 'beverages', 'perfumery', 'cosmetics', 'variety_store', 'wine', 'outdoor', + 'copyshop', 'sports') THEN shop + WHEN shop IN ('accessories', 'antiques', 'appliance', 'art', 'baby_goods', 'bathroom_furnishing', + 'bed', 'boat', 'bookmaker', 'boutique', 'builder', 'building_materials', 'camera', 'car_service', + 'carpet', 'charity', 'cheese', 'chocolate', 'coffee', 'communication', 'craft', 'curtain', 'dairy', + 'deli', 'discount', 'e-cigarette', 'electrical', 'energy', 'erotic', 'estate_agent', + 'fabric', 'fishing', 'flooring', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', + 'gallery', 'games', 'gas', 'general', 'glaziery', 'grocery', 'health', 'health_food', 'hearing_aids', + 'herbalist', 'hobby', 'household', 'houseware', 'hunting', 'interior_decoration', 'kitchen', + 'leather', 'lighting', 'locksmith', 'lottery', 'market', 'massage', 'medical', 'medical_supply', 'money_lender', + 'motorcycle_repair', 'music', 'office_supplies', 'organic', 'paint', 'pastry', 'pawnbroker', + 'phone', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', + 'scuba_diving', 'second_hand', 'sewing', 'shoe_repair', 'shopping_centre', 'solarium', 'souvenir', + 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'trade', 'tyres', 'vacuum_cleaner', 'video', + 'video_games', 'watches', 'wholesale', 'yes') THEN 'other' ELSE NULL END, + 'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table') THEN leisure ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') THEN man_made ELSE NULL END, + 'natural_' || CASE WHEN "natural" IN ('spring') THEN "natural" ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') THEN historic ELSE NULL END, + 'highway_'|| CASE WHEN highway IN ('bus_stop', 'elevator', 'traffic_signals') THEN highway ELSE NULL END, + 'power_' || CASE WHEN power IN ('generator') THEN power ELSE NULL END, + 'tourism_' || CASE WHEN tourism IN ('viewpoint') THEN tourism ELSE NULL END + ) AS feature, + access, + religion, + denomination, + "generator:source", + power_source, + castle_type, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering + WHERE aeroway IN ('helipad', 'aerodrome') + OR tourism IN ('alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'guest_house', 'hostel', + 'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site') + OR amenity IN ('shelter', 'atm', 'bank', 'bar', 'bicycle_rental', 'bus_station', 'cafe', + 'car_rental', 'car_wash', 'cinema', 'clinic', 'community_centre', + 'fire_station', 'fountain', 'fuel', 'hospital', 'ice_cream', 'embassy', 'library', 'courthouse', + 'townhall', 'parking', 'bicycle_parking', 'motorcycle_parking', 'pharmacy', 'doctors', + 'dentist', 'place_of_worship', 'police', 'post_box', 'post_office', 'pub', 'biergarten', + 'recycling', 'restaurant', 'food_court', 'fast_food', 'telephone', 'emergency_phone', 'taxi', + 'theatre', 'toilets', 'drinking_water', 'prison', 'hunting_stand', 'nightclub', 'veterinary', + 'social_facility') + OR shop IS NOT NULL -- skip checking a huge list and use a null check + OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table') + OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') + OR "natural" IN ('spring') + OR historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') + OR highway IN ('bus_stop', 'elevator', 'traffic_signals') + OR (power = 'generator' AND ("generator:source" = 'wind' OR power_source = 'wind')) + ORDER BY way_area desc + ) AS amenity_points_poly + properties: + minzoom: 10 + advanced: {} + - id: "amenity-points" + name: "amenity-points" + class: "points" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + COALESCE( + 'aeroway_' || CASE WHEN aeroway IN ('helipad', 'aerodrome') THEN aeroway ELSE NULL END, + 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'guest_house', 'hostel', + 'hotel', 'motel', 'information', 'museum', 'picnic_site') THEN tourism ELSE NULL END, + 'amenity_' || CASE WHEN amenity IN ('shelter', 'atm', 'bank', 'bar', 'bicycle_rental', 'bus_station', 'cafe', + 'car_rental', 'car_wash', 'cinema', 'clinic', 'community_centre', 'fire_station', 'fountain', + 'fuel', 'hospital', 'ice_cream', 'embassy', 'library', 'courthouse', 'townhall', 'parking', + 'bicycle_parking', 'motorcycle_parking', 'pharmacy', 'doctors', 'dentist', 'place_of_worship', + 'police', 'post_box', 'post_office', 'pub', 'biergarten', 'recycling', 'restaurant', 'food_court', + 'fast_food', 'telephone', 'emergency_phone', 'taxi', 'theatre', 'toilets', 'drinking_water', + 'prison', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility') THEN amenity ELSE NULL END, + 'shop_' || CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'books', 'butcher', 'clothes', 'computer', 'confectionery', + 'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist', 'garden_centre', + 'hairdresser', 'hifi', 'ice_cream', 'car', 'car_repair', 'bicycle', 'mall', 'pet', 'photo', 'photo_studio', + 'photography', 'seafood', 'shoes', 'alcohol', 'gift', 'furniture', 'kiosk', 'mobile_phone', 'motorcycle', + 'musical_instrument', 'newsagent', 'optician', 'jewelry', 'jewellery', 'electronics', 'chemist', 'toys', + 'travel_agency', 'car_parts', 'greengrocer', 'farm', 'stationery', 'laundry', 'dry_cleaning', 'beverages', + 'perfumery', 'cosmetics', 'variety_store', 'wine', 'outdoor', 'copyshop', 'sports') THEN shop + WHEN shop IN ('accessories', 'antiques', 'appliance', 'art', 'baby_goods', 'bathroom_furnishing', 'bed', + 'boat', 'bookmaker', 'boutique', 'builder', 'building_materials', 'camera', 'car_service', 'carpet', 'charity', + 'cheese', 'chocolate', 'coffee', 'communication', 'craft', 'curtain', 'dairy', 'deli', + 'discount', 'e-cigarette', 'electrical', 'energy', 'erotic', 'estate_agent', 'fabric', 'fishing', + 'flooring', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'gallery', 'games', 'gas', + 'general', 'glaziery', 'grocery', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hobby', 'household', + 'houseware', 'hunting', 'interior_decoration', 'kitchen', 'leather', 'lighting', 'locksmith', 'lottery', + 'market', 'massage', 'medical', 'medical_supply', 'money_lender', 'motorcycle_repair', 'music', 'office_supplies', + 'organic', 'paint', 'pastry', 'pawnbroker', 'phone', 'pottery', 'printing', 'radiotechnics', + 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'second_hand', 'sewing', 'shoe_repair', 'shopping_centre', + 'solarium', 'souvenir', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'trade', 'tyres', + 'vacuum_cleaner', 'video', 'video_games', 'watches', 'wholesale', 'yes') THEN 'other' ELSE NULL END, + 'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway') THEN leisure ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') THEN man_made ELSE NULL END, + 'natural_' || CASE WHEN "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance') THEN "natural" ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') THEN historic ELSE NULL END, + 'highway_'|| CASE WHEN highway IN ('bus_stop', 'elevator', 'traffic_signals', 'ford') THEN highway ELSE NULL END, + 'power_' || CASE WHEN power IN ('generator') THEN power ELSE NULL END, + 'tourism_' || CASE WHEN tourism IN ('viewpoint') THEN tourism ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('cross') THEN man_made ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('wayside_cross') THEN historic ELSE NULL END + ) AS feature, + access, + CASE + WHEN "natural" IN ('peak', 'volcano', 'saddle') THEN + CASE + WHEN ele ~ '^-?\d{1,4}(\.\d+)?$' THEN ele::NUMERIC + ELSE NULL + END + ELSE NULL + END AS score, + religion, + denomination, + "generator:source", + power_source, + castle_type, + NULL AS way_pixels + FROM planet_osm_point + -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering + WHERE aeroway IN ('helipad', 'aerodrome') + OR tourism IN ('alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'guest_house', 'hostel', + 'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site') + OR amenity IN ('shelter', 'atm', 'bank', 'bar', 'bicycle_rental', 'bus_station', 'cafe', + 'car_rental', 'car_wash', 'cinema', 'clinic', 'community_centre', + 'fire_station', 'fountain', 'fuel', 'hospital', 'ice_cream', 'embassy', 'library', 'courthouse', + 'townhall', 'parking', 'bicycle_parking', 'motorcycle_parking', 'pharmacy', 'doctors', + 'dentist', 'place_of_worship', 'police', 'post_box', 'post_office', 'pub', 'biergarten', + 'recycling', 'restaurant', 'food_court', 'fast_food', 'telephone', 'emergency_phone', + 'taxi', 'theatre', 'toilets', 'drinking_water', 'prison', 'hunting_stand', 'nightclub', + 'veterinary', 'social_facility') + OR shop IS NOT NULL -- skip checking a huge list and use a null check + OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway') + OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'cross') + OR "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance') + OR historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort', 'wayside_cross') + OR highway IN ('bus_stop', 'elevator', 'traffic_signals', 'ford') + OR (power = 'generator' AND ("generator:source" = 'wind' OR power_source = 'wind')) + ORDER BY score DESC NULLS LAST + ) AS amenity_points + properties: + minzoom: 10 + advanced: {} + - id: "roads-text-ref-low-zoom" + name: "roads-text-ref-low-zoom" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, highway, height, width, refs FROM + (SELECT + way, highway, + array_length(refs,1) AS height, + (SELECT MAX(char_length(ref)) FROM unnest(refs) AS u(ref)) AS width, + array_to_string(refs, E'\n') AS refs + FROM ( + SELECT + way, + highway, + string_to_array(ref, ';') AS refs + FROM planet_osm_roads + WHERE highway IN ('motorway', 'trunk', 'primary', 'secondary') + AND ref IS NOT NULL + ) AS p) AS q + WHERE height <= 4 AND width <= 11) AS roads_text_ref_low_zoom + properties: + minzoom: 10 + maxzoom: 12 + advanced: {} + - id: "junctions" + name: "junctions" + class: "" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + highway, + junction, + ref, + name + FROM planet_osm_point + WHERE highway = 'motorway_junction' OR highway = 'traffic_signals' OR junction = 'yes' + ) AS junctions + properties: + minzoom: 11 + advanced: {} + - id: "bridge-text" + name: "bridge-text" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, + man_made, + name + FROM planet_osm_polygon + WHERE man_made = 'bridge' + ) AS bridge_text + properties: + minzoom: 11 + advanced: {} + - id: "roads-text-ref" + name: "roads-text-ref" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, highway, height, width, refs FROM + (SELECT + way, highway, + array_length(refs,1) AS height, + (SELECT MAX(char_length(ref)) FROM unnest(refs) AS u(ref)) AS width, + array_to_string(refs, E'\n') AS refs + FROM ( + SELECT + way, + COALESCE( + CASE WHEN highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential') THEN highway ELSE NULL END, + CASE WHEN aeroway IN ('runway', 'taxiway') THEN aeroway ELSE NULL END + ) AS highway, + string_to_array(ref, ';') AS refs + FROM planet_osm_line + WHERE (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential') OR aeroway IN ('runway', 'taxiway')) + AND ref IS NOT NULL + ) AS p) AS q + WHERE height <= 4 AND width <= 11) AS roads_text_ref + properties: + minzoom: 13 + advanced: {} + - id: "roads-area-text-name" + name: "roads-area-text-name" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, + highway, + name + FROM planet_osm_polygon + WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'living_street', 'track', 'path', 'platform') + OR railway IN ('platform') + AND name IS NOT NULL + ) AS roads_area_text_name + properties: + minzoom: 15 + advanced: {} + - id: "roads-text-name" + name: "roads-text-name" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT way, + CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway END, + CASE WHEN (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') THEN 'yes' ELSE 'no' END AS tunnel, + name + FROM planet_osm_line + WHERE highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', + 'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'pedestrian', 'raceway', 'living_street') + AND name IS NOT NULL + ) AS roads_text_name + properties: + minzoom: 13 + advanced: {} + - id: "paths-text-name" + name: "paths-text-name" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + highway, + name + FROM planet_osm_line + WHERE highway IN ('bridleway', 'footway', 'cycleway', 'path', 'track', 'steps') + AND name IS NOT NULL + ) AS paths_text_name + properties: + minzoom: 15 + advanced: {} + - id: "text-poly-low-zoom" + name: "text-poly-low-zoom" + class: "text-low-zoom" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, + COALESCE( + 'landuse_' || CASE WHEN landuse IN ('forest', 'military') THEN landuse ELSE NULL END, + 'natural_' || CASE WHEN "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock') THEN "natural" ELSE NULL END, + 'place_' || CASE WHEN place IN ('island') THEN place ELSE NULL END, + 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, + 'leisure_' || CASE WHEN leisure IN ('nature_reserve') THEN leisure ELSE NULL END + ) AS feature, + name, + castle_type, + CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building -- always no with the where conditions + FROM planet_osm_polygon + WHERE (landuse IN ('forest', 'military') + OR "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock') + OR "place" IN ('island') + OR boundary IN ('national_park') + OR leisure IN ('nature_reserve')) + AND building IS NULL + AND name IS NOT NULL + ORDER BY way_area DESC + ) AS text_poly_low_zoom + properties: + minzoom: 7 + maxzoom: 9 + advanced: {} + - id: "text-poly" + name: "text-poly" + class: "text" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + # Include values that are rendered as icon without label to prevent mismatch between icons and labels, + # see https://github.com/gravitystorm/openstreetmap-carto/pull/1349#issuecomment-77805678 + table: |- + (SELECT + way, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, + COALESCE( + 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END, + 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', + 'theme_park', 'museum', 'zoo', 'information', 'picnic_site') THEN tourism ELSE NULL END, + 'amenity_' || CASE WHEN amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', + 'theatre', 'courthouse', 'townhall', 'cinema', 'clinic', 'community_centre', 'parking', + 'bicycle_parking', 'motorcycle_parking', 'police', 'fire_station', 'fountain', 'place_of_worship', + 'grave_yard', 'shelter', 'bank', 'embassy', 'fuel', 'bus_station', 'prison', 'university', + 'school', 'college', 'kindergarten', 'hospital', 'ice_cream', 'pharmacy', 'doctors', 'dentist', + 'atm', 'bicycle_rental', 'car_rental', 'car_wash', 'post_box', 'post_office', + 'recycling', 'telephone', 'emergency_phone', 'toilets', 'taxi', 'drinking_water', 'hunting_stand', + 'nightclub', 'veterinary', 'social_facility') THEN amenity ELSE NULL END, + 'shop_' || CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'books', 'butcher', 'clothes', 'computer', 'confectionery', + 'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist', 'garden_centre', + 'hairdresser', 'hifi', 'ice_cream', 'car', 'car_repair', 'bicycle', 'mall', 'pet', 'photo', 'photo_studio', + 'photography', 'seafood', 'shoes', 'alcohol', 'gift', 'furniture', 'kiosk', 'mobile_phone', 'motorcycle', + 'musical_instrument', 'newsagent', 'optician', 'jewelry', 'jewellery', 'electronics', 'chemist', 'toys', + 'travel_agency', 'car_parts', 'greengrocer', 'farm', 'stationery', 'laundry', 'dry_cleaning', 'beverages', + 'perfumery', 'cosmetics', 'variety_store', 'wine', 'outdoor', 'copyshop', 'sports') THEN shop + WHEN shop IN ('accessories', 'antiques', 'appliance', 'art', 'baby_goods', 'bathroom_furnishing', 'bed', + 'boat', 'bookmaker', 'boutique', 'builder', 'building_materials', 'camera', 'car_service', 'carpet', 'charity', + 'cheese', 'chocolate', 'coffee', 'communication', 'craft', 'curtain', 'dairy', 'deli', + 'discount', 'e-cigarette', 'electrical', 'energy', 'erotic', 'estate_agent', 'fabric', 'fishing', + 'flooring', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'gallery', 'games', 'gas', + 'general', 'glaziery', 'grocery', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hobby', 'household', + 'houseware', 'hunting', 'interior_decoration', 'kitchen', 'leather', 'lighting', 'locksmith', + 'lottery', 'market', 'massage', 'medical', 'medical_supply', 'money_lender', 'motorcycle_repair', 'music', + 'office_supplies', 'organic', 'paint', 'pastry', 'pawnbroker', 'phone', 'pottery', + 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'second_hand', + 'sewing', 'shoe_repair', 'shopping_centre', 'solarium', 'souvenir', 'tailor', 'tanning', 'tattoo', 'tea', + 'ticket', 'tiles', 'tobacco', 'trade', 'tyres', 'vacuum_cleaner', 'video', 'video_games', 'watches', 'wholesale', + 'yes') THEN 'other' ELSE NULL END, + 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', + 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', + 'picnic_table') THEN leisure ELSE NULL END, + 'power_' || CASE WHEN power IN ('plant', 'station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END, + 'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', + 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', + 'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', + 'military') THEN landuse ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne') THEN man_made ELSE NULL END, + 'natural_' || CASE WHEN "natural" IN ('wood', 'water', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath', + 'grassland', 'scrub', 'beach', 'shoal', 'reef', 'glacier') THEN "natural" ELSE NULL END, + 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END, + 'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') THEN historic ELSE NULL END, + 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator', 'ford') THEN highway ELSE NULL END, + 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, + 'waterway_' || CASE WHEN waterway IN ('dam') THEN waterway ELSE NULL END, + 'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism ELSE NULL END + ) AS feature, + access, + name, + operator, + ref, + way_area, + castle_type, + CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building + FROM planet_osm_polygon + -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering + WHERE (aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') + OR tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', + 'museum', 'viewpoint', 'attraction', 'zoo', 'information', 'picnic_site') + OR amenity IS NOT NULL -- skip checking a huge list and use a null check + OR shop IS NOT NULL + OR leisure IS NOT NULL + OR landuse IS NOT NULL + OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne') + OR "natural" IS NOT NULL + OR place IN ('island', 'islet') + OR military IN ('danger_area') + OR historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') + OR highway IN ('services', 'rest_area', 'bus_stop', 'elevator', 'ford') + OR power IN ('plant', 'station', 'generator', 'sub_station', 'substation') + OR boundary IN ('national_park') + OR waterway = 'dam') + AND name IS NOT NULL + ORDER BY way_area DESC + ) AS text_poly + properties: + minzoom: 10 + advanced: {} + - id: "text-line" + name: "text-line" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + NULL as way_pixels, + COALESCE('man_made_' || man_made, 'waterway_' || waterway, 'natural_' || "natural") AS feature, + access, + name, + operator, + ref, + NULL AS way_area, + CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building + FROM planet_osm_line + WHERE (man_made IN ('pier', 'breakwater', 'groyne', 'embankment') + OR waterway IN ('dam', 'weir') + OR "natural" IN ('cliff')) + AND name IS NOT NULL + ) AS text_line + advanced: {} + properties: + minzoom: 10 + - id: "text-point" + name: "text-point" + class: "text" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + # Include values that are rendered as icon without label to prevent mismatch between icons and labels, + # see https://github.com/gravitystorm/openstreetmap-carto/pull/1349#issuecomment-77805678 + table: |- + (SELECT + way, + way_pixels, + feature, + access, + CONCAT( + name, + CASE WHEN name IS NOT NULL AND elevation IS NOT NULL THEN E'\n' ELSE NULL END, + CASE WHEN elevation IS NOT NULL THEN CONCAT(REPLACE(ROUND(elevation)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') ELSE NULL END + ) AS name, + CASE + WHEN "natural" IN ('peak', 'volcano', 'saddle') THEN elevation + ELSE NULL + END AS score, + operator, + ref, + way_area, + castle_type, + is_building + FROM + (SELECT + way, + NULL AS way_pixels, + COALESCE( + 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END, + 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', + 'theme_park', 'museum', 'zoo', 'information', 'picnic_site') THEN tourism ELSE NULL END, + 'amenity_' || CASE WHEN amenity IN ('pub', 'restaurant', 'food_court', 'cafe', 'fast_food', 'biergarten', 'bar', 'library', 'theatre', + 'courthouse', 'townhall', 'cinema', 'clinic', 'community_centre', 'parking', 'bicycle_parking', + 'motorcycle_parking', 'police', 'fire_station', 'fountain', 'place_of_worship', 'grave_yard', 'shelter', 'bank', + 'embassy', 'fuel', 'bus_station', 'prison', 'university', 'school', 'college', 'kindergarten', 'hospital', + 'ice_cream', 'pharmacy', 'doctors', 'dentist', 'atm', 'bicycle_rental', 'car_rental', + 'car_wash', 'post_box', 'post_office', 'recycling', 'telephone', 'emergency_phone', 'toilets', 'taxi', + 'drinking_water', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility') THEN amenity ELSE NULL END, + 'shop_' || CASE WHEN shop IN ('supermarket', 'bag','bakery', 'beauty', 'books', 'butcher', 'clothes', 'computer', 'confectionery', 'fashion', + 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist', 'garden_centre', 'hairdresser', + 'hifi', 'ice_cream', 'car', 'car_repair', 'bicycle', 'mall', 'pet', 'photo', 'photo_studio', 'photography', + 'seafood', 'shoes', 'alcohol', 'gift', 'furniture', 'kiosk', 'mobile_phone', 'motorcycle', 'musical_instrument', + 'newsagent', 'optician', 'jewelry', 'jewellery', 'electronics', 'chemist', 'toys', 'travel_agency', 'car_parts', + 'greengrocer', 'farm', 'stationery', 'laundry', 'dry_cleaning', 'beverages', 'perfumery', 'cosmetics', + 'variety_store', 'wine', 'outdoor', 'copyshop', 'sports') THEN shop + WHEN shop IN ('accessories', 'antiques', 'appliance', 'art', + 'baby_goods', 'bathroom_furnishing', 'bed', 'boat', 'bookmaker', 'boutique', 'builder', + 'building_materials', 'camera', 'car_service', 'carpet', 'charity', 'cheese', 'chocolate', 'coffee', + 'communication', 'craft', 'curtain', 'dairy', 'deli', 'discount', + 'e-cigarette', 'electrical', 'energy', 'erotic', 'estate_agent', 'fabric', 'fishing', 'flooring', + 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'gallery', 'games', 'gas', + 'general', 'glaziery', 'grocery', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hobby', 'household', + 'houseware', 'hunting', 'interior_decoration', 'kitchen', 'leather', 'lighting', 'locksmith', + 'lottery', 'market', 'massage', 'medical', 'medical_supply', 'money_lender', 'motorcycle_repair', 'music', + 'office_supplies', 'organic', 'paint', 'pastry', 'pawnbroker', 'phone', 'pottery', + 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'second_hand', + 'sewing', 'shoe_repair', 'shopping_centre', 'solarium', 'souvenir', 'tailor', 'tanning', 'tattoo', + 'tea', 'ticket', 'tiles', 'tobacco', 'trade', 'tyres', 'vacuum_cleaner', 'video', 'video_games', 'watches', + 'wholesale', 'yes') THEN 'other' ELSE NULL END, + 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'sports_centre', 'stadium', 'track', + 'pitch','playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', + 'slipway', 'picnic_table') THEN leisure ELSE NULL END, + 'power_' || CASE WHEN power IN ('plant', 'station', 'generator', 'sub_station', 'substation') THEN power ELSE NULL END, + 'landuse_' || CASE WHEN landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', + 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', + 'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', + 'military') THEN landuse ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower') THEN man_made ELSE NULL END, + 'natural_' || CASE WHEN "natural" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'mud', 'wetland', 'marsh', 'bay', 'spring', + 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier', 'tree') + THEN "natural" ELSE NULL END, + 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END, + 'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') THEN historic ELSE NULL END, + 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator', 'ford') THEN highway ELSE NULL END, + 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, + 'waterway_' || CASE WHEN waterway IN ('dam', 'weir') THEN waterway ELSE NULL END, + 'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('cross') THEN man_made ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('wayside_cross') THEN historic ELSE NULL END + ) AS feature, + access, + name, + CASE + WHEN "natural" IN ('peak', 'volcano', 'saddle') OR tourism = 'alpine_hut' OR amenity = 'shelter' THEN + CASE + WHEN ele ~ '^-?\d{1,4}(\.\d+)?$' THEN ele::NUMERIC + ELSE NULL + END + ELSE NULL + END AS elevation, + "natural", + operator, + ref, + NULL AS way_area, + castle_type, + CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building + FROM planet_osm_point + -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering + WHERE (aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') + OR tourism IN ('alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'guest_house', 'camp_site', 'caravan_site', 'theme_park', + 'museum', 'viewpoint', 'attraction', 'zoo', 'information', 'picnic_site') + OR amenity IS NOT NULL -- skip checking a huge list and use a null check + OR shop IS NOT NULL + OR leisure IS NOT NULL + OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential', + 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farm', 'farmland', 'greenhouse_horticulture', + 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'military') + OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'cross') + OR "natural" IS NOT NULL + OR place IN ('island', 'islet') + OR military IN ('danger_area') + OR historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort', 'wayside_cross') + OR highway IN ('bus_stop', 'services', 'rest_area', 'elevator', 'ford') + OR power IN ('plant', 'station', 'generator', 'sub_station', 'substation') + OR boundary IN ('national_park') + OR waterway IN ('dam', 'weir')) + AND name IS NOT NULL + ) AS p + ORDER BY score DESC NULLS LAST + ) AS text + properties: + minzoom: 10 + advanced: {} + - id: "building-text" + name: "building-text" + class: "" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + name, + way, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE building IS NOT NULL + AND building NOT IN ('no') + AND name IS NOT NULL + ORDER BY way_area DESC + ) AS building_text + properties: + minzoom: 14 + advanced: {} + - id: "interpolation" + name: "interpolation" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way + FROM planet_osm_line + WHERE "addr:interpolation" IS NOT NULL + ) AS interpolation + properties: + minzoom: 17 + advanced: {} + - id: "housenumbers" + name: "housenumbers" + class: "" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + "addr:housenumber", + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE "addr:housenumber" IS NOT NULL + AND building IS NOT NULL + UNION ALL + SELECT + way, + "addr:housenumber", + NULL AS way_pixels + FROM planet_osm_point + WHERE "addr:housenumber" IS NOT NULL + ORDER BY way_pixels DESC NULLS LAST + ) AS housenumbers + properties: + minzoom: 17 + advanced: {} + - id: "housenames" + name: "housenames" + class: "" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + "addr:housename", + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE "addr:housename" IS NOT NULL + AND building IS NOT NULL + UNION ALL + SELECT + way, + "addr:housename", + NULL AS way_pixels + FROM planet_osm_point WHERE "addr:housename" IS NOT NULL + ORDER BY way_pixels DESC NULLS LAST + ) AS housenames + properties: + minzoom: 17 + advanced: {} + - id: "water-lines-text" + name: "water-lines-text" + class: "" + 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 + FROM planet_osm_line + WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi') + AND (tunnel IS NULL or tunnel != 'culvert') + AND name IS NOT NULL + ORDER BY z_order + ) AS water_lines_text + properties: + minzoom: 13 + advanced: {} + - id: "ferry-routes-text" + name: "ferry-routes-text" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name + FROM planet_osm_line + WHERE route = 'ferry' + AND name IS NOT NULL + ) AS ferry_routes_text + properties: + minzoom: 13 + advanced: {} + - id: "admin-text" + name: "admin-text" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name, + admin_level + FROM planet_osm_polygon + WHERE boundary = 'administrative' + AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10') + AND name IS NOT NULL + ORDER BY admin_level::integer ASC, way_area DESC + ) AS admin_text + properties: + minzoom: 16 + advanced: {} + - id: "nature-reserve-text" + name: "nature-reserve-text" + class: "" + geometry: "linestring" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE (boundary = 'national_park' OR leisure = 'nature_reserve') + AND name IS NOT NULL + ) AS nature_reserve_text + properties: + minzoom: 13 + advanced: {} + - id: "amenity-low-priority" + name: "amenity-low-priority" + class: "amenity-low-priority" + geometry: "point" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + COALESCE( + 'highway_' || CASE WHEN highway IN ('mini_roundabout') THEN highway ELSE NULL END, + 'railway_' || CASE WHEN railway IN ('level_crossing') THEN railway ELSE NULL END, + 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket') THEN amenity ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('wayside_cross') THEN historic ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('cross') THEN man_made ELSE NULL END, + 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END + ) AS feature, + access, + CASE WHEN amenity='waste_basket' THEN 2 ELSE 1 END AS prio + FROM planet_osm_point p + WHERE highway IN ('mini_roundabout') + OR railway IN ('level_crossing') + OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket') + OR historic IN ('wayside_cross') + OR man_made IN ('cross') + OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') + ORDER BY prio + ) AS amenity_low_priority + properties: + minzoom: 14 + advanced: {} + - id: "amenity-low-priority-poly" + name: "amenity-low-priority-poly" + class: "amenity-low-priority" + geometry: "polygon" + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + COALESCE( + 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') THEN amenity ELSE NULL END, + 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END + ) AS feature, + access + FROM planet_osm_polygon p + WHERE amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') + OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') + ) AS amenity_low_priority_poly + properties: + minzoom: 14 + advanced: {} diff --git a/osm-carto/patches/ridges_valleys.diff b/osm-carto/patches/ridges_valleys.diff new file mode 100644 index 0000000..66c4b0d --- /dev/null +++ b/osm-carto/patches/ridges_valleys.diff @@ -0,0 +1,359 @@ +--- a/landcover.mss ++++ b/landcover.mss +@@ -8,6 +8,18 @@ + @park: #c8facc; // Lch(94,30,145) also recreation_ground + @orchard: #aedfa3; + ++// --- Reliefs ++@ridge-text: #7A2F18; ++@valley-text: #305040; ++@mountain_range-text: #C03A01; ++@mountain_area-text: @mountain_range-text; ++@massif-text: #C03A01; ++@cliff-text: #999; ++@arete-text: #800000; ++@couloir-text: #0080C0; ++@dale-text: #008000; ++@gorge-text: #800040; ++ + // --- sports --- + + @stadium: #3c9; // also sports_centre +@@ -670,7 +682,33 @@ + } + } + +-#cliffs { ++#reliefsymbols { ++ [natural = 'arete'][zoom >= 12] { ++ line-pattern-smooth: 0.3; ++ /* ++ line-pattern-file: url('symbols/arete_small.png'); ++ [zoom >= 15] { ++ line-pattern-file: url('symbols/arete_medium.png'); ++ } ++ [zoom >= 16] { ++ line-pattern-file: url('symbols/arete_large.png'); ++ } ++ */ ++ line-pattern-file: url('symbols/arete.svg'); ++ } ++ [natural = 'ridge'][zoom >= 12] { ++ /* ++ line-pattern-smooth: 0.3; ++ line-pattern-file: url('symbols/ridge_small.png'); ++ [zoom >= 15] { ++ line-pattern-file: url('symbols/ridge_medium.png'); ++ } ++ [zoom >= 16] { ++ line-pattern-file: url('symbols/ridge_large.png'); ++ } ++ */ ++ line-pattern-file: url('symbols/ridge.svg'); ++ } + [natural = 'cliff'][zoom >= 13] { + // line-pattern-file: url('symbols/cliff.png'); + line-pattern-file: url('symbols/cliff_mdione.png'); +@@ -736,18 +774,214 @@ + } + } + ++#text-point[zoom >= 15], + #text-line { +- [feature = 'natural_cliff'][zoom >= 15], ++ [feature = 'natural_cliff'][zoom >= 11], + [feature = 'man_made_embankment'][zoom >= 15] { + text-name: "[name]"; + text-halo-radius: 1; + text-halo-fill: rgba(255,255,255,0.6); +- text-fill: #999; ++ text-fill: @cliff-text; + text-size: 10; + text-face-name: @book-fonts; +- text-placement: line; + text-dy: 8; + text-vertical-alignment: middle; + text-spacing: 400; ++ #text-line { ++ text-placement: line; ++ } ++ #text-point { ++ text-placement: point; ++ text-dy: 8; ++ text-size: 10; ++ } ++ } ++ [feature = 'natural_dale'][zoom >= 13], ++ [feature = 'natural_gorge'][zoom >= 14], ++ [feature = 'natural_couloir'][zoom >= 14], ++ [feature = 'natural_ridge'][zoom >= 8]::foreground, ++ [feature = 'natural_arete'][zoom >= 8]::foreground, ++ [feature = 'natural_massif'][zoom >= 15]#text-point, // point visibility given to mappers at high zoom, to help debugging tags to be changed to polylines ++ [feature = 'natural_mountain_range'][zoom >= 15]#text-point, // point visibility given to mappers at high zoom, to help debugging tags to be changed to polylines ++ [feature = 'place_mountain_area'][zoom >= 15]#text-point, // point visibility given to mappers at high zoom, to help debugging tags to be changed to polylines ++ [feature = 'natural_valley'][zoom >= 8]::foreground { ++ [feature = 'natural_dale'] { text-fill: @dale-text; } ++ [feature = 'natural_gorge'] { text-fill: @gorge-text; } ++ [feature = 'natural_couloir'] { text-fill: @couloir-text; } ++ [feature = 'natural_ridge'] { text-fill: @ridge-text; } ++ [feature = 'natural_arete'] { text-fill: @arete-text; } ++ [feature = 'natural_valley'] { text-fill: @valley-text; } ++ [feature = 'natural_massif'] { ++ text-fill: @massif-text; ++ text-transform: uppercase; ++ } ++ [feature = 'natural_mountain_range'] { ++ text-fill: @mountain_range-text; ++ text-transform: uppercase; ++ } ++ [feature = 'place_mountain_area'] { ++ text-fill: @mountain_area-text; ++ text-transform: uppercase; ++ } ++ // general settings ++ text-halo-radius: 2; ++ text-halo-fill: rgba(255,255,255,0.6); ++ text-opacity: 1; ++ [zoom >= 10] { text-opacity: 0.7; } ++ text-dx: 8; ++ text-dy: 8; ++ text-spacing: 760; ++ text-face-name: @oblique-fonts; ++ text-wrap-width: 2; ++ text-name: "[name]"; ++ // the following text-line and spacing dimensions are independent from pixel_length (which needs text-line) ++ [zoom >= 10] { text-size: 10; text-opacity: 0.5; } ++ [zoom >= 11] { text-size: 11; text-character-spacing: 4; text-opacity: 0.6; } ++ [zoom >= 12] { text-size: 13; text-character-spacing: 4; text-opacity: 0.6; } ++ [zoom >= 13] { text-size: 13; text-character-spacing: 5; text-opacity: 0.6; } ++ [zoom >= 14] { text-size: 12; text-character-spacing: 3; } ++ [zoom >= 15] { ++ text-size: 16; ++ text-dx: 15; ++ text-dy: 15; ++ text-character-spacing: 6; ++ } ++ [zoom >= 16] { text-size: 18; text-character-spacing: 12; } ++ #text-line { ++ text-max-char-angle-delta: 30; ++ text-placement: line; ++ text-placement-type: simple; ++ [zoom < 15] { ++ // text-placements: "N,S,E,W,NE,SE,NW,SW,18,16,14,12,10,9,8"; ++ } ++ // the following text-line and spacing dimensions depend on pixel_length (e.g., differentiate long lines) ++ [pixel_length > 60] { ++ text-dx: 11; ++ text-dy: 11; ++ text-size: 11; ++ text-character-spacing: 3; ++ text-wrap-width: 100; ++ } ++ [zoom = 10][pixel_length > 125] { ++ text-character-spacing: 2; ++ text-size: 13; ++ } ++ [zoom = 11][pixel_length > 250] { ++ text-size: 13; ++ text-character-spacing: 6; ++ text-opacity: 0.6; ++ } ++ [zoom = 12][pixel_length > 500] { ++ text-size: 14; ++ text-character-spacing: 7; ++ text-opacity: 0.6; ++ text-transform: uppercase; ++ } ++ [zoom = 13][pixel_length > 1000] { ++ text-size: 15; ++ text-character-spacing: 10; ++ text-opacity: 0.6; ++ text-max-char-angle-delta: 10; ++ text-transform: uppercase; ++ } ++ [zoom = 14][pixel_length > 2000] { ++ text-size: 20; ++ text-character-spacing: 10; ++ text-opacity: 0.5; ++ text-max-char-angle-delta: 10; ++ text-transform: uppercase; ++ text-placement-type: dummy; ++ } ++ [zoom >= 15][pixel_length > 4000] { ++ text-size: 25; ++ text-character-spacing: 20; ++ text-opacity: 0.5; ++ text-max-char-angle-delta: 10; ++ text-transform: uppercase; ++ text-placement-type: dummy; ++ } ++ [zoom < 16][name=~'^.{14,}$'] { // improve probability for long names (>=14 characters) to be shown ++ text-max-char-angle-delta: 30; ++ text-transform: none; ++ } ++ } ++ [feature = 'natural_dale'], ++ [feature = 'natural_gorge'], ++ [feature = 'natural_couloir'], ++ [feature = 'natural_arete'], ++ [feature = 'natural_ridge'] { ++ [zoom >= 10] { text-size: 10; } ++ [zoom >= 11] { text-size: 12; } ++ [zoom >= 12] { text-size: 12; } ++ [zoom >= 13] { text-size: 12; } ++ [zoom >= 14] { text-size: 12; } ++ [zoom >= 15] { text-size: 15; } ++ [zoom >= 16] { text-size: 18; } ++ } ++ #text-point { // points are only shown for debugging purpose, with fixed rendering ++ text-placement: point; ++ text-character-spacing: 0; ++ text-size: 10; ++ } ++ } ++} ++ ++#landcover-low-zoom[zoom < 10]::foreground, ++#amenity-points-poly[zoom >= 10] { ++ [feature = 'natural_dale'][zoom >= 14], ++ [feature = 'natural_gorge'][zoom >= 15], ++ [feature = 'natural_couloir'][zoom >= 15], ++ [feature = 'natural_arete'][zoom >= 15], ++ [feature = 'natural_ridge'][zoom >= 15], ++ [feature = 'natural_massif'][zoom >= 8], ++ [feature = 'natural_mountain_range'][zoom >= 8][zoom < 13], ++ [feature = 'place_mountain_area'][zoom >= 8][zoom < 13], ++ [feature = 'natural_valley'] { ++ text-halo-radius: 2.5; ++ text-halo-fill: rgba(255,255,255,0.6); ++ text-vertical-alignment: middle; ++ text-opacity: 1; ++ text-spacing: 760; ++ text-face-name: @oblique-fonts; ++ text-wrap-width: 2; ++ text-placement: interior; ++ text-placement-type: simple; ++ text-size: 8; ++ [zoom >= 9] { text-size: 9; } ++ [zoom < 11] { ++ // text-placements: "N,S,E,W,NE,SE,NW,SW,10,9,8,7"; ++ text-placements: "N,S,E,W"; ++ } ++ [zoom >= 10] { ++ text-size: 10; ++ text-opacity: 0.7; ++ [way_pixels > 4000] { text-size: 12; } ++ [way_pixels > 20000][zoom >= 10] { text-size: 14; } ++ [way_pixels > 60000][zoom >= 11] { text-size: 17; } ++ [way_pixels > 200000][zoom >= 12] { text-size: 21; } ++ [way_pixels > 500000][zoom >= 13] { text-size: 25; } ++ } ++ text-name: "[name]"; ++ [feature = 'natural_dale'] { text-fill: @dale-text; } ++ [feature = 'natural_gorge'] { text-fill: @gorge-text; } ++ [feature = 'natural_couloir'] { text-fill: @couloir-text; } ++ [feature = 'natural_ridge'] { text-fill: @ridge-text; } ++ [feature = 'natural_arete'] { text-fill: @arete-text; } ++ [feature = 'natural_massif'] { ++ text-fill: @massif-text; ++ text-transform: uppercase; ++ [zoom>=9] { text-character-spacing: 3; } ++ } ++ [feature = 'natural_mountain_range'] { ++ text-fill: @mountain_range-text; ++ text-transform: uppercase; ++ [zoom>=9] { text-character-spacing: 3; } ++ } ++ [feature = 'place_mountain_area'] { ++ text-fill: @mountain_area-text; ++ text-transform: uppercase; ++ [zoom>=9] { text-character-spacing: 3; } ++ } ++ [feature = 'natural_valley'] { text-fill: @valley-text; } + } + } +--- a/project.yaml ++++ b/project.yaml +@@ -879,8 +879,8 @@ + properties: + minzoom: 14 + advanced: {} +- - id: "cliffs" +- name: "cliffs" ++ - id: "reliefsymbols" ++ name: "reliefsymbols" + class: "" + geometry: "linestring" + <<: *extents +@@ -888,12 +888,12 @@ + <<: *osm2pgsql + table: |- + (SELECT +- way, "natural", man_made ++ way, "natural", name, ST_Length(way)/NULLIF(SQRT(!pixel_width!::real*!pixel_width!::real),0) AS pixel_length, man_made + FROM planet_osm_line +- WHERE "natural" = 'cliff' OR man_made = 'embankment' +- ) AS cliffs ++ WHERE "natural" in ('cliff', 'arete', 'ridge') OR man_made = 'embankment' ++ ) AS reliefsymbols + properties: +- minzoom: 13 ++ minzoom: 10 + advanced: {} + - id: "area-barriers" + name: "area-barriers" +@@ -1768,7 +1768,7 @@ + 'video_games', 'watches', 'wholesale', 'yes') THEN 'other' ELSE NULL END, + 'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table') THEN leisure ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') THEN man_made ELSE NULL END, +- 'natural_' || CASE WHEN "natural" IN ('spring') THEN "natural" ELSE NULL END, ++ 'natural_' || CASE WHEN "natural" IN ('spring', 'valley', 'ridge', 'cliff', 'arete', 'dale', 'gorge', 'couloir', 'mountain_range', 'massif') THEN "natural" ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') THEN historic ELSE NULL END, + 'highway_'|| CASE WHEN highway IN ('bus_stop', 'elevator', 'traffic_signals') THEN highway ELSE NULL END, + 'power_' || CASE WHEN power IN ('generator') THEN power ELSE NULL END, +@@ -1779,6 +1779,7 @@ + denomination, + "generator:source", + power_source, ++ name, + castle_type, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon +@@ -1797,7 +1798,7 @@ + OR shop IS NOT NULL -- skip checking a huge list and use a null check + OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table') + OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill') +- OR "natural" IN ('spring') ++ OR "natural" IN ('spring', 'valley', 'ridge', 'cliff', 'arete', 'dale', 'gorge', 'couloir', 'mountain_range', 'massif') + OR historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') + OR highway IN ('bus_stop', 'elevator', 'traffic_signals') + OR (power = 'generator' AND ("generator:source" = 'wind' OR power_source = 'wind')) +@@ -2199,12 +2200,13 @@ + name, + operator, + ref, ++ ST_Length(way)/NULLIF(SQRT(!pixel_width!::real*!pixel_width!::real),0) AS pixel_length, + NULL AS way_area, + CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building + FROM planet_osm_line + WHERE (man_made IN ('pier', 'breakwater', 'groyne', 'embankment') + OR waterway IN ('dam', 'weir') +- OR "natural" IN ('cliff')) ++ OR "natural" IN ('cliff', 'ridge', 'valley', 'glacier', 'arete', 'dale', 'gorge', 'couloir', 'mountain_range', 'massif')) + AND name IS NOT NULL + ) AS text_line + advanced: {} +@@ -2285,9 +2287,11 @@ + 'military') THEN landuse ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower') THEN man_made ELSE NULL END, + 'natural_' || CASE WHEN "natural" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'mud', 'wetland', 'marsh', 'bay', 'spring', +- 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier', 'tree') ++ 'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'cliff', 'valley', ++ 'ridge', 'arete', 'dale', 'gorge', 'couloir', 'mountain_range', 'massif', 'glacier', 'tree') + THEN "natural" ELSE NULL END, +- 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END, ++ 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ++ ELSE NULL END, + 'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'castle', 'fort') THEN historic ELSE NULL END, + 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator', 'ford') THEN highway ELSE NULL END, diff --git a/osm-carto/patches/series b/osm-carto/patches/series index 78a95d2..7904d7c 100644 --- a/osm-carto/patches/series +++ b/osm-carto/patches/series @@ -27,5 +27,6 @@ placenames_text_font_size.diff one_way_arrows_more_often.diff more_noticeable_railways.diff water_casing.diff +ridges_valleys.diff low_zoom_rivers_lakes.diff later_oceans.diff