]> git.openstreetmap.org Git - nominatim.git/commitdiff
when linking always check against original address rank
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 11 Oct 2020 10:29:49 +0000 (12:29 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 11 Oct 2020 10:29:49 +0000 (12:29 +0200)
sql/functions/placex_triggers.sql

index 8c9cfae120bf9666e7e35c1b964f78efb0fc6704..1f664a4a5531924a68e16709b8de4f33373af5c9 100644 (file)
@@ -211,7 +211,11 @@ BEGIN
     FOR linked_placex IN
       SELECT placex.* from placex
       WHERE make_standard_name(name->'name') = bnd_name
-        AND ((bnd.rank_address > 0 and placex.rank_address = bnd.rank_address)
+        AND ((bnd.rank_address > 0
+              and bnd.rank_address = (compute_place_rank(placex.country_code,
+                                                         'N', placex.class,
+                                                         placex.type, 15::SMALLINT,
+                                                         false, placex.postcode)).address_rank)
              OR (bnd.rank_address = 0 and placex.rank_search = bnd.rank_search))
         AND placex.osm_type = 'N'
         AND placex.rank_search < 26 -- needed to select the right index