]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove address lines with fully duplicated keywords
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 6 Feb 2015 20:05:37 +0000 (21:05 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 9 Feb 2015 18:35:15 +0000 (19:35 +0100)
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).

sql/functions.sql

index fc83f9a171c257d1e5ee949622c502847b6605b7..c46b3cf628470d58e9d07a9327551515436dd95c 100644 (file)
@@ -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