From 3db2b05069d68f8703a696273f4fdfc9fe6a445e Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 21 Mar 2020 21:57:04 +0100 Subject: [PATCH] linking: better name matching for address-less places Administrative boundaries that do not figure in the address should still be able to take part in the name matching. Use the rank_search for comparison in this case. --- sql/functions/placex_triggers.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/functions/placex_triggers.sql b/sql/functions/placex_triggers.sql index d23d39d2..b868d267 100644 --- a/sql/functions/placex_triggers.sql +++ b/sql/functions/placex_triggers.sql @@ -253,7 +253,8 @@ BEGIN FOR linked_placex IN SELECT placex.* from placex WHERE make_standard_name(name->'name') = bnd_name - AND placex.rank_address = bnd.rank_address + AND ((bnd.rank_address > 0 and placex.rank_address = bnd.rank_address) + 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 AND _st_covers(bnd.geometry, placex.geometry) -- 2.39.5