mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 10:57:58 +00:00
change distance computation between place and address part
Instead of computing the distance to the centroid of the area compute the distance of the area to the centroid of the feature. This means we give preference to the area that covers the centroid. It's still a heuristics but one that is a bit less random.
This commit is contained in:
@@ -34,7 +34,7 @@ BEGIN
|
||||
NEW.parent_place_id = 0;
|
||||
FOR location IN
|
||||
SELECT place_id
|
||||
FROM getNearFeatures(partition, NEW.geometry, NEW.rank_search)
|
||||
FROM getNearFeatures(partition, NEW.geometry, NEW.geometry, NEW.rank_search)
|
||||
WHERE NOT isguess ORDER BY rank_address DESC, distance asc LIMIT 1
|
||||
LOOP
|
||||
NEW.parent_place_id = location.place_id;
|
||||
|
||||
Reference in New Issue
Block a user