diff --git a/layers/aeroway/aeroway.yaml b/layers/aeroway/aeroway.yaml new file mode 100644 index 0000000..66d7ff4 --- /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 0000000..d45ac35 --- /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 0000000..6618c64 --- /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/building/mapping.yaml b/layers/building/mapping.yaml index 9270359..e4489f0 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/openmaptiles.yaml b/openmaptiles.yaml index c8dc29d..828f59a 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"