From b0e6fb73c6ccabbc28464e5a9910ef7bd3293e0e Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 19 Jun 2019 23:16:43 +0200 Subject: [PATCH 1/3] generally remove all country and state places from address Gets rid of the hard-coded expection for place nodes and sets the address rank generally via the address level config instead. That means only administrative boundaries are now used at that level in addresses. --- settings/address-levels.json | 4 ++-- sql/functions.sql | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/settings/address-levels.json b/settings/address-levels.json index c29266ac..8a47f7e5 100644 --- a/settings/address-levels.json +++ b/settings/address-levels.json @@ -3,8 +3,8 @@ "place" : { "sea" : [2, 0], "continent" : [2, 0], - "country" : [4, 4], - "state" : [8, 8], + "country" : [4, 0], + "state" : [8, 0], "region" : [18, 0], "county" : 12, "city" : 16, diff --git a/sql/functions.sql b/sql/functions.sql index 8a5c9bc5..0cfeaf0c 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -887,11 +887,7 @@ BEGIN END IF; -- some postcorrections - IF NEW.class = 'place' THEN - IF NEW.type in ('continent', 'sea', 'country', 'state') AND NEW.osm_type = 'N' THEN - NEW.rank_address := 0; - END IF; - ELSEIF NEW.class = 'waterway' AND NEW.osm_type = 'R' THEN + IF NEW.class = 'waterway' AND NEW.osm_type = 'R' THEN -- Slightly promote waterway relations so that they are processed -- before their members. NEW.rank_search := NEW.rank_search - 1; @@ -908,11 +904,6 @@ BEGIN NEW.country_code := NULL; END IF; --- Block import below rank 22 --- IF NEW.rank_search > 22 THEN --- RETURN NULL; --- END IF; - --DEBUG: RAISE WARNING 'placex_insert:END: % % % %',NEW.osm_type,NEW.osm_id,NEW.class,NEW.type; RETURN NEW; -- %DIFFUPDATES% The following is not needed until doing diff updates, and slows the main index process down From b8f7b3cc8dfe4da04bf3d4c26cf152dc0886665d Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 19 Jun 2019 23:19:52 +0200 Subject: [PATCH 2/3] Remove county places and Regierungsbezirke vom German addresses --- settings/address-levels.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/settings/address-levels.json b/settings/address-levels.json index 8a47f7e5..c13b681b 100644 --- a/settings/address-levels.json +++ b/settings/address-levels.json @@ -83,6 +83,16 @@ "neighbourhood" : [30, 0] } } +}, +{ "countries" : [ "de" ], + "tags" : { + "place" : { + "county" : [12, 0] + }, + "boundary" : { + "administrative5" : [10, 0] + } + } } ] From e164d53fcc6622212a59449e815a66fd89dd7b9f Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 30 Jun 2019 23:09:43 +0200 Subject: [PATCH 3/3] adapt tests to new place address ranks --- test/bdd/db/import/placex.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bdd/db/import/placex.feature b/test/bdd/db/import/placex.feature index 0284736b..f17d09df 100644 --- a/test/bdd/db/import/placex.feature +++ b/test/bdd/db/import/placex.feature @@ -220,8 +220,8 @@ Feature: Import into placex | R21 | 30 | 30 | | R22 | 30 | 30 | | R23 | 30 | 30 | - | R40 | 4 | 4 | - | R41 | 8 | 8 | + | R40 | 4 | 0 | + | R41 | 8 | 0 | Scenario: search and address ranks for highways correctly assigned Given the scene roads-with-pois