From d4e116558cbc4bf91a5b4b89ce741901a508b629 Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 2 Dec 2016 07:45:17 +0000 Subject: [PATCH 1/6] Add disputed to boundary docs #83 --- layers/boundary/boundary.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layers/boundary/boundary.yaml b/layers/boundary/boundary.yaml index 02cb723..29dec59 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 From 463be2d48b7a9f088857d1498b0e49c6d9d07e80 Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 2 Dec 2016 10:59:13 +0000 Subject: [PATCH 2/6] Add aeroway layer --- layers/aeroway/aeroway.yaml | 26 ++++++++++++++++++++++++++ layers/aeroway/layer.sql | 20 ++++++++++++++++++++ layers/aeroway/mapping.yaml | 34 ++++++++++++++++++++++++++++++++++ openmaptiles.yaml | 1 + 4 files changed, 81 insertions(+) create mode 100644 layers/aeroway/aeroway.yaml create mode 100644 layers/aeroway/layer.sql create mode 100644 layers/aeroway/mapping.yaml 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/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" From 81b93d6a1543678a9b78054da85ae42faf9551ed Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 2 Dec 2016 10:59:31 +0000 Subject: [PATCH 3/6] Map aeroway buildings implying building=yes --- layers/building/mapping.yaml | 4 ++++ 1 file changed, 4 insertions(+) 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" ] From 2250d140df7595baa14c0ec8eebf59e5a5b2a71b Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 2 Dec 2016 11:12:59 +0000 Subject: [PATCH 4/6] Add missing classes for raceway, bridleway, corridor #82 --- layers/transportation/class.sql | 3 ++- layers/transportation/mapping.yaml | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/layers/transportation/class.sql b/layers/transportation/class.sql index 20078e8..1d51c86 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/mapping.yaml b/layers/transportation/mapping.yaml index 2757a0f..1f636c0 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,7 +136,6 @@ tables: - bridleway - footway - corridor - - crossing - pedestrian # etldoc: imposm3 -> osm_railway_linestring From 3e229a7b3c010d73e134accc3c4b1aa5ac7670ee Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 2 Dec 2016 11:14:45 +0000 Subject: [PATCH 5/6] Map highway=step. Fixes #84 --- layers/transportation/layer.sql | 3 ++- layers/transportation/mapping.yaml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/layers/transportation/layer.sql b/layers/transportation/layer.sql index a0d0356..0e431f9 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 1f636c0..7f63747 100644 --- a/layers/transportation/mapping.yaml +++ b/layers/transportation/mapping.yaml @@ -137,6 +137,7 @@ tables: - footway - corridor - pedestrian + - steps # etldoc: imposm3 -> osm_railway_linestring railway_linestring: From 7e49a7ebfc58a8de90b89ed78db85f84f5b0948a Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 2 Dec 2016 12:18:33 +0000 Subject: [PATCH 6/6] Add aeroway to README --- README.md | 1 + layers/aeroway/layer.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a6d0cd3..70f2834 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/layer.sql b/layers/aeroway/layer.sql index d45ac35..606eb24 100644 --- a/layers/aeroway/layer.sql +++ b/layers/aeroway/layer.sql @@ -1,5 +1,5 @@ -- etldoc: layer_aeroway[shape=record fillcolor=lightpink, style="rounded,filled", --- etldoc: label="layer_aeroway | z12| z13| z14" ]; +-- 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 $$