Do not have postcode node appear in addresses directly

Many of the postcode nodes are actually derived from
incomplete addresses and are as such not even centroids.
Better let them only take part in the address computation
via the postcode table.
This commit is contained in:
Sarah Hoffmann
2018-07-22 16:22:07 +02:00
parent 9bdbbec0c8
commit 48d4ea5542
5 changed files with 89 additions and 19 deletions

View File

@@ -864,6 +864,10 @@ BEGIN
SELECT * FROM get_postcode_rank(NEW.country_code, NEW.address->'postcode')
INTO NEW.rank_search, NEW.rank_address;
IF NOT ST_GeometryType(NEW.geometry) IN ('ST_Polygon','ST_MultiPolygon') THEN
NEW.rank_address := 0;
END IF;
ELSEIF NEW.class = 'place' THEN
IF NEW.type in ('continent') THEN
NEW.rank_search := 2;