diff --git a/README.md b/README.md index a6d0cd33..70f28343 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Layers can be chosen to create a **Tileset** like the `openmaptiles.yaml` tilese - [housenumber](https://github.com/openmaptiles/openmaptiles/wiki/housenumber) - [landcover](https://github.com/openmaptiles/openmaptiles/wiki/landcover) - [landuse](https://github.com/openmaptiles/openmaptiles/wiki/landuse) +- [aeroway](https://github.com/openmaptiles/openmaptiles/wiki/aeroway) - [place](https://github.com/openmaptiles/openmaptiles/wiki/place) - [poi](https://github.com/openmaptiles/openmaptiles/wiki/poi) - [park](https://github.com/openmaptiles/openmaptiles/wiki/park) diff --git a/layers/aeroway/aeroway.yaml b/layers/aeroway/aeroway.yaml new file mode 100644 index 00000000..66d7ff45 --- /dev/null +++ b/layers/aeroway/aeroway.yaml @@ -0,0 +1,26 @@ +layer: + id: "aeroway" + description: | + Aeroway polygons based of OpenStreetMap [aeroways](http://wiki.openstreetmap.org/wiki/Aeroways). + Airport buildings are contained in the **building** layer but all + other airport related polygons can be found in the **aeroway** layer. + buffer_size: 4 + fields: + class: + description: | + The original value of the [`aeroway`](http://wiki.openstreetmap.org/wiki/Key:aeroway) tag. + values: + - aerodrome + - heliport + - runway + - helipad + - taxiway + - apron + datasource: + geometry_field: geometry + query: (SELECT geometry, class FROM layer_aeroway(!bbox!, z(!scale_denominator!))) AS t +schema: + - ./layer.sql +datasources: + - type: imposm3 + mapping_file: ./mapping.yaml diff --git a/layers/aeroway/layer.sql b/layers/aeroway/layer.sql new file mode 100644 index 00000000..606eb245 --- /dev/null +++ b/layers/aeroway/layer.sql @@ -0,0 +1,20 @@ +-- etldoc: layer_aeroway[shape=record fillcolor=lightpink, style="rounded,filled", +-- etldoc: label="layer_aeroway | z12| z13| z14+" ]; + +CREATE OR REPLACE FUNCTION layer_aeroway(bbox geometry, zoom_level int) +RETURNS TABLE(geometry geometry, class text) AS $$ + SELECT geometry, aeroway AS class FROM ( + -- etldoc: aeroway_z12 -> layer_aeroway:z12 + SELECT geometry, aeroway + FROM osm_aeroway_polygon_gen2 WHERE zoom_level = 12 + UNION ALL + -- etldoc: aeroway_z13 -> layer_aeroway:z13 + SELECT geometry, aeroway + FROM osm_aeroway_polygon_gen1 WHERE zoom_level = 13 + UNION ALL + -- etldoc: aeroway_z14 -> layer_aeroway:z14_ + SELECT geometry, aeroway + FROM osm_aeroway_polygon WHERE zoom_level >= 14 + ) AS zoom_levels + WHERE geometry && bbox; +$$ LANGUAGE SQL IMMUTABLE; diff --git a/layers/aeroway/mapping.yaml b/layers/aeroway/mapping.yaml new file mode 100644 index 00000000..6618c641 --- /dev/null +++ b/layers/aeroway/mapping.yaml @@ -0,0 +1,34 @@ +generalized_tables: + # etldoc: imposm3 -> osm_landcover_polygon_gen2 + aeroway_polygon_gen2: + source: aeroway_polygon_gen1 + sql_filter: area>240000 + tolerance: 50.0 + + # etldoc: imposm3 -> osm_aeroway_polygon_gen1 + aeroway_polygon_gen1: + source: aeroway_polygon + sql_filter: area>60000 + tolerance: 20.0 +tables: + # etldoc: imposm3 -> osm_aeroway_polygon + aeroway_polygon: + type: polygon + fields: + - name: osm_id + type: id + - name: geometry + type: geometry + - name: aeroway + key: aeroway + type: string + - name: area + type: pseudoarea + mapping: + aeroway: + - aerodrome + - heliport + - runway + - helipad + - taxiway + - apron diff --git a/layers/boundary/boundary.yaml b/layers/boundary/boundary.yaml index 02cb7237..29dec595 100644 --- a/layers/boundary/boundary.yaml +++ b/layers/boundary/boundary.yaml @@ -10,7 +10,13 @@ layer: admin_level: | OSM [admin_level](http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative#admin_level) indicating the level of importance of this boundary. + The `admin_level` corresponds to the lowest `admin_level` + the line participates in. At low zoom levels the Natural Earth boundaries are mapped to the equivalent admin levels. + disputed: + description: | + Mark with `1` if the boundary is disputed. + values: [0, 1] buffer_size: 4 datasource: geometry_field: geometry diff --git a/layers/building/mapping.yaml b/layers/building/mapping.yaml index 92703599..e4489f09 100644 --- a/layers/building/mapping.yaml +++ b/layers/building/mapping.yaml @@ -37,6 +37,10 @@ tables: - __any__ building: - __any__ + # these aeroway polygons all imply building=yes + aeroway: + - terminal + - hangar filters: exclude_tags: - [ "building", "no" ] diff --git a/layers/transportation/class.sql b/layers/transportation/class.sql index 20078e80..1d51c868 100644 --- a/layers/transportation/class.sql +++ b/layers/transportation/class.sql @@ -18,7 +18,8 @@ CREATE OR REPLACE FUNCTION highway_class(highway TEXT) RETURNS TEXT AS $$ WHEN highway IN ('tertiary', 'tertiary_link') THEN 'tertiary' WHEN highway IN ('unclassified', 'residential', 'living_street', 'road') THEN 'minor' WHEN highway IN ('service', 'track') THEN highway - WHEN highway IN ('pedestrian', 'path', 'footway', 'cycleway', 'steps') THEN 'path' + WHEN highway IN ('pedestrian', 'path', 'footway', 'cycleway', 'steps', 'bridleway', 'corridor') THEN 'path' + WHEN highway = 'raceway' THEN 'raceway' ELSE NULL END; $$ LANGUAGE SQL IMMUTABLE STRICT; diff --git a/layers/transportation/layer.sql b/layers/transportation/layer.sql index a0d0356d..0e431f9b 100644 --- a/layers/transportation/layer.sql +++ b/layers/transportation/layer.sql @@ -15,7 +15,8 @@ RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text, ramp END AS class, COALESCE(NULLIF(highway,''), NULLIF(railway, '')) AS subclass, -- All links are considered as ramps as well - CASE WHEN highway_is_link(highway) THEN 1 ELSE is_ramp::int END AS ramp, + CASE WHEN highway_is_link(highway) OR highway = 'steps' + THEN 1 ELSE is_ramp::int END AS ramp, is_oneway::int AS oneway, brunnel(is_bridge, is_tunnel, is_ford) AS brunnel, NULLIF(service, '') AS service diff --git a/layers/transportation/mapping.yaml b/layers/transportation/mapping.yaml index 2757a0fa..7f637474 100644 --- a/layers/transportation/mapping.yaml +++ b/layers/transportation/mapping.yaml @@ -129,7 +129,6 @@ tables: - road - living_street - raceway - - construction - track - service - path @@ -137,8 +136,8 @@ tables: - bridleway - footway - corridor - - crossing - pedestrian + - steps # etldoc: imposm3 -> osm_railway_linestring railway_linestring: diff --git a/openmaptiles.yaml b/openmaptiles.yaml index c8dc29de..828f59ac 100644 --- a/openmaptiles.yaml +++ b/openmaptiles.yaml @@ -13,6 +13,7 @@ tileset: - layers/landcover/landcover.yaml - layers/park/park.yaml - layers/landuse/landuse.yaml + - layers/aeroway/aeroway.yaml name: OpenMapTiles v1.0 description: "A tileset showcasing all layers in OpenMapTiles. http://openmaptiles.org" attribution: "© OpenStreetMap contributors"