From: Sarah Hoffmann Date: Fri, 6 Feb 2015 20:05:37 +0000 (+0100) Subject: remove address lines with fully duplicated keywords X-Git-Tag: v2.4.0~38 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/0de6f37647d0dced5a44b5cafe503253602c53e9 remove address lines with fully duplicated keywords Mainly there to avoid having many duplicated postcode entries in place_addressline from nodes which have tags where only addr:postcode is recognized by Nominatim (e.g. fire hydrants). --- diff --git a/sql/functions.sql b/sql/functions.sql index fc83f9a1..c46b3cf6 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1247,6 +1247,7 @@ DECLARE location_distance FLOAT; location_parent GEOMETRY; location_isaddress BOOLEAN; + location_keywords INTEGER[]; tagpairid INTEGER; @@ -1794,9 +1795,12 @@ BEGIN IF location.rank_address != location_rank_search THEN location_rank_search := location.rank_address; location_distance := location.distance * 1.5; + ELSE + CONTINUE WHEN location.keywords <@ location_keywords; END IF; IF location.distance < location_distance OR NOT location.isguess THEN + location_keywords := location.keywords; location_isaddress := NOT address_havelevel[location.rank_address]; IF location_isaddress AND location.isguess AND location_parent IS NOT NULL THEN