Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
openstreetmap-carto/project.mml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2515 lines (2513 sloc)
113 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | |
| - 0 | |
| - 0 | |
| - 4 | |
| format: png | |
| interactivity: false | |
| minzoom: 0 | |
| maxzoom: 22 | |
| srs: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" | |
| # Various parts to be included later on | |
| _parts: | |
| # Extents are used for tilemill, and don't actually make it to the generated XML | |
| extents: &extents | |
| extent: *world | |
| srs-name: "900913" | |
| srs: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" | |
| extents84: &extents84 | |
| extent: *world | |
| srs-name: "WGS84" | |
| srs: "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" | |
| osm2pgsql: &osm2pgsql | |
| type: "postgis" | |
| dbname: "gis" | |
| key_field: "" | |
| geometry_field: "way" | |
| extent: "-20037508,-20037508,20037508,20037508" | |
| Stylesheet: | |
| - style.mss | |
| - fonts.mss | |
| - shapefiles.mss | |
| - landcover.mss | |
| - water.mss | |
| - water-features.mss | |
| - road-colors-generated.mss | |
| - roads.mss | |
| - power.mss | |
| - placenames.mss | |
| - buildings.mss | |
| - stations.mss | |
| - amenity-points.mss | |
| - ferry-routes.mss | |
| - aerialways.mss | |
| - admin.mss | |
| - addressing.mss | |
| Layer: | |
| - id: world | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| file: data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp | |
| type: shape | |
| properties: | |
| maxzoom: 9 | |
| - id: coast-poly | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| file: data/land-polygons-split-3857/land_polygons.shp | |
| type: shape | |
| properties: | |
| minzoom: 10 | |
| - id: necountries | |
| 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 | |
| - id: landcover-low-zoom | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, name, way_pixels, religion, | |
| COALESCE(wetland, landuse, "natural") AS feature | |
| FROM (SELECT | |
| way, COALESCE(name, '') AS name, religion, | |
| ('landuse_' || (CASE WHEN landuse IN ('forest', 'military', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow') THEN landuse ELSE NULL END)) AS landuse, | |
| ('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland') THEN "natural" ELSE NULL END)) AS "natural", | |
| ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland, | |
| way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels | |
| FROM planet_osm_polygon | |
| WHERE (landuse IN ('forest', 'military', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow') | |
| OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland')) | |
| AND way_area > 1*!pixel_width!::real*!pixel_height!::real | |
| AND building IS NULL | |
| ORDER BY way_area DESC | |
| ) AS features | |
| ) AS landcover_low_zoom | |
| properties: | |
| minzoom: 7 | |
| maxzoom: 9 | |
| - id: landcover | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, name, religion, way_pixels, | |
| COALESCE(aeroway, amenity, wetland, power, landuse, leisure, man_made, 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', 'taxi', | |
| 'hospital', 'kindergarten', 'grave_yard', 'prison', 'place_of_worship', 'clinic', 'ferry_terminal', | |
| 'marketplace', 'community_centre', 'social_facility', 'arts_centre', 'parking_space', 'bus_station', | |
| 'fire_station', 'police') THEN amenity ELSE NULL END)) AS amenity, | |
| ('landuse_' || (CASE WHEN landuse IN ('quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', | |
| 'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture', | |
| 'recreation_ground', 'village_green', 'retail', 'industrial', 'railway', 'commercial', | |
| 'brownfield', 'landfill', 'construction', 'plant_nursery', 'religious') THEN landuse ELSE NULL END)) AS landuse, | |
| ('leisure_' || (CASE WHEN leisure IN ('swimming_pool', 'playground', 'park', 'recreation_ground', 'common', 'garden', | |
| 'golf_course', 'miniature_golf', 'sports_centre', 'stadium', 'pitch', | |
| 'track', 'dog_park', 'fitness_station') THEN leisure ELSE NULL END)) AS leisure, | |
| ('man_made_' || (CASE WHEN man_made IN ('works') THEN man_made ELSE NULL END)) AS man_made, | |
| ('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 tags->'wetland' END) ELSE NULL END)) AS wetland, | |
| ('power_' || (CASE WHEN power IN ('station', 'sub_station', 'substation', 'generator') THEN power ELSE NULL END)) AS power, | |
| ('tourism_' || (CASE WHEN tourism IN ('camp_site', 'caravan_site', 'picnic_site') THEN tourism ELSE NULL END)) AS tourism, | |
| ('highway_' || (CASE WHEN highway IN ('services', 'rest_area') THEN highway ELSE NULL END)) AS highway, | |
| ('railway_' || (CASE WHEN railway = 'station' THEN railway ELSE NULL END)) AS railway, | |
| CASE WHEN religion IN ('christian', 'jewish', 'muslim') THEN religion ELSE 'INT-generic'::text END AS religion, | |
| way_area/NULLIF(!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', 'taxi', 'university', 'college', 'school', 'hospital', 'kindergarten', | |
| 'grave_yard', 'place_of_worship', 'prison', 'clinic', 'ferry_terminal', 'marketplace', 'community_centre', 'social_facility', | |
| 'arts_centre', 'parking_space', 'bus_station', 'fire_station', 'police') | |
| OR man_made IN ('works') | |
| 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 ('camp_site', 'caravan_site', 'picnic_site') | |
| OR highway IN ('services', 'rest_area') | |
| OR railway = 'station') | |
| AND way_area > 1*!pixel_width!::real*!pixel_height!::real | |
| ORDER BY way_area DESC | |
| ) AS landcover | |
| ) AS features | |
| properties: | |
| minzoom: 10 | |
| - id: landcover-line | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_line | |
| WHERE man_made = 'cutline' | |
| ) AS landcover_line | |
| properties: | |
| minzoom: 14 | |
| - id: water-lines-casing | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| waterway, | |
| CASE WHEN tags->'intermittent' IN ('yes') | |
| OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season') | |
| THEN 'yes' ELSE 'no' END AS int_intermittent, | |
| CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel | |
| FROM planet_osm_line | |
| WHERE waterway IN ('stream', 'drain', 'ditch') | |
| ) AS water_lines_casing | |
| properties: | |
| minzoom: 13 | |
| - id: water-lines-low-zoom | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| waterway, | |
| CASE WHEN tags->'intermittent' IN ('yes') | |
| OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season') | |
| THEN 'yes' ELSE 'no' END AS int_intermittent | |
| FROM planet_osm_line | |
| WHERE waterway = 'river' | |
| ) AS water_lines_low_zoom | |
| properties: | |
| minzoom: 8 | |
| maxzoom: 11 | |
| - id: icesheet-poly | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| file: data/antarctica-icesheet-polygons-3857/icesheet_polygons.shp | |
| type: shape | |
| properties: | |
| minzoom: 8 | |
| - id: water-areas | |
| 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, | |
| CASE WHEN tags->'intermittent' IN ('yes') | |
| OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season') | |
| THEN 'yes' ELSE 'no' END AS int_intermittent | |
| FROM planet_osm_polygon | |
| WHERE | |
| (waterway IN ('dock', 'riverbank') | |
| OR landuse IN ('reservoir', 'basin') | |
| OR "natural" IN ('water', 'glacier')) | |
| AND building IS NULL | |
| AND way_area > 1*!pixel_width!::real*!pixel_height!::real | |
| ORDER BY COALESCE(layer,0), way_area DESC | |
| ) AS water_areas | |
| properties: | |
| minzoom: 0 | |
| - id: landcover-area-symbols | |
| 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 NOT tags ? 'wetland') | |
| THEN 'wetland' | |
| ELSE CASE WHEN ("natural" = 'wetland') | |
| THEN tags->'wetland' | |
| ELSE NULL | |
| END | |
| END | |
| END AS int_wetland, | |
| tags->'leaf_type' AS leaf_type | |
| FROM planet_osm_polygon | |
| WHERE ("natural" IN ('marsh', 'mud', 'wetland', 'wood', 'beach', 'shoal', 'reef', 'scrub', 'sand') OR landuse = 'forest') | |
| AND building IS NULL | |
| AND way_area > 1*!pixel_width!::real*!pixel_height!::real | |
| ORDER BY COALESCE(layer,0), way_area DESC | |
| ) AS landcover_area_symbols | |
| properties: | |
| minzoom: 8 | |
| - id: icesheet-outlines | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| file: data/antarctica-icesheet-outlines-3857/icesheet_outlines.shp | |
| type: shape | |
| properties: | |
| minzoom: 8 | |
| - id: springs | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, "natural" | |
| FROM planet_osm_polygon | |
| WHERE "natural" IN ('spring') | |
| UNION ALL | |
| SELECT | |
| way, "natural" | |
| FROM planet_osm_point | |
| WHERE "natural" IN ('spring') | |
| ) AS springs | |
| properties: | |
| minzoom: 14 | |
| - id: water-lines | |
| class: water-lines | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| waterway, | |
| name, | |
| CASE WHEN tags->'intermittent' IN ('yes') | |
| OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season') | |
| THEN 'yes' ELSE 'no' END AS int_intermittent, | |
| CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel, | |
| 'no' AS bridge | |
| FROM planet_osm_line | |
| WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi') | |
| AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct')) | |
| ORDER BY COALESCE(layer,0) | |
| ) AS water_lines | |
| properties: | |
| minzoom: 12 | |
| - id: water-barriers-line | |
| 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 | |
| properties: | |
| minzoom: 13 | |
| - id: water-barriers-poly | |
| 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 | |
| properties: | |
| minzoom: 13 | |
| - id: marinas-area | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_polygon | |
| WHERE leisure = 'marina' | |
| ) AS marinas_area | |
| properties: | |
| minzoom: 14 | |
| - id: piers-poly | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, man_made | |
| FROM planet_osm_polygon | |
| WHERE man_made IN ('pier', 'breakwater', 'groyne') | |
| ) AS piers_poly | |
| properties: | |
| minzoom: 12 | |
| - id: piers-line | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, man_made | |
| FROM planet_osm_line | |
| WHERE man_made IN ('pier', 'breakwater', 'groyne') | |
| ) AS piers_line | |
| properties: | |
| minzoom: 12 | |
| - id: water-barriers-point | |
| 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 | |
| - id: bridge | |
| 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 | |
| - id: buildings | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| building | |
| FROM planet_osm_polygon | |
| WHERE building IS NOT NULL | |
| AND building != 'no' | |
| AND (aeroway IS NULL OR aeroway != 'terminal') | |
| AND (amenity IS NULL OR amenity != 'place_of_worship') | |
| AND building != 'train_station' | |
| AND (aerialway IS NULL OR aerialway != 'station') | |
| AND ((tags->'public_transport') IS NULL OR tags->'public_transport' != 'station') | |
| AND way_area > 1*!pixel_width!::real*!pixel_height!::real | |
| ORDER BY COALESCE(layer,0), way_area DESC | |
| ) AS buildings | |
| properties: | |
| minzoom: 13 | |
| - id: buildings-major | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| building, | |
| amenity, | |
| aeroway, | |
| aerialway, | |
| tags->'public_transport' as public_transport | |
| FROM planet_osm_polygon | |
| WHERE building IS NOT NULL | |
| AND building != 'no' | |
| AND (aeroway = 'terminal' | |
| OR amenity = 'place_of_worship' | |
| OR building = 'train_station' | |
| OR aerialway = 'station' | |
| OR tags->'public_transport' = 'station') | |
| AND way_area > 1*!pixel_width!::real*!pixel_height!::real | |
| ORDER BY COALESCE(layer,0), way_area DESC) | |
| AS buildings_major | |
| properties: | |
| minzoom: 13 | |
| - id: tunnels | |
| class: access | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| # This query is quite large, having to deal with both roads, railways. To | |
| # allow for ways that are both railways and roads, a UNION ALL is present. | |
| table: |- | |
| (SELECT | |
| way, | |
| (CASE WHEN substr(feature, length(feature)-4, 5) = '_link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| int_surface, | |
| access, | |
| construction, | |
| service, | |
| link, | |
| layernotnull | |
| FROM ( -- subselect that contains both roads and rail | |
| SELECT | |
| way, | |
| 'highway_' || highway AS feature, --only motorway to tertiary links are accepted later on | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', | |
| 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' | |
| WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', | |
| 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' | |
| ELSE NULL | |
| END AS int_surface, | |
| CASE WHEN access IN ('destination') THEN 'destination'::text | |
| WHEN access IN ('no', 'private') THEN 'no'::text | |
| ELSE NULL | |
| END AS access, | |
| construction, | |
| CASE | |
| WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text | |
| ELSE 'INT-normal'::text | |
| END AS service, | |
| CASE | |
| WHEN substr(highway, length(highway)-4, 5) = '_link' THEN 'yes' | |
| ELSE 'no' | |
| END AS link, | |
| COALESCE(layer,0) AS layernotnull, | |
| z_order | |
| FROM planet_osm_line | |
| WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') | |
| AND highway IS NOT NULL -- end of road select | |
| UNION ALL | |
| SELECT | |
| way, | |
| 'railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text | |
| WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' | |
| WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' | |
| ELSE railway END) AS feature, | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| 'null', | |
| CASE | |
| WHEN access IN ('destination') THEN 'destination'::text | |
| WHEN access IN ('no', 'private') THEN 'no'::text | |
| ELSE NULL | |
| END AS access, | |
| construction, | |
| CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service, | |
| 'no' AS link, | |
| COALESCE(layer,0) AS layernotnull, | |
| z_order | |
| FROM planet_osm_line | |
| WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') | |
| AND (railway NOT IN ('platform') AND railway IS NOT NULL) -- end of rail select | |
| ) AS features | |
| ORDER BY | |
| layernotnull, | |
| z_order, | |
| CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END, | |
| CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END, | |
| CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END, | |
| CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END | |
| ) AS tunnels | |
| properties: | |
| group-by: layernotnull | |
| minzoom: 10 | |
| - id: landuse-overlay | |
| 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 | |
| - id: tourism-boundary | |
| 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 | |
| - id: line-barriers | |
| class: barriers | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, COALESCE(historic, barrier) AS feature | |
| FROM (SELECT way, | |
| ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', | |
| 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier, | |
| ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic | |
| FROM planet_osm_line | |
| WHERE barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', | |
| 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') | |
| OR historic = 'citywalls' | |
| AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi')) | |
| ) AS features | |
| ) AS line_barriers | |
| properties: | |
| minzoom: 14 | |
| - id: cliffs | |
| 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 | |
| - id: area-barriers | |
| class: barriers | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, barrier AS feature | |
| FROM (SELECT way, | |
| ('barrier_' || barrier) AS barrier | |
| FROM planet_osm_polygon | |
| WHERE barrier IS NOT NULL | |
| ) AS features | |
| ) AS area_barriers | |
| properties: | |
| minzoom: 16 | |
| - id: ferry-routes | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_line | |
| WHERE route = 'ferry' | |
| ) AS ferry_routes | |
| properties: | |
| minzoom: 8 | |
| - id: turning-circle-casing | |
| 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 | |
| - id: highway-area-casing | |
| 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') | |
| AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) | |
| AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL) | |
| AND (covered NOT IN ('yes') OR covered IS NULL)) | |
| THEN railway ELSE NULL END)) | |
| ) AS feature | |
| FROM planet_osm_polygon | |
| WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'track', 'path', 'platform') | |
| OR (railway IN ('platform') | |
| AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) | |
| AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL) | |
| AND (covered NOT IN ('yes') OR covered IS NULL)) | |
| ORDER BY COALESCE(layer,0), way_area DESC | |
| ) AS highway_area_casing | |
| properties: | |
| minzoom: 14 | |
| - id: roads-casing | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| (CASE WHEN substr(feature, length(feature)-4, 5) = '_link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| int_surface, | |
| access, | |
| construction, | |
| service, | |
| link, | |
| layernotnull | |
| FROM ( -- subselect that contains both roads and rail/aero | |
| SELECT | |
| way, | |
| ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', | |
| 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' | |
| WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', | |
| 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' | |
| ELSE NULL | |
| END AS int_surface, | |
| CASE WHEN access IN ('destination') THEN 'destination'::text | |
| WHEN access IN ('no', 'private') THEN 'no'::text | |
| ELSE NULL | |
| END AS access, | |
| construction, | |
| CASE | |
| WHEN service IN ('parking_aisle', 'drive-through', 'driveway') OR leisure IN ('slipway') THEN 'INT-minor'::text | |
| ELSE 'INT-normal'::text | |
| END AS service, | |
| CASE | |
| WHEN substr(highway, length(highway)-4, 5) = '_link' THEN 'yes' | |
| ELSE 'no' | |
| END AS link, | |
| COALESCE(layer,0) AS layernotnull, | |
| z_order | |
| FROM planet_osm_line | |
| WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage')) | |
| AND (covered IS NULL OR NOT covered = 'yes') | |
| AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')) | |
| AND highway IS NOT NULL -- end of road select | |
| UNION ALL | |
| SELECT | |
| way, | |
| ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text | |
| WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' | |
| WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' | |
| ELSE railway END)) AS feature, | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| 'null', | |
| CASE | |
| WHEN access IN ('destination') THEN 'destination'::text | |
| WHEN access IN ('no', 'private') THEN 'no'::text | |
| ELSE NULL | |
| END AS access, | |
| construction, | |
| CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') OR leisure IN ('slipway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service, | |
| 'no' AS link, | |
| COALESCE(layer,0) AS layernotnull, | |
| z_order | |
| FROM planet_osm_line | |
| WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage')) | |
| AND (covered IS NULL OR NOT covered = 'yes') | |
| AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')) | |
| AND railway IS NOT NULL -- end of rail select | |
| ) AS features | |
| ORDER BY | |
| layernotnull, | |
| z_order, | |
| CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END, | |
| CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END, | |
| CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END, | |
| CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END | |
| ) AS roads_casing | |
| properties: | |
| minzoom: 10 | |
| - id: highway-area-fill | |
| # 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') | |
| AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) | |
| AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL) | |
| AND (covered NOT IN ('yes') OR covered IS NULL)) | |
| THEN railway ELSE NULL END)), | |
| (('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') | |
| AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) | |
| AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL) | |
| AND (covered NOT IN ('yes') OR covered IS NULL)) | |
| OR aeroway IN ('runway', 'taxiway', 'helipad') | |
| ORDER BY COALESCE(layer,0), way_area desc | |
| ) AS highway_area_fill | |
| properties: | |
| minzoom: 14 | |
| - id: roads-fill | |
| class: access | |
| 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 | |
| table: |- | |
| (SELECT | |
| way, | |
| (CASE WHEN substr(feature, length(feature)-4, 5) = '_link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| int_surface, | |
| access, | |
| construction, | |
| service, | |
| link, | |
| layernotnull | |
| FROM ( -- 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', 'ice', 'snow') THEN 'unpaved' | |
| WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', | |
| 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' | |
| ELSE NULL | |
| END AS int_surface, | |
| CASE WHEN access IN ('destination') THEN 'destination'::text | |
| WHEN access IN ('no', 'private') THEN 'no'::text | |
| ELSE NULL | |
| END AS access, | |
| construction, | |
| CASE | |
| WHEN service IN ('parking_aisle', 'drive-through', 'driveway') OR leisure IN ('slipway') THEN 'INT-minor'::text | |
| ELSE 'INT-normal'::text | |
| END AS service, | |
| CASE | |
| WHEN substr(highway, length(highway)-4, 5) = '_link' THEN 'yes' | |
| ELSE 'no' | |
| END AS link, | |
| COALESCE(layer,0) AS layernotnull, | |
| z_order | |
| FROM planet_osm_line | |
| WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage')) | |
| AND (covered IS NULL OR NOT covered = 'yes') | |
| AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')) | |
| AND highway IS NOT NULL -- end of road select | |
| UNION ALL | |
| SELECT | |
| way, | |
| 'railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text | |
| WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' | |
| WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' | |
| ELSE railway END) AS feature, | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| 'null' 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, | |
| construction, | |
| CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') OR leisure IN ('slipway') THEN 'INT-minor'::text | |
| ELSE 'INT-normal'::text END AS service, | |
| 'no' AS link, | |
| COALESCE(layer,0) AS layernotnull, | |
| z_order | |
| FROM planet_osm_line | |
| WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage')) | |
| AND (covered IS NULL OR NOT covered = 'yes') | |
| AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')) | |
| AND railway IS NOT NULL -- end of rail select | |
| ) AS features | |
| ORDER BY | |
| layernotnull, | |
| z_order, | |
| CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END, | |
| CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END, | |
| CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END, | |
| CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END | |
| ) AS roads_fill | |
| properties: | |
| minzoom: 10 | |
| - id: turning-circle-fill | |
| 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 | |
| - id: aerialways | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| aerialway, | |
| name | |
| FROM planet_osm_line | |
| WHERE aerialway IS NOT NULL | |
| ) AS aerialways | |
| properties: | |
| minzoom: 12 | |
| - id: roads-low-zoom | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| COALESCE( | |
| ('highway_' || (CASE WHEN substr(highway, length(highway)-4, 5) = '_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)-4, 5) = '_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', 'ice', 'snow') THEN 'unpaved' | |
| WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', | |
| 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' | |
| ELSE NULL | |
| END AS int_surface | |
| 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: 6 | |
| maxzoom: 9 | |
| - id: waterway-bridges | |
| class: water-lines | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| waterway, | |
| name, | |
| CASE WHEN tags->'intermittent' IN ('yes') | |
| OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season') | |
| THEN 'yes' ELSE 'no' END AS int_intermittent, | |
| CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel, | |
| 'yes' AS bridge | |
| FROM planet_osm_line | |
| WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi') | |
| AND bridge IN ('yes', 'aqueduct') | |
| ORDER BY COALESCE(layer,0) | |
| ) AS waterway_bridges | |
| properties: | |
| minzoom: 12 | |
| - id: bridges | |
| class: access | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| (CASE WHEN substr(feature, length(feature)-4, 5) = '_link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| int_surface, | |
| access, | |
| construction, | |
| service, | |
| link, | |
| layernotnull | |
| FROM ( -- subselect that contains both roads and rail/aero | |
| SELECT | |
| way, | |
| 'highway_' || highway AS feature, --only motorway to tertiary links are accepted later on | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', | |
| 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay', 'ice', 'snow') THEN 'unpaved' | |
| WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', | |
| 'concrete:plates', 'paving_stones', 'metal', 'wood', 'unhewn_cobblestone') THEN 'paved' | |
| ELSE NULL | |
| END AS int_surface, | |
| CASE WHEN access IN ('destination') THEN 'destination'::text | |
| WHEN access IN ('no', 'private') THEN 'no'::text | |
| ELSE NULL | |
| END AS access, | |
| construction, | |
| CASE | |
| WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text | |
| ELSE 'INT-normal'::text | |
| END AS service, | |
| CASE | |
| WHEN substr(highway, length(highway)-4, 5) = '_link' THEN 'yes' | |
| ELSE 'no' | |
| END AS link, | |
| COALESCE(layer,0) AS layernotnull, | |
| z_order | |
| 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, | |
| 'railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text | |
| WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' | |
| WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' | |
| ELSE railway END) AS feature, | |
| horse, | |
| foot, | |
| bicycle, | |
| tracktype, | |
| 'null', | |
| CASE | |
| WHEN access IN ('destination') THEN 'destination'::text | |
| WHEN access IN ('no', 'private') THEN 'no'::text | |
| ELSE NULL | |
| END AS access, | |
| construction, | |
| CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service, | |
| 'no' AS link, | |
| COALESCE(layer,0) AS layernotnull, | |
| z_order | |
| FROM planet_osm_line | |
| WHERE bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct') | |
| AND railway IS NOT NULL -- end of rail select | |
| ) AS features | |
| ORDER BY | |
| layernotnull, | |
| z_order, | |
| CASE WHEN substring(feature for 8) = 'railway_' THEN 2 ELSE 1 END, | |
| CASE WHEN feature IN ('railway_INT-preserved-ssy', 'railway_INT-spur-siding-yard', 'railway_tram-service') THEN 0 ELSE 1 END, | |
| CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END, | |
| CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END | |
| ) AS bridges | |
| properties: | |
| group-by: layernotnull | |
| minzoom: 10 | |
| - id: guideways | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_line | |
| WHERE highway = 'bus_guideway' | |
| ) AS guideways | |
| properties: | |
| minzoom: 11 | |
| - id: entrances | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| tags->'entrance' AS entrance, | |
| access | |
| FROM planet_osm_point | |
| WHERE (tags->'entrance') IS NOT NULL AND | |
| (tags->'indoor' = 'no' | |
| OR (tags->'indoor') IS NULL)) | |
| AS entrances | |
| properties: | |
| minzoom: 18 | |
| - id: aeroways | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| aeroway, | |
| bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct') AS bridge | |
| FROM planet_osm_line | |
| WHERE aeroway IN ('runway', 'taxiway') | |
| ORDER BY bridge NULLS FIRST, | |
| CASE WHEN aeroway = 'runway' THEN 10 ELSE 0 END | |
| ) AS aeroways | |
| properties: | |
| minzoom: 11 | |
| - id: admin-low-zoom | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| admin_level | |
| FROM planet_osm_roads | |
| WHERE boundary = 'administrative' | |
| AND admin_level IN ('0', '1', '2', '3', '4') | |
| AND osm_id < 0 | |
| ORDER BY admin_level DESC | |
| ) AS admin_low_zoom | |
| properties: | |
| minzoom: 4 | |
| maxzoom: 10 | |
| - id: admin-mid-zoom | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| admin_level | |
| FROM planet_osm_roads | |
| WHERE boundary = 'administrative' | |
| AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8') | |
| AND osm_id < 0 | |
| ORDER BY admin_level DESC | |
| ) AS admin_mid_zoom | |
| properties: | |
| minzoom: 11 | |
| maxzoom: 12 | |
| - id: admin-high-zoom | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| admin_level | |
| FROM planet_osm_roads | |
| WHERE boundary = 'administrative' | |
| AND admin_level IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10') | |
| AND osm_id < 0 | |
| ORDER BY admin_level::integer DESC -- With 10 as a valid value, we need to do a numeric ordering, not a text ordering | |
| ) AS admin_high_zoom | |
| properties: | |
| minzoom: 13 | |
| - id: power-minorline | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_line | |
| WHERE power = 'minor_line' | |
| ) AS power_minorline | |
| properties: | |
| minzoom: 16 | |
| - id: power-line | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_line | |
| WHERE power = 'line' | |
| OR (power = 'cable' AND tags->'location' IN ('overground', 'overhead', 'surface', 'outdoor', 'platform')) | |
| ) AS power_line | |
| properties: | |
| minzoom: 14 | |
| - id: nature-reserve-boundaries | |
| 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 > 1*!pixel_width!::real*!pixel_height!::real | |
| ) AS national_park_boundaries | |
| properties: | |
| minzoom: 8 | |
| - id: trees | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, "natural" | |
| FROM planet_osm_point | |
| WHERE "natural" = 'tree' | |
| UNION ALL | |
| SELECT | |
| way, "natural" | |
| FROM planet_osm_line | |
| WHERE "natural" = 'tree_row' | |
| ) AS trees | |
| properties: | |
| minzoom: 16 | |
| - id: country-names | |
| class: country | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, | |
| name | |
| FROM planet_osm_polygon | |
| WHERE boundary = 'administrative' | |
| AND admin_level = '2' | |
| AND name IS NOT NULL | |
| AND way_area > 100*!pixel_width!::real*!pixel_height!::real | |
| ORDER BY way_area DESC | |
| ) AS country_names | |
| properties: | |
| minzoom: 2 | |
| - id: capital-names | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| name, | |
| CASE | |
| WHEN (tags->'population' ~ '^[0-9]{1,8}$') THEN (tags->'population')::INTEGER ELSE 0 | |
| END as population, | |
| round(ascii(md5(osm_id::text)) / 55) AS dir -- base direction factor on geometry to be consistent across metatiles | |
| FROM planet_osm_point | |
| WHERE place IN ('city', 'town', 'village', 'hamlet') | |
| AND name IS NOT NULL | |
| AND tags @> 'capital=>yes' | |
| ORDER BY population DESC | |
| ) AS capital_names | |
| properties: | |
| minzoom: 3 | |
| maxzoom: 15 | |
| - id: state-names | |
| class: state | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, | |
| name, | |
| ref | |
| FROM planet_osm_polygon | |
| WHERE boundary = 'administrative' | |
| AND admin_level = '4' | |
| AND name IS NOT NULL | |
| AND way_area > 100*!pixel_width!::real*!pixel_height!::real | |
| ORDER BY way_area DESC | |
| ) AS state_names | |
| properties: | |
| minzoom: 4 | |
| - id: placenames-medium | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| name, | |
| score, | |
| CASE | |
| WHEN (place = 'city') THEN 1 | |
| ELSE 2 | |
| END as category, | |
| round(ascii(md5(osm_id::text)) / 55) AS dir -- base direction factor on geometry to be consistent across metatiles | |
| FROM | |
| (SELECT | |
| osm_id, | |
| way, | |
| place, | |
| name, | |
| ( | |
| (CASE | |
| WHEN (tags->'population' ~ '^[0-9]{1,8}$') THEN (tags->'population')::INTEGER | |
| WHEN (place = 'city') THEN 100000 | |
| WHEN (place = 'town') THEN 1000 | |
| ELSE 1 | |
| END) | |
| * | |
| (CASE | |
| WHEN (tags @> 'capital=>4') THEN 2 | |
| ELSE 1 | |
| END) | |
| ) AS score | |
| FROM planet_osm_point | |
| WHERE place IN ('city', 'town') | |
| AND name IS NOT NULL | |
| AND NOT (tags @> 'capital=>yes') | |
| ) as p | |
| ORDER BY score DESC, length(name) DESC, name | |
| ) AS placenames_medium | |
| properties: | |
| minzoom: 4 | |
| maxzoom: 15 | |
| - id: placenames-small | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| place, | |
| leisure, | |
| name | |
| FROM planet_osm_point | |
| WHERE place IN ('village', 'hamlet') | |
| AND name IS NOT NULL | |
| AND NOT tags @> 'capital=>yes' | |
| OR (place IN ('suburb', 'quarter', 'neighbourhood', 'locality', 'isolated_dwelling', 'farm') | |
| OR (place IN ('square') | |
| AND (leisure is NULL OR NOT leisure IN ('park', 'common', 'recreation_ground', 'garden'))) | |
| ) 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 = 'quarter' THEN 6 | |
| WHEN place = 'neighbourhood' THEN 7 | |
| WHEN place = 'locality' THEN 8 | |
| WHEN place = 'isolated_dwelling' THEN 9 | |
| WHEN place = 'farm' THEN 10 | |
| WHEN place = 'square' THEN 11 | |
| END ASC, length(name) DESC, name | |
| ) AS placenames_small | |
| properties: | |
| minzoom: 12 | |
| - id: stations | |
| class: stations | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| name, | |
| ref, | |
| 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 | |
| - id: stations-poly | |
| class: stations | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| name, | |
| ref, | |
| railway, | |
| aerialway | |
| FROM planet_osm_polygon | |
| WHERE railway IN ('station', 'halt', 'tram_stop') | |
| OR aerialway = 'station' | |
| ) AS stations_poly | |
| properties: | |
| minzoom: 12 | |
| - id: amenity-points-poly | |
| class: points | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| name, | |
| COALESCE( | |
| 'aeroway_' || CASE WHEN aeroway IN ('helipad', 'aerodrome') THEN aeroway ELSE NULL END, | |
| 'tourism_' || CASE WHEN tourism IN ('artwork', 'alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', | |
| 'hostel', 'hotel', 'motel', 'information', 'museum', 'picnic_site') THEN tourism ELSE NULL END, | |
| 'amenity_' || CASE WHEN amenity IN ('shelter', 'atm', 'bank', 'bar', 'bbq', 'bicycle_rental', 'bureau_de_change', 'bus_station', 'cafe', 'public_bath', | |
| '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', 'taxi', 'theatre', 'toilets', 'drinking_water', | |
| 'prison', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility', | |
| 'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'waste_disposal', 'shower', 'bbq', | |
| 'nursing_home', 'childcare', 'driving_school', 'casino', 'boat_rental') THEN amenity ELSE NULL END, | |
| 'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END, | |
| 'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END, | |
| 'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END, | |
| 'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', | |
| 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort') THEN leisure ELSE NULL END, | |
| 'man_made_' || CASE WHEN (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'chimney') | |
| AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) 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', 'fort', 'castle', 'manor', 'city_gate') | |
| THEN concat_ws('_', historic, CASE WHEN tags->'memorial' IN ('plaque') THEN tags->'memorial' ELSE NULL END) | |
| ELSE NULL END, | |
| 'military_'|| CASE WHEN military IN ('bunker') THEN military 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, | |
| tags->'denomination' as denomination, | |
| tags->'generator:source' as "generator:source", | |
| CASE | |
| WHEN (man_made IN ('mast', 'tower', 'chimney') AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) THEN | |
| CASE | |
| WHEN tags->'height' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'height')::NUMERIC | |
| ELSE NULL | |
| END | |
| ELSE NULL | |
| END AS height, | |
| tags->'power_source' as power_source, | |
| tags->'icao' as icao, | |
| tags->'iata' as iata, | |
| tags->'office' as office, | |
| tags->'recycling_type' as recycling_type, | |
| tags->'tower:construction' as "tower:construction", | |
| tags->'tower:type' as "tower:type", | |
| tags->'castle_type' as castle_type, | |
| tags->'information' as information, | |
| CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'bed', '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', 'deli', 'tobacco', 'art', 'tea', 'coffee', 'tyres', 'pastry', 'chocolate', | |
| 'music', 'medical_supply', 'dairy', 'video_games', 'houseware', 'ticket', 'charity', 'second_hand', 'interior_decoration') THEN shop | |
| ELSE 'other' END AS shop, | |
| 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 ('artwork', 'alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', 'hostel', | |
| 'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site') | |
| OR amenity IS NOT NULL -- skip checking a huge list and use a null check | |
| OR tags->'advertising' IN ('column') | |
| OR shop IS NOT NULL | |
| OR (tags->'office') IS NOT NULL | |
| OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'fitness_centre', | |
| 'fitness_station', 'firepit', 'sauna', 'beach_resort') | |
| OR (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'chimney') | |
| AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) | |
| OR "natural" IN ('spring') | |
| OR historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') | |
| OR tags->'memorial' IN ('plaque') | |
| OR military IN ('bunker') | |
| OR highway IN ('bus_stop', 'elevator', 'traffic_signals') | |
| OR (power = 'generator' AND (tags @> '"generator:source"=>wind' OR tags @> 'power_source=>wind')) | |
| ORDER BY way_area desc | |
| ) AS amenity_points_poly | |
| properties: | |
| minzoom: 10 | |
| - id: amenity-line | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| COALESCE( | |
| 'highway_' || CASE WHEN tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' THEN 'ford' ELSE NULL END, | |
| 'leisure_' || CASE WHEN leisure IN ('slipway') THEN leisure ELSE NULL END | |
| ) AS feature | |
| FROM planet_osm_line | |
| -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering | |
| WHERE tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' | |
| OR leisure IN ('slipway') | |
| ) AS amenity_line | |
| properties: | |
| minzoom: 16 | |
| - id: amenity-points | |
| class: points | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| name, | |
| COALESCE( | |
| 'aeroway_' || CASE WHEN aeroway IN ('helipad', 'aerodrome') THEN aeroway ELSE NULL END, | |
| 'tourism_' || CASE WHEN tourism IN ('artwork', 'alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', 'hostel', | |
| 'hotel', 'motel', 'information', 'museum', 'picnic_site') THEN tourism ELSE NULL END, | |
| 'amenity_' || CASE WHEN amenity IN ('shelter', 'atm', 'bank', 'bar', 'bbq', 'bicycle_rental', 'bureau_de_change', 'bus_station', 'cafe', 'public_bath', | |
| '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', 'taxi', 'theatre', 'toilets', 'drinking_water', | |
| 'prison', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility', | |
| 'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'shower', 'bbq', | |
| 'nursing_home', 'childcare', 'driving_school', 'casino', 'boat_rental') THEN amenity ELSE NULL END, | |
| 'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END, | |
| 'emergency_' || CASE WHEN tags->'emergency' IN ('phone') THEN tags->'emergency' ELSE NULL END, | |
| 'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END, | |
| 'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END, | |
| 'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway', | |
| 'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort') THEN leisure ELSE NULL END, | |
| 'man_made_' || CASE WHEN (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'chimney') | |
| AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) THEN man_made ELSE NULL END, | |
| 'natural_' || CASE WHEN "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance') THEN "natural" ELSE NULL END, | |
| 'waterway_' || CASE WHEN "waterway" IN ('waterfall') THEN waterway ELSE NULL END, | |
| 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') | |
| THEN concat_ws('_', historic, CASE WHEN tags->'memorial' IN ('plaque') THEN tags->'memorial' ELSE NULL END) | |
| ELSE NULL END, | |
| 'military_'|| CASE WHEN military IN ('bunker') THEN military ELSE NULL END, | |
| 'highway_'|| CASE WHEN highway IN ('bus_stop', 'elevator', 'traffic_signals') THEN highway | |
| WHEN tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' THEN 'ford' 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, | |
| 'barrier_' || CASE WHEN barrier IN ('toll_booth') THEN barrier ELSE NULL END, | |
| 'man_made_' || CASE WHEN man_made IN ('cross') THEN man_made ELSE NULL END, | |
| 'historic_' || CASE WHEN historic IN ('wayside_cross', 'wayside_shrine') THEN historic ELSE NULL END | |
| ) AS feature, | |
| access, | |
| CASE | |
| WHEN "natural" IN ('peak', 'volcano', 'saddle') THEN | |
| CASE | |
| WHEN tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'ele')::NUMERIC | |
| ELSE NULL | |
| END | |
| WHEN "waterway" IN ('waterfall') THEN | |
| CASE | |
| WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC | |
| ELSE NULL | |
| END | |
| ELSE NULL | |
| END AS score, | |
| religion, | |
| tags->'denomination' as denomination, | |
| tags->'generator:source' as "generator:source", | |
| CASE | |
| WHEN (man_made IN ('mast', 'tower', 'chimney') AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) | |
| OR waterway IN ('waterfall') THEN | |
| CASE | |
| WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC | |
| ELSE NULL | |
| END | |
| ELSE NULL | |
| END AS height, | |
| tags->'power_source' as power_source, | |
| tags->'icao' as icao, | |
| tags->'iata' as iata, | |
| tags->'office' as office, | |
| tags->'recycling_type' as recycling_type, | |
| tags->'tower:construction' as "tower:construction", | |
| tags->'tower:type' as "tower:type", | |
| tags->'castle_type' as castle_type, | |
| tags->'information' as information, | |
| CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'bed', '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', 'deli', 'tobacco', 'art', 'tea', 'coffee', 'tyres', 'pastry', 'chocolate', | |
| 'music', 'medical_supply', 'dairy', 'video_games', 'houseware', 'ticket', 'charity', 'second_hand', 'interior_decoration') THEN shop | |
| ELSE 'other' END AS shop, | |
| 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 ('artwork', 'alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', 'hostel', | |
| 'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site') | |
| OR amenity IS NOT NULL -- skip checking a huge list and use a null check | |
| OR shop IS NOT NULL | |
| OR tags->'advertising' IN ('column') | |
| OR (tags->'office') IS NOT NULL | |
| OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway', | |
| 'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort') | |
| OR barrier IN ('toll_booth') | |
| OR (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk', 'communications_tower', 'chimney') | |
| AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) | |
| OR "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance') | |
| OR waterway IN ('waterfall') | |
| OR historic IN ('memorial', 'monument', 'archaeological_site', 'wayside_cross', 'fort', 'wayside_shrine', 'castle', 'manor', 'city_gate') | |
| OR tags->'memorial' IN ('plaque') | |
| OR military IN ('bunker') | |
| OR tags @> 'emergency=>phone' | |
| OR highway IN ('bus_stop', 'elevator', 'traffic_signals') | |
| OR tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' | |
| OR (power = 'generator' AND (tags @> '"generator:source"=>wind' OR tags @> 'power_source=>wind')) | |
| ORDER BY score DESC NULLS LAST | |
| ) AS amenity_points | |
| properties: | |
| minzoom: 10 | |
| - id: power-towers | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_point | |
| WHERE power = 'tower' | |
| ) AS power_towers | |
| properties: | |
| minzoom: 14 | |
| - id: power-poles | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_point | |
| WHERE power = 'pole' | |
| ) AS power_poles | |
| properties: | |
| minzoom: 16 | |
| - id: roads-text-ref-low-zoom | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| highway, | |
| height, | |
| width, | |
| refs | |
| FROM ( | |
| SELECT | |
| way, | |
| osm_id, | |
| 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, | |
| osm_id, | |
| 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 | |
| ORDER BY | |
| CASE | |
| WHEN highway = 'motorway' THEN 38 | |
| WHEN highway = 'trunk' THEN 37 | |
| WHEN highway = 'primary' THEN 36 | |
| WHEN highway = 'secondary' THEN 35 | |
| WHEN highway = 'tertiary' THEN 34 | |
| WHEN highway = 'unclassified' THEN 33 | |
| WHEN highway = 'residential' THEN 32 | |
| WHEN highway = 'runway' THEN 6 | |
| WHEN highway = 'taxiway' THEN 5 | |
| ELSE NULL | |
| END DESC NULLS LAST, | |
| height DESC, | |
| width DESC, | |
| refs, | |
| osm_id | |
| ) AS roads_text_ref_low_zoom | |
| properties: | |
| minzoom: 10 | |
| maxzoom: 12 | |
| - id: junctions | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| highway, | |
| junction, | |
| ref, | |
| name, | |
| NULL AS way_pixels | |
| FROM planet_osm_point | |
| WHERE highway = 'motorway_junction' OR highway = 'traffic_signals' OR junction = 'yes' | |
| UNION ALL | |
| SELECT | |
| way, | |
| highway, | |
| junction, | |
| ref, | |
| name, | |
| way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels | |
| FROM planet_osm_polygon | |
| WHERE junction = 'yes' | |
| ORDER BY way_pixels DESC NULLS LAST | |
| ) AS junctions | |
| properties: | |
| minzoom: 11 | |
| - id: bridge-text | |
| 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' | |
| ORDER BY way_area DESC | |
| ) AS bridge_text | |
| properties: | |
| minzoom: 11 | |
| - id: roads-text-ref | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| highway, | |
| height, | |
| width, | |
| refs | |
| FROM ( | |
| SELECT | |
| osm_id, | |
| 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 | |
| osm_id, | |
| 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 | |
| ORDER BY | |
| CASE | |
| WHEN highway = 'motorway' THEN 38 | |
| WHEN highway = 'trunk' THEN 37 | |
| WHEN highway = 'primary' THEN 36 | |
| WHEN highway = 'secondary' THEN 35 | |
| WHEN highway = 'tertiary' THEN 34 | |
| WHEN highway = 'unclassified' THEN 33 | |
| WHEN highway = 'residential' THEN 32 | |
| WHEN highway = 'runway' THEN 6 | |
| WHEN highway = 'taxiway' THEN 5 | |
| ELSE NULL | |
| END DESC NULLS LAST, | |
| height DESC, | |
| width DESC, | |
| refs, | |
| osm_id | |
| ) AS roads_text_ref | |
| properties: | |
| minzoom: 13 | |
| - id: roads-area-text-name | |
| geometry: polygon | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels, | |
| highway, | |
| place, | |
| leisure, | |
| name | |
| FROM planet_osm_polygon | |
| WHERE highway IN ('residential', 'unclassified', 'pedestrian', 'service', 'footway', 'cycleway', 'living_street', 'track', 'path', 'platform') | |
| OR (railway IN ('platform') | |
| AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) | |
| AND (tunnel NOT IN ('yes', 'building_passage') OR tunnel IS NULL) | |
| AND (covered NOT IN ('yes') OR covered IS NULL)) | |
| OR (place IN ('square') | |
| AND (leisure IS NULL OR NOT leisure IN ('park', 'common', 'recreation_ground', 'garden'))) | |
| AND name IS NOT NULL | |
| ORDER BY way_area DESC | |
| ) AS roads_area_text_name | |
| properties: | |
| minzoom: 15 | |
| - id: roads-text-name | |
| class: directions | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| CASE WHEN substr(highway, length(highway)-4, 5) = '_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, | |
| construction, | |
| name, | |
| 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, | |
| horse, bicycle | |
| FROM planet_osm_line l | |
| JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results. | |
| ('motorway', 380), | |
| ('trunk', 370), | |
| ('primary', 360), | |
| ('secondary', 350), | |
| ('tertiary', 340), | |
| ('residential', 330), | |
| ('unclassified', 330), | |
| ('road', 330), | |
| ('living_street', 320), | |
| ('pedestrian', 310), | |
| ('raceway', 300), | |
| ('motorway_link', 240), | |
| ('trunk_link', 230), | |
| ('primary_link', 220), | |
| ('secondary_link', 210), | |
| ('tertiary_link', 200), | |
| ('service', 150), | |
| ('construction', 10) | |
| ) AS ordertable (highway, prio) | |
| USING (highway) | |
| 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', 'construction') | |
| AND (name IS NOT NULL | |
| OR oneway IN ('yes', '-1') | |
| OR junction IN ('roundabout')) | |
| ORDER BY | |
| z_order DESC, -- put important roads first | |
| COALESCE(layer, 0), -- put top layered roads first | |
| length(name) DESC, -- Try to fit big labels in first | |
| name DESC, -- Force a consistent ordering between differently named streets | |
| l.osm_id DESC -- Force an ordering for streets of the same name, e.g. dualized roads | |
| ) AS roads_text_name | |
| properties: | |
| minzoom: 13 | |
| - id: paths-text-name | |
| 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 | |
| - id: railways-text-name | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text | |
| WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' | |
| WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END AS railway, | |
| CASE WHEN (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes') THEN 'yes' ELSE 'no' END AS tunnel, | |
| tags->'highspeed' as highspeed, | |
| tags->'usage' as usage, | |
| construction, | |
| name | |
| FROM planet_osm_line l | |
| WHERE railway IN ('rail', 'subway', 'narrow_gauge', 'light_rail', 'preserved', 'funicular', | |
| 'monorail', 'miniature', 'tram', 'disused', 'construction') | |
| AND (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage')) | |
| AND highway IS NULL -- Prevent duplicate rendering | |
| AND name IS NOT NULL | |
| ORDER BY | |
| z_order DESC, -- put important rails first | |
| COALESCE(layer, 0), -- put top layered rails first | |
| length(name) DESC, -- Try to fit big labels in first | |
| name DESC, -- Force a consistent ordering between differently named railways | |
| l.osm_id DESC -- Force an ordering for railways of the same name, e.g. dualized rails | |
| ) AS railways_text_name | |
| properties: | |
| minzoom: 11 | |
| - id: 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', 'farmland') THEN landuse ELSE NULL END, | |
| 'natural_' || CASE WHEN "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', | |
| 'water', 'bay') 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, | |
| 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', 'farmland') | |
| OR "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', 'water', 'bay') | |
| 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: 0 | |
| maxzoom: 9 | |
| - id: 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 ('artwork', 'alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', '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', 'public_bath', | |
| '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', 'bureau_de_change', 'car_rental', 'car_wash', 'post_box', 'post_office', | |
| 'recycling', 'telephone', 'toilets', 'taxi', 'drinking_water', 'hunting_stand', | |
| 'nightclub', 'veterinary', 'social_facility', 'charging_station', 'arts_centre', | |
| 'ferry_terminal', 'marketplace', 'shower', 'bbq', 'nursing_home', 'childcare', 'driving_school', | |
| 'casino', 'boat_rental') THEN amenity ELSE NULL END, | |
| 'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END, | |
| 'shop_' || CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'bed', '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', 'deli', 'tobacco', 'art', 'tea', | |
| 'coffee', 'tyres', 'pastry', 'chocolate', 'music', 'medical_supply', 'dairy', 'video_games', 'houseware', 'ticket', 'charity', 'second_hand', 'interior_decoration') THEN shop | |
| WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END, | |
| 'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END, | |
| 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'fitness_centre', 'sports_centre', 'stadium', 'track', | |
| 'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', | |
| 'picnic_table', 'dog_park', 'fitness_station', 'firepit', 'sauna', 'beach_resort') 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', 'farmland', | |
| 'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', | |
| 'construction', 'military', 'plant_nursery', 'religious') THEN landuse ELSE NULL END, | |
| 'man_made_' || CASE WHEN (man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works', 'communications_tower', 'chimney') | |
| AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) 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', 'bunker') THEN military ELSE NULL END, | |
| 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') | |
| THEN concat_ws('_', historic, CASE WHEN tags->'memorial' IN ('plaque') THEN tags->'memorial' ELSE NULL END) | |
| ELSE NULL END, | |
| 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator') THEN highway ELSE NULL END, | |
| 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, | |
| 'waterway_' || CASE WHEN waterway IN ('dam', 'dock') THEN waterway ELSE NULL END, | |
| 'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism ELSE NULL END | |
| ) AS feature, | |
| access, | |
| CONCAT( | |
| name, | |
| CASE | |
| WHEN (tourism = 'alpine_hut' OR amenity = 'shelter') AND tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' THEN | |
| CONCAT(E'\n', REPLACE(ROUND((tags->'ele')::NUMERIC)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') | |
| ELSE | |
| NULL | |
| END | |
| ) AS name, | |
| CASE | |
| WHEN "waterway" IN ('waterfall') THEN | |
| CASE | |
| WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC | |
| ELSE NULL | |
| END | |
| ELSE NULL | |
| END AS height, | |
| tags->'operator' as operator, | |
| tags->'icao' as icao, | |
| tags->'iata' as iata, | |
| tags->'office' as office, | |
| tags->'recycling_type' as recycling_type, | |
| tags->'castle_type' as castle_type, | |
| tags->'information' as information, | |
| ref, | |
| way_area, | |
| 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 ('artwork', 'alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', '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 tags->'advertising' IN ('column') | |
| OR shop IS NOT NULL | |
| OR (tags->'office') IS NOT NULL | |
| OR leisure IS NOT NULL | |
| OR landuse IS NOT NULL | |
| OR (man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works', 'communications_tower', 'chimney') | |
| AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) | |
| OR "natural" IS NOT NULL | |
| OR place IN ('island', 'islet') | |
| OR military IN ('danger_area', 'bunker') | |
| OR historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') | |
| OR tags->'memorial' IN ('plaque') | |
| OR highway IN ('services', 'rest_area', 'bus_stop', 'elevator') | |
| OR power IN ('plant', 'station', 'generator', 'sub_station', 'substation') | |
| OR boundary IN ('national_park') | |
| OR waterway IN ('dam', 'dock')) | |
| AND (name IS NOT NULL | |
| OR (ref IS NOT NULL AND aeroway IN ('gate')) | |
| ) | |
| ORDER BY way_area DESC | |
| ) AS text_poly | |
| properties: | |
| minzoom: 10 | |
| - id: text-line | |
| 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, | |
| tags->'operator' as 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 | |
| properties: | |
| minzoom: 10 | |
| - id: 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 OR height 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, | |
| CASE WHEN height IS NOT NULL THEN CONCAT(ROUND(height)::TEXT, U&'\00A0', 'm') ELSE NULL END | |
| ) AS name, | |
| CASE | |
| WHEN "natural" IN ('peak', 'volcano', 'saddle') THEN elevation | |
| WHEN "waterway" IN ('waterfall') THEN height | |
| ELSE NULL | |
| END AS score, | |
| height, | |
| operator, | |
| icao, | |
| iata, | |
| office, | |
| recycling_type, | |
| castle_type, | |
| information, | |
| ref, | |
| way_area, | |
| 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 ('artwork', 'alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', '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', 'public_bath', | |
| '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', 'bureau_de_change','car_rental', | |
| 'car_wash', 'post_box', 'post_office', 'recycling', 'telephone', 'toilets', 'taxi', | |
| 'drinking_water', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility', | |
| 'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'shower', 'bbq', | |
| 'nursing_home', 'childcare', 'driving_school', 'casino', 'boat_rental') THEN amenity ELSE NULL END, | |
| 'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END, | |
| 'shop_' || CASE WHEN shop IN ('supermarket', 'bag','bakery', 'beauty', 'bed', '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', 'deli', 'tobacco', 'art', 'tea', 'coffee', 'tyres', | |
| 'pastry', 'chocolate', 'music', 'medical_supply','dairy', 'video_games', 'houseware', 'ticket', 'charity', 'second_hand', 'interior_decoration') THEN shop | |
| WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END, | |
| 'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END, | |
| 'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'fitness_centre', 'sports_centre', 'stadium', 'track', | |
| 'pitch','playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina', | |
| 'slipway', 'picnic_table', 'dog_park', 'fitness_station', 'firepit', 'sauna', 'beach_resort') 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', 'farmland', | |
| 'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', | |
| 'construction', 'military', 'plant_nursery') THEN landuse ELSE NULL END, | |
| 'man_made_' || CASE WHEN (man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'obelisk', 'works', 'communications_tower', 'chimney') | |
| AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) 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, | |
| 'waterway_' || CASE WHEN waterway IN ('waterfall') THEN waterway ELSE NULL END, | |
| 'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END, | |
| 'barrier_' || CASE WHEN barrier IN ('toll_booth') THEN barrier ELSE NULL END, | |
| 'military_' || CASE WHEN military IN ('danger_area', 'bunker') THEN military ELSE NULL END, | |
| 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') | |
| THEN concat_ws('_', historic, CASE WHEN tags->'memorial' IN ('plaque') THEN tags->'memorial' ELSE NULL END) | |
| ELSE NULL END, | |
| 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator') THEN highway ELSE NULL END, | |
| 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, | |
| 'waterway_' || CASE WHEN waterway IN ('dam', 'weir', 'dock') 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', 'wayside_shrine') THEN historic ELSE NULL END | |
| ) AS feature, | |
| access, | |
| name, | |
| CASE | |
| WHEN "natural" IN ('peak', 'volcano', 'saddle') | |
| OR tourism = 'alpine_hut' OR (tourism = 'information' AND tags->'information' = 'guidepost') | |
| OR amenity = 'shelter' THEN | |
| CASE | |
| WHEN tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'ele')::NUMERIC | |
| ELSE NULL | |
| END | |
| ELSE NULL | |
| END AS elevation, | |
| CASE | |
| WHEN "waterway" IN ('waterfall') THEN | |
| CASE | |
| WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC | |
| ELSE NULL | |
| END | |
| ELSE NULL | |
| END AS height, | |
| "natural", | |
| waterway, | |
| tags->'operator' as operator, | |
| tags->'icao' as icao, | |
| tags->'iata' as iata, | |
| tags->'office' as office, | |
| tags->'recycling_type' as recycling_type, | |
| tags->'castle_type' as castle_type, | |
| tags->'information' as information, | |
| ref, | |
| NULL AS way_area, | |
| 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 ('artwork', 'alpine_hut', 'hotel', 'motel', 'hostel', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', '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 tags->'advertising' IN ('column') | |
| OR shop IS NOT NULL | |
| OR (tags->'office') 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', 'farmland', 'greenhouse_horticulture', | |
| 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military', 'plant_nursery') | |
| OR (man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'cross', 'obelisk', 'works', 'communications_tower', 'chimney') | |
| AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) | |
| OR "natural" IS NOT NULL | |
| OR waterway IN ('waterfall') | |
| OR place IN ('island', 'islet') | |
| OR barrier IN ('toll_booth') | |
| OR military IN ('danger_area', 'bunker') | |
| OR historic IN ('memorial', 'monument', 'archaeological_site', 'wayside_cross', 'fort', 'wayside_shrine', 'castle', 'manor', 'city_gate') | |
| OR tags->'memorial' IN ('plaque') | |
| OR highway IN ('bus_stop', 'services', 'rest_area', 'elevator') | |
| OR power IN ('plant', 'station', 'generator', 'sub_station', 'substation') | |
| OR boundary IN ('national_park') | |
| OR waterway IN ('dam', 'weir', 'dock')) | |
| AND (name IS NOT NULL | |
| OR (tags?'ele' AND ("natural" IN ('peak', 'volcano', 'saddle') | |
| OR tourism = 'alpine_hut' | |
| OR (tourism = 'information' AND tags->'information' = 'guidepost') | |
| OR amenity = 'shelter')) | |
| OR (ref IS NOT NULL AND aeroway IN ('gate')) | |
| ) | |
| ) AS p | |
| ORDER BY score DESC NULLS LAST | |
| ) AS text | |
| properties: | |
| minzoom: 10 | |
| - id: building-text | |
| 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 | |
| - id: interpolation | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way | |
| FROM planet_osm_line | |
| WHERE "addr:interpolation" IS NOT NULL | |
| ) AS interpolation | |
| properties: | |
| minzoom: 17 | |
| - id: addresses | |
| geometry: point | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| "addr:housenumber" AS addr_housenumber, | |
| "addr:housename" AS addr_housename, | |
| tags->'addr:unit' AS addr_unit, | |
| way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels | |
| FROM planet_osm_polygon | |
| WHERE (("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL)) | |
| AND building IS NOT NULL | |
| UNION ALL | |
| SELECT | |
| way, | |
| "addr:housenumber" AS addr_housenumber, | |
| "addr:housename" AS addr_housename, | |
| tags->'addr:unit' AS addr_unit, | |
| NULL AS way_pixels | |
| FROM planet_osm_point | |
| WHERE ("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL) | |
| ORDER BY way_pixels DESC NULLS LAST | |
| ) AS addresses | |
| properties: | |
| minzoom: 17 | |
| - id: water-lines-text | |
| geometry: linestring | |
| <<: *extents | |
| Datasource: | |
| <<: *osm2pgsql | |
| table: |- | |
| (SELECT | |
| way, | |
| waterway, | |
| lock, | |
| name, | |
| tags-> 'lock_name' AS lock_name, | |
| CASE WHEN tags->'intermittent' IN ('yes') | |
| OR tags->'seasonal' IN ('yes', 'spring', 'summer', 'autumn', 'winter', 'wet_season', 'dry_season') | |
| THEN 'yes' ELSE 'no' END AS int_intermittent, | |
| CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel | |
| FROM planet_osm_line | |
| WHERE waterway IN ('river', 'canal', 'stream', 'drain', 'ditch', 'wadi') | |
| AND (tunnel IS NULL or tunnel != 'culvert') | |
| AND name IS NOT NULL | |
| ORDER BY COALESCE(layer,0) | |
| ) AS water_lines_text | |
| properties: | |
| minzoom: 13 | |
| - id: ferry-routes-text | |
| 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 | |
| - id: admin-text | |
| 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 | |
| - id: nature-reserve-text | |
| 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 | |
| - id: 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', 'crossing') THEN railway ELSE NULL END, | |
| 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', | |
| 'waste_basket', 'waste_disposal') THEN amenity ELSE NULL END, | |
| 'historic_' || CASE WHEN historic IN ('wayside_cross', 'wayside_shrine') 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', 'log') THEN barrier ELSE NULL END | |
| ) AS feature, | |
| access, | |
| CASE WHEN amenity IN ('waste_basket', 'waste_disposal') THEN 2 ELSE 1 END AS prio | |
| FROM planet_osm_point p | |
| WHERE highway IN ('mini_roundabout') | |
| OR railway IN ('level_crossing', 'crossing') | |
| OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket', 'waste_disposal') | |
| OR historic IN ('wayside_cross', 'wayside_shrine') | |
| OR man_made IN ('cross') | |
| OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block', 'log') | |
| ORDER BY prio | |
| ) AS amenity_low_priority | |
| properties: | |
| minzoom: 14 | |
| - id: 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', 'log') 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', 'log') | |
| ) AS amenity_low_priority_poly | |
| properties: | |
| minzoom: 14 |