From 8989776bfda86606be036f08b2b3c6ae01e98958 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 8 Oct 2014 20:47:32 +0200 Subject: [PATCH] remove most landuses from addresses --- sql/functions.sql | 6 +++++- tests/features/db/import/placex.feature | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sql/functions.sql b/sql/functions.sql index dc692804..bc2d6a63 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1107,7 +1107,11 @@ BEGIN END IF; ELSEIF NEW.class = 'landuse' AND ST_GeometryType(NEW.geometry) in ('ST_Polygon','ST_MultiPolygon') THEN NEW.rank_search := 22; - NEW.rank_address := NEW.rank_search; + IF NEW.type in ('residential', 'farm', 'farmyard', 'industrial', 'commercial', 'allotments', 'retail') THEN + NEW.rank_address := NEW.rank_search; + ELSE + NEW.rank_address := 0; + END IF; ELSEIF NEW.class = 'natural' and NEW.type in ('peak','volcano','mountain_range') THEN NEW.rank_search := 18; NEW.rank_address := 0; diff --git a/tests/features/db/import/placex.feature b/tests/features/db/import/placex.feature index a429202a..caa0d175 100644 --- a/tests/features/db/import/placex.feature +++ b/tests/features/db/import/placex.feature @@ -319,6 +319,7 @@ Feature: Import into placex | osm_type | osm_id | class | type | geometry | W | 4 | landuse | residential | poly-area:0.1 | R | 2 | landuse | residential | poly-area:0.05 + | R | 3 | landuse | forrest | poly-area:0.5 When importing Then table placex has no entry for N1 And table placex has no entry for W1 @@ -331,6 +332,7 @@ Feature: Import into placex | W2 | 30 | 30 | W4 | 22 | 22 | R2 | 22 | 22 + | R3 | 22 | 0 Scenario: rank and inclusion of naturals Given the place nodes