From 60b4a4cebca9f0417f87d20cf405663ec027e4c4 Mon Sep 17 00:00:00 2001 From: Eva J Date: Wed, 27 Nov 2019 11:51:15 +0100 Subject: [PATCH] removing ne_10m source --- layers/landuse/landuse.sql | 19 +++++++++++++------ layers/landuse/mapping.yaml | 9 +++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/layers/landuse/landuse.sql b/layers/landuse/landuse.sql index 7a5d4aab..1a55c384 100644 --- a/layers/landuse/landuse.sql +++ b/layers/landuse/landuse.sql @@ -11,10 +11,16 @@ CREATE OR REPLACE VIEW landuse_z5 AS ( FROM ne_50m_urban_areas ); --- etldoc: ne_10m_urban_areas -> landuse_z6 +-- etldoc: osm_landuse_polygon_gen5 -> landuse_z6 CREATE OR REPLACE VIEW landuse_z6 AS ( - SELECT NULL::bigint AS osm_id, geometry, 'residential'::text AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS tourism, NULL::text AS place, NULL::text AS waterway, scalerank - FROM ne_10m_urban_areas + SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank + FROM osm_landuse_polygon_gen7 +); + +-- etldoc: osm_landuse_polygon_gen5 -> landuse_z8 +CREATE OR REPLACE VIEW landuse_z8 AS ( + SELECT osm_id, geometry, landuse, amenity, leisure, tourism, place, waterway, NULL::int as scalerank + FROM osm_landuse_polygon_gen6 ); -- etldoc: osm_landuse_polygon_gen5 -> landuse_z9 @@ -78,9 +84,10 @@ RETURNS TABLE(osm_id bigint, geometry geometry, class text) AS $$ UNION ALL -- etldoc: landuse_z6 -> layer_landuse:z6 -- etldoc: landuse_z6 -> layer_landuse:z7 - -- etldoc: landuse_z6 -> layer_landuse:z8 - SELECT * FROM landuse_z6 - WHERE zoom_level BETWEEN 6 AND 8 AND scalerank-1 <= zoom_level + SELECT * FROM landuse_z6 WHERE zoom_level BETWEEN 6 AND 7 + UNION ALL + -- etldoc: landuse_z8 -> layer_landuse:z8 + SELECT * FROM landuse_z8 WHERE zoom_level = 8 UNION ALL -- etldoc: landuse_z9 -> layer_landuse:z9 SELECT * FROM landuse_z9 WHERE zoom_level = 9 diff --git a/layers/landuse/mapping.yaml b/layers/landuse/mapping.yaml index 2eb0fc64..2ef0f756 100644 --- a/layers/landuse/mapping.yaml +++ b/layers/landuse/mapping.yaml @@ -1,4 +1,13 @@ generalized_tables: + # etldoc: imposm3 -> osm_landuse_polygon_gen7 + landuse_polygon_gen7: + source: landuse_polygon_gen6 + tolerance: ZRES7 + # etldoc: imposm3 -> osm_landuse_polygon_gen6 + landuse_polygon_gen6: + source: landuse_polygon_gen5 + sql_filter: area>power(ZRES6,2) AND (landuse='residential' OR place='suburb' OR place='neighbourhood') + tolerance: ZRES8 # etldoc: imposm3 -> osm_landuse_polygon_gen5 landuse_polygon_gen5: source: landuse_polygon_gen4