Skip to content
Permalink
d82a67f9e8
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
693 lines (624 sloc) 23.2 KB
bounds: &world
- -180
- -85
- 180
- 85
_parts:
# let's factorize default values used by layers
extents: &extents
extent: *world
srs-name: "3857"
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"
class: ''
status: 'on'
extents84: &extents84
extent: *world
srs-name: "WGS84"
srs: "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
postgis: &postgis
type: postgis
dbname: osm
key_field: ""
geometry_field: way
extent: -20037508,-20037508,20037508,20037508
host: localhost
user: hot
password: m4d31nfr4nc3
center:
- 29.9377
- -3.4216
- 15
format: png
interactivity: false
minzoom: 0
maxzoom: 20
srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over
Stylesheet:
- "palette.mss"
- "base.mss"
- "roads.mss"
- "poi.mss"
- "power.mss"
- "labels.mss"
Layer:
- Datasource:
file: http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip
type: shape
class: shp
geometry: polygon
<<: *extents
id: land-low
- id: land-high
Datasource:
file: http://data.openstreetmapdata.com/land-polygons-split-3857.zip
type: shape
class: shp
geometry: polygon
<<: *extents
- id: landuse_gen0
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
way, way_area AS area, COALESCE(landuse, leisure, "natural", highway, amenity, tourism) AS type, tags->'landfill:type' as landfill_type
FROM
planet_osm_polygon
WHERE
way_area > 100000 ORDER BY way_area DESC
) AS data
advanced:
extent_from_subquery: 'true'
- id: landuse_gen1
<<: *extents
Datasource:
<<: *postgis
table: >-
( SELECT way, way_area AS area, COALESCE(landuse, leisure, "natural",
highway, amenity, tourism) AS type, tags->'landfill:type' as
landfill_type FROM planet_osm_polygon WHERE way_area > 10000 AND
COALESCE(landuse, leisure, "natural", highway, amenity, tourism) IS NOT NULL
ORDER BY way_area DESC
) AS data
advanced:
extent_from_subquery: 'true'
- id: landuse
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT way, way_area AS area, COALESCE(landuse, leisure, "natural", highway, amenity, tourism) AS type, tags->'landfill:type' as landfill_type
FROM planet_osm_polygon
WHERE COALESCE(landuse, leisure, "natural", highway, amenity, tourism) IS NOT NULL
ORDER BY way_area DESC) AS data
advanced:
extent_from_subquery: 'true'
- geometry: raster
extent: *world
id: hillshade
Datasource:
file: DEM/data/hillshade.vrt
type: gdal
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
status: 'off'
- geometry: linestring
extent: *world
id: contour_line
Datasource:
file: DEM/data/contour-25m.shp
type: shape
srs-name: autodetect
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
status: 'off'
- id: waterway_low
<<: *extents
Datasource:
<<: *postgis
table: >-
( SELECT way, waterway AS type,
CASE WHEN intermittent IN ('yes') OR tags@> hstore('seasonal','yes') THEN
'yes'
ELSE 'no' END AS seasonal
FROM planet_osm_line
WHERE waterway IN ('river', 'canal')) as h2olow
advanced:
extent_from_subquery: 'true'
- id: waterway_med
Datasource:
<<: *postgis
table: >-
( SELECT way, waterway AS type,
CASE WHEN intermittent IN ('yes') OR tags@> hstore('seasonal','yes') THEN
'yes'
ELSE 'no' END AS seasonal
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'stream')) as h2o
- id: waterway_high
<<: *extents
Datasource:
<<: *postgis
table: >-
( SELECT way, waterway AS type,
CASE WHEN intermittent IN ('yes') OR tags@> hstore('seasonal','yes') THEN
'yes'
ELSE 'no' END AS seasonal
FROM planet_osm_line
WHERE waterway IN ('river', 'canal', 'stream', 'ditch', 'drain')) as h2o
advanced:
extent_from_subquery: 'true'
- id: water_gen0
<<: *extents
Datasource:
<<: *postgis
table: >-
( SELECT way, "natural" AS type, way_area AS area
FROM planet_osm_polygon
WHERE ("natural" IN ('water', 'pond')
OR waterway IN ('basin', 'canal', 'mill_pond', 'pond', 'riverbank'))
AND way_area > 10000
) AS data
advanced:
extent_from_subquery: 'true'
- id: water_gen1
<<: *extents
Datasource:
<<: *postgis
table: >-
( SELECT way, "natural" AS type, way_area AS area
FROM planet_osm_polygon
WHERE ("natural" IN ('water', 'pond')
OR waterway IN ('basin', 'canal', 'mill_pond', 'pond', 'riverbank'))
AND way_area > 1000
) AS data
advanced:
extent_from_subquery: 'true'
- id: water
<<: *extents
Datasource:
<<: *postgis
table: >-
( SELECT way, way_area AS area
FROM planet_osm_polygon
WHERE "natural" IN ('water', 'pond')
OR waterway IN ('basin', 'canal', 'mill_pond', 'pond', 'riverbank', 'dock')
) AS data
advanced:
extent_from_subquery: 'true'
- id: landuse_overlays
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT way, way_area AS area, COALESCE(leisure) AS type
FROM planet_osm_polygon
WHERE leisure = 'nature_reserve'
ORDER BY way_area DESC
) AS data
advanced:
extent_from_subquery: 'true'
- id: admin-high
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
ST_Intersection(way, !bbox!) AS way, admin_level::integer,
CASE WHEN tags->'maritime'='yes' THEN 'yes' ELSE 'no' END AS maritime
FROM
planet_osm_roads
WHERE
"boundary" = 'administrative'
AND admin_level IN ('1','2','3','4', '5', '6', '7', '8', '9', '10')
AND "boundary" IS NOT NULL
AND way && !bbox!
ORDER BY
admin_level DESC
) AS data
advanced:
extent_from_subquery: 'true'
- id: admin-med
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
ST_Intersection(way, !bbox!) AS way, admin_level::integer,
CASE WHEN tags->'maritime'='yes' THEN 'yes' ELSE 'no' END AS maritime
FROM
planet_osm_roads
WHERE
"boundary" = 'administrative'
AND admin_level IN ('1','2','3','4', '5', '6', '7', '8')
AND "boundary" IS NOT NULL
AND way && !bbox!
ORDER BY
admin_level DESC
) AS data
advanced:
extent_from_subquery: 'true'
- id: admin-low
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
way, admin_level::integer,
CASE WHEN tags->'maritime'='yes' THEN 'yes' ELSE 'no' END AS maritime
FROM
planet_osm_roads
WHERE
"boundary" = 'administrative'
AND admin_level IN ('1','2','3','4')
AND "boundary" IS NOT NULL
ORDER BY
admin_level DESC
) AS data
advanced:
extent_from_subquery: 'true'
- id: buildings
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
way, CASE WHEN amenity IS NOT NULL or shop IS NOT NULL THEN 'yes' ELSE 'no' END AS poi, building AS type
FROM
planet_osm_polygon
WHERE
building NOT IN ('0','false', 'no')
) AS data
advanced:
extent_from_subquery: 'true'
- id: aeroway-poly
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way, aeroway AS type, tunnel FROM planet_osm_polygon WHERE aeroway IN ('apron', 'runway', 'taxiway')) AS data"
advanced:
extent_from_subquery: 'true'
- id: aeroway
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT way, aeroway AS type, tunnel FROM planet_osm_line
WHERE aeroway IN ('apron', 'runway', 'taxiway')
) AS data
advanced:
extent_from_subquery: 'true'
- id: turning_circle_case
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way \n FROM planet_osm_point \n WHERE highway = 'turning_circle'\n) AS data"
advanced:
extent_from_subquery: 'true'
- id: roads_high
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
way, name, access, construction, stratum, type,
CASE
WHEN smoothness IN ('bad', 'very_bad', 'horrible', 'very_horrible') THEN 'bad'
ELSE 'good'
END AS condition,
CASE
WHEN surface IN ('paved', 'paving_stones', 'asphalt', 'concrete') THEN 'paved'
WHEN (surface IS NULL AND type IN ('trunk', 'trunk_link', 'motorway', 'motorway_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link')) THEN 'paved'
ELSE 'unpaved'
END AS surface,
CASE
WHEN tunnel IS NOT NULL AND tunnel!='no' THEN 'tunnel'
WHEN bridge IS NOT NULL AND bridge!='no' THEN 'bridge'
WHEN ford IS NOT NULL AND ford!='no' THEN 'ford'
ELSE NULL
END AS structure,
CASE
WHEN type IN ('motorway', 'trunk', 'trunk_link') THEN 'motorway'
WHEN type ~ E'\\w+_link$' THEN regexp_replace(type, '_link', '')
WHEN type IN ('unclassified', 'road', 'service') THEN 'standard'
WHEN type IN ('residential', 'living_street') THEN 'urban'
WHEN type IN ('path', 'cycleway', 'footway', 'pedestrian', 'steps', 'bridleway') THEN 'noauto'
ELSE type
END AS style
FROM
( SELECT
way, name, bridge, access, surface, tunnel, tags->'smoothness' AS smoothness, tags->'ford' AS ford, layer, tags->'narrow' AS narrow, construction,
CASE
WHEN layer ~ E'^-?\\d{1,4}$' THEN layer::integer
ELSE 0
END AS stratum,
CASE
WHEN highway='construction' AND construction IS NOT NULL THEN construction
ELSE highway
END AS type,
CASE
WHEN highway IN ('trunk', 'motorway') THEN 1
WHEN highway IN ('primary', 'secondary', 'tertiary') THEN 10
WHEN highway IN ('tertiary') THEN 100
ELSE 1000
END AS prio
FROM
planet_osm_line
WHERE
highway IS NOT NULL
AND way && !bbox!
ORDER BY
stratum, prio DESC, z_order
) as a
WHERE
a.type!='construction' and (a.construction!='yes' OR a.construction IS NULL)
) AS data
advanced:
extent_from_subquery: 'true'
- id: ferry
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way, route, name, z_order FROM planet_osm_line WHERE route IS NOT NULL AND route='ferry' ORDER BY z_order) as ferry"
advanced:
extent_from_subquery: 'true'
- id: railway
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way, tunnel, bridge, railway, service, CASE WHEN railway in ('spur','siding') or (railway='rail' and service in ('spur','siding','yard')) THEN 'yard' WHEN railway='disused' THEN 'disused' WHEN railway='rail' THEN 'main' ELSE 'other' END AS type FROM planet_osm_line WHERE railway IS NOT NULL AND railway!='abandoned' ORDER BY z_order) as rail"
advanced:
extent_from_subquery: 'true'
- id: roads_med
<<: *extents
Datasource:
<<: *postgis
table: >-
( SELECT way, highway AS type
FROM planet_osm_roads
WHERE highway IN ('motorway', 'trunk', 'primary', 'secondary',
'motorway_link', 'trunk_link')
) AS data
advanced:
extent_from_subquery: 'true'
- id: roads_low
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT way, highway AS type, bridge, tunnel
FROM planet_osm_roads
WHERE highway IN ('motorway', 'trunk')
) AS data
advanced:
extent_from_subquery: 'true'
- id: turning_circle_fill
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way \n FROM planet_osm_point\n WHERE highway = 'turning_circle'\n) AS data"
advanced:
extent_from_subquery: 'true'
- id: barrier_lines
<<: *extents
class: barriers
Datasource:
<<: *postgis
table: '(select way, barrier from planet_osm_line where barrier is not null) as data'
advanced:
extent_from_subquery: 'true'
- id: barrier_areas
<<: *extents
class: barriers
Datasource:
<<: *postgis
table: |-
( SELECT
way,barrier,"natural"
FROM
planet_osm_polygon
WHERE
barrier IS NOT NULL OR "natural"='hedge'
) AS barriers
advanced:
extent_from_subquery: 'true'
- id: power-poly
<<: *extents
class: power-poi
Datasource:
<<: *postgis
table: "(SELECT way, power AS type, tags->'generator:source' AS source, name FROM planet_osm_polygon WHERE power IS NOT NULL) as data"
advanced:
extent_from_subquery: 'true'
- id: power-line
<<: *extents
Datasource:
<<: *postgis
table: "(SELECT way, power AS type, tags->'generator:source' AS source, name FROM planet_osm_line WHERE power IS NOT NULL) as data"
advanced:
extent_from_subquery: 'true'
- id: power-point
<<: *extents
class: power-poi
Datasource:
<<: *postgis
table: "(SELECT way, power AS type, tags->'generator:source' AS source, name FROM planet_osm_point WHERE power IS NOT NULL) as data"
advanced:
extent_from_subquery: 'true'
- id: airport-point
<<: *extents
class: airport
Datasource:
<<: *postgis
table: "(select way,name,CASE WHEN tags ? 'iata' THEN 'airport' WHEN aeroway='aerodrome' THEN 'airfield' ELSE null END AS aeroway FROM planet_osm_point WHERE aeroway='aerodrome') as data"
advanced:
extent_from_subquery: 'true'
- id: airport-poly
<<: *extents
class: airport
Datasource:
<<: *postgis
table: "(select way,name,CASE WHEN tags ? 'iata' THEN 'airport' WHEN aeroway='aerodrome' THEN 'airfield' ELSE null END AS aeroway FROM planet_osm_polygon WHERE aeroway='aerodrome') as data"
advanced:
extent_from_subquery: 'true'
- id: poi-point
<<: *extents
class: poi
Datasource:
<<: *postgis
table: |-
( SELECT
way, name, COALESCE(amenity, leisure, shop, tourism, office, highway, tags->'emergency', barrier) AS main, man_made, religion,
CASE WHEN shop IS NOT NULL AND shop!='no' THEN shop ELSE NULL END AS shop,
tags->'craft' as craft, tags->'pump' as pump, tags->'drinking_water' as drinking_water, "tower:type", power, tags->'content' AS content, lower(operator) AS operator
FROM
planet_osm_point
WHERE
amenity IS NOT NULL OR shop IS NOT NULL OR tags ? 'craft'
OR tourism IN ('alpine_hut','camp_site','caravan_site','guest_house','hostel','hotel','motel','museum','viewpoint','bed_and_breakfast','information','chalet')
OR highway IN ('bus_stop','traffic_signals','ford', 'street_lamp')
OR man_made IN ('mast','water_tower', 'tower', 'water_well', 'watermill', 'storage_tank')
OR historic IN ('memorial','archaeological_site')
OR leisure IN ('playground','slipway', 'beach_resort')
OR office IN ('ngo', 'government') OR tags @> hstore ('emergency', 'fire_hydrant')
OR power IN ('generator', 'sub_station', 'tower', 'pole') OR barrier IN ('border_control')
) AS data
advanced:
extent_from_subquery: 'true'
- id: poi-poly
<<: *extents
class: poi
Datasource:
<<: *postgis
table: |-
( SELECT
way, name, COALESCE(amenity, leisure, shop, tourism, office, highway, tags->'emergency', barrier) AS main, man_made, religion,
CASE WHEN shop IS NOT NULL AND shop!='no' THEN shop ELSE NULL END AS shop,
tags->'craft' as craft, tags->'pump' as pump, tags->'drinking_water' as drinking_water, "tower:type",
power, tags->'content' AS content, lower(operator) AS operator
FROM
planet_osm_polygon
WHERE
amenity IS NOT NULL OR shop IS NOT NULL
OR tourism IN ('alpine_hut','camp_site','caravan_site','guest_house','hostel','hotel','motel','museum','viewpoint','bed_and_breakfast','information','chalet')
OR highway IN ('bus_stop','traffic_signals') OR historic in ('memorial','archaeological_site') OR leisure='playground'
OR power IN ('plant', 'sub_station') OR office IN ('ngo', 'government')
) AS data
advanced:
extent_from_subquery: 'true'
- id: low_place
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way, CASE WHEN place='country' THEN 1 WHEN capital='yes' AND admin_level='2' THEN 10 WHEN place='state' THEN 20 WHEN place='city' THEN 21 WHEN place='town' THEN 30 ELSE 100 END as prio, place AS type, name, z_order, CASE WHEN population ~ E'^\\d{1,9}$' THEN population::integer ELSE NULL END AS population, CASE WHEN capital='yes' AND admin_level='2' THEN 'country' ELSE NULL END AS is_capital FROM planet_osm_point WHERE place in ('country', 'state', 'city', 'town') AND place IS NOT NULL ORDER BY prio, population DESC NULLS LAST) AS data"
advanced:
extent_from_subquery: 'true'
- id: place
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way, CASE WHEN place='country' THEN 1 WHEN capital='yes' AND admin_level='2' THEN 10 WHEN place='state' THEN 20 WHEN place='town' THEN 30 WHEN place='village' THEN 40 ELSE 100 END as prio, place AS type, name, z_order, CASE WHEN population ~ E'^\\d{1,9}$' THEN population::integer ELSE NULL END AS population, CASE WHEN capital='yes' AND admin_level='2' THEN 'country' ELSE NULL END AS is_capital FROM planet_osm_point WHERE place in ('country', 'state', 'city', 'town', 'village', 'hamlet', 'suburb', 'neighbourhood', 'locality') AND place IS NOT NULL ORDER BY prio, population DESC NULLS LAST) AS data"
advanced:
extent_from_subquery: 'true'
- id: area_label
<<: *extents
Datasource:
<<: *postgis
table: '( SELECT COALESCE(landuse, leisure, "natural", highway, amenity, tourism) AS type, name, way_area AS area, ST_PointOnSurface(way) AS way FROM planet_osm_polygon WHERE name IS NOT NULL AND (landuse IS NOT NULL OR leisure IS NOT NULL OR "natural" IS NOT NULL) AND way && !bbox! AND ST_IsValid(way) ORDER BY area DESC) AS data'
advanced:
extent_from_subquery: 'true'
- id: motorway_label
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way, highway AS type, name, ref, CASE WHEN oneway IN ('yes', '-1') THEN oneway ELSE 'no' END AS oneway, CHAR_LENGTH(ref) AS reflen FROM planet_osm_line WHERE highway IN ('motorway', 'trunk') AND (name IS NOT NULL OR ref IS NOT NULL)) AS data"
advanced:
extent_from_subquery: 'true'
- id: mainroad_label
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way, highway AS type, name, CASE WHEN oneway IN ('yes', '-1') THEN oneway ELSE 'no' END AS oneway FROM planet_osm_line WHERE (name IS NOT NULL OR oneway IN ('yes', '-1')) AND highway IN ('primary', 'secondary', 'tertiary')) AS data"
advanced:
extent_from_subquery: 'true'
- id: minorroad_label
<<: *extents
Datasource:
<<: *postgis
table: >-
( SELECT way, highway AS type, name, CASE WHEN oneway IN ('yes', '-1')
THEN oneway ELSE 'no' END AS oneway FROM planet_osm_line WHERE (name IS
NOT NULL OR oneway IN ('yes', '-1')) AND highway IN ('residential',
'unclassified', 'road', 'living_street', 'unknown')
) AS data
advanced:
extent_from_subquery: 'true'
- id: admin-label-5-10
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
ST_Intersection(p.way, !bbox!) AS way, name, cast(regexp_replace(admin_level,'[^0-9]','','g') AS integer) AS admin_level
FROM
planet_osm_polygon p
WHERE
ST_Intersects(p.way,!bbox!) AND not ST_Covers(p.way, !bbox!)
AND boundary='administrative' AND admin_level IN ('5', '6', '7', '8', '9', '10')
ORDER BY
admin_level
) AS data
advanced:
extent_from_subquery: 'true'
- id: admin-label-1-4
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
ST_Intersection(p.way, !bbox!) AS way, name, cast(regexp_replace(admin_level,'[^0-9]','','g') AS integer) AS admin_level
FROM
planet_osm_polygon p
WHERE
ST_Intersects(p.way, !bbox!) AND not ST_Covers(p.way, !bbox!)
AND boundary='administrative' AND admin_level IN ('0', '2', '3', '4')
ORDER BY
admin_level
) AS data
advanced:
extent_from_subquery: 'true'
- id: waterway_label
<<: *extents
Datasource:
<<: *postgis
table: "( SELECT way, waterway AS type, name\n FROM planet_osm_line\n WHERE waterway IN ('canal', 'river', 'stream') \n AND name IS NOT NULL\n) AS data"
advanced:
extent_from_subquery: 'true'
- id: natural_point_label
<<: *extents
Datasource:
<<: *postgis
table: |-
( SELECT
way, "natural" AS type, name,
CASE WHEN ele ~ E'^\\d{1,5}$' THEN ele::integer ELSE null END as ele
FROM
planet_osm_point
WHERE
"natural" IS NOT NULL AND "natural" IN ('peak', 'bay', 'volcano')
ORDER BY ele DESC NULLS LAST
) AS data
advanced:
extent_from_subquery: 'true'
- id: housenumber
<<: *extents
Datasource:
<<: *postgis
table: " (select way,\"addr:housenumber\" AS housenumber, CASE WHEN \"addr:housenumber\" ~ E'^\\d+$' AND mod(\"addr:housenumber\"::bigint, 5) IN (0, 1) THEN 'yes' ELSE 'no' END AS mod5 FROM planet_osm_polygon WHERE \"addr:housenumber\" IS NOT NULL AND building IS NOT NULL UNION SELECT way,\"addr:housenumber\" AS housenumber, CASE WHEN \"addr:housenumber\" ~ E'^\\d+$' AND mod(\"addr:housenumber\"::bigint, 5) IN (0, 1) THEN 'yes' ELSE 'no' END AS mod5 FROM planet_osm_point WHERE \"addr:housenumber\" IS NOT NULL) as data"
advanced:
extent_from_subquery: 'true'
scale: 1
metatile: 8
attribution: 'Data © OpenStreetMap (and) contributors under ODbL 1.0'
description: ''
name: hdm
compareUrl: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png'