From a76b5e9331a48153fe0bd19b4b2eabb591269246 Mon Sep 17 00:00:00 2001 From: lukasmartinelli Date: Tue, 28 Jun 2016 08:09:37 +0200 Subject: [PATCH] Use pseudoarea in landuse --- src/import-osm/mapping.yml | 8 +++++--- src/import-sql/indizes.sql | 3 --- src/import-sql/layers/landuse.sql | 10 +++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/import-osm/mapping.yml b/src/import-osm/mapping.yml index e23c7ac..d7b9d1c 100644 --- a/src/import-osm/mapping.yml +++ b/src/import-osm/mapping.yml @@ -2,15 +2,15 @@ use_single_id_space: true generalized_tables: landuse_polygon_gen0: source: landuse_polygon_gen1 - sql_filter: ST_Area(geometry)>500000.000000 + sql_filter: area>500000.000000 tolerance: 200.0 landuse_polygon_gen1: source: landuse_polygon - sql_filter: ST_Area(geometry)>50000.000000 + sql_filter: area>50000.000000 tolerance: 50.0 water_polygon_gen1: source: water_polygon - sql_filter: ST_Area(geometry)>40000.000000 + sql_filter: area>40000.000000 tolerance: 30.0 building_polygon_gen0: source: building_polygon @@ -326,6 +326,8 @@ tables: type: pbf_timestamp - name: type type: mapping_value + - name: area + type: pseudoarea mapping: landuse: - allotments diff --git a/src/import-sql/indizes.sql b/src/import-sql/indizes.sql index 6808f27..2d2ba2e 100644 --- a/src/import-sql/indizes.sql +++ b/src/import-sql/indizes.sql @@ -1,5 +1,2 @@ DROP INDEX IF EXISTS osm_road_geometry_class; CREATE INDEX osm_road_geometry_class ON osm_road_geometry(road_class(type, service, access)); - -DROP INDEX IF EXISTS osm_landuse_polygon; -CREATE INDEX osm_landuse_polygon_area ON osm_landuse_polygon(ST_Area(geometry)); diff --git a/src/import-sql/layers/landuse.sql b/src/import-sql/layers/landuse.sql index 2b75f34..4f60d70 100644 --- a/src/import-sql/layers/landuse.sql +++ b/src/import-sql/layers/landuse.sql @@ -7,31 +7,31 @@ CREATE OR REPLACE VIEW landuse_z7toz8 AS SELECT id AS osm_id, geometry, type FROM osm_landuse_polygon_gen0 WHERE landuse_class(type) IN ('wood', 'residential') - AND st_area(geometry) > 1000000; + AND area > 1000000; CREATE OR REPLACE VIEW landuse_z9 AS SELECT id AS osm_id, geometry, type FROM osm_landuse_polygon_gen0 WHERE landuse_class(type) IN ('wood', 'residential', 'grass', 'cemetery', 'park', 'school') - AND st_area(geometry) > 500000; + AND area > 500000; CREATE OR REPLACE VIEW landuse_z10 AS SELECT id AS osm_id, geometry, type FROM osm_landuse_polygon_gen0 WHERE landuse_class(type) IN ('wood', 'residential', 'commercial', 'retail', 'railway', 'industrial', 'grass', 'cemetery', 'park', 'school') - AND st_area(geometry) > 99000; + AND area > 99000; CREATE OR REPLACE VIEW landuse_z11 AS SELECT id AS osm_id, geometry, type FROM osm_landuse_polygon_gen1 WHERE landuse_class(type) IN ('wood', 'residential','commercial', 'retail', 'railway', 'industrial', 'military', 'grass', 'cemetery', 'park', 'school', 'hospital') - AND st_area(geometry) > 50000; + AND area > 50000; CREATE OR REPLACE VIEW landuse_z12 AS SELECT id AS osm_id, geometry, type FROM osm_landuse_polygon WHERE landuse_class(type) IN ('wood', 'residential', 'grass','retail', 'railway', 'industrial', 'military', 'cemetery', 'park', 'school', 'hospital') - AND st_area(geometry) > 10000; + AND area > 10000; CREATE OR REPLACE VIEW landuse_z13toz14 AS SELECT id AS osm_id, geometry, type