mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
use computed centroid for location_area_large
The new address computation assumes that the centroid is inside the area. Therefore we cannot use the centroid function. Use the pre-computed centroid instead which has already been corrected to be inside the area.
This commit is contained in:
@@ -801,7 +801,8 @@ BEGIN
|
||||
IF NEW.rank_search <= 25 and NEW.rank_address > 0 THEN
|
||||
result := add_location(NEW.place_id, NEW.country_code, NEW.partition,
|
||||
name_vector, NEW.rank_search, NEW.rank_address,
|
||||
upper(trim(NEW.address->'postcode')), NEW.geometry);
|
||||
upper(trim(NEW.address->'postcode')), NEW.geometry,
|
||||
NEW.centroid);
|
||||
--DEBUG: RAISE WARNING 'Place added to location table';
|
||||
END IF;
|
||||
|
||||
@@ -932,7 +933,7 @@ BEGIN
|
||||
IF NEW.name IS NOT NULL THEN
|
||||
|
||||
IF NEW.rank_search <= 25 and NEW.rank_address > 0 THEN
|
||||
result := add_location(NEW.place_id, NEW.country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, upper(trim(NEW.address->'postcode')), NEW.geometry);
|
||||
result := add_location(NEW.place_id, NEW.country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, upper(trim(NEW.address->'postcode')), NEW.geometry, NEW.centroid);
|
||||
--DEBUG: RAISE WARNING 'added to location (full)';
|
||||
END IF;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user