X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ad1d429de64ac037470f92e0492211a41bd2c613..31126328e984429d8b800f4750be2776fc19488a:/sql/functions.sql?ds=sidebyside

diff --git a/sql/functions.sql b/sql/functions.sql
index 929e5376..ac64defc 100644
--- a/sql/functions.sql
+++ b/sql/functions.sql
@@ -1850,19 +1850,21 @@ BEGIN
         INSERT INTO place_addressline VALUES (NEW.place_id, location.place_id, true, location_isaddress, location.distance, location.rank_address);
 
         IF location_isaddress THEN
-            address_havelevel[location.rank_address] := true;
-            IF NOT location.isguess THEN
-                SELECT geometry FROM placex WHERE place_id = location.place_id INTO location_parent;
-            END IF;
-        END IF;
 
---RAISE WARNING '  Terms: (%) %',location, nameaddress_vector;
+          address_havelevel[location.rank_address] := true;
+          IF NOT location.isguess THEN
+            SELECT geometry FROM placex WHERE place_id = location.place_id INTO location_parent;
+          END IF;
+
+          IF location.rank_address > parent_place_id_rank THEN
+            NEW.parent_place_id = location.place_id;
+            parent_place_id_rank = location.rank_address;
+          END IF;
 
-        IF location.rank_address > parent_place_id_rank THEN
-          NEW.parent_place_id = location.place_id;
-          parent_place_id_rank = location.rank_address;
         END IF;
 
+--RAISE WARNING '  Terms: (%) %',location, nameaddress_vector;
+
       END IF;
 
     END LOOP;
