forked from hans/Nominatim
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.
This commit is contained in:
@@ -253,7 +253,8 @@ BEGIN
|
|||||||
FOR linked_placex IN
|
FOR linked_placex IN
|
||||||
SELECT placex.* from placex
|
SELECT placex.* from placex
|
||||||
WHERE make_standard_name(name->'name') = bnd_name
|
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.osm_type = 'N'
|
||||||
AND placex.rank_search < 26 -- needed to select the right index
|
AND placex.rank_search < 26 -- needed to select the right index
|
||||||
AND _st_covers(bnd.geometry, placex.geometry)
|
AND _st_covers(bnd.geometry, placex.geometry)
|
||||||
|
|||||||
Reference in New Issue
Block a user