always compute guessed postcode for POIs from centroid

When guessing postcodes from the area, only postcodes within
that area are accepted. For POIs that is usually not what we
want as the postcode would have to be within a house for
example.

Fixes #2301.
This commit is contained in:
Sarah Hoffmann
2021-05-26 11:04:02 +02:00
parent 7d9665d8d2
commit f74dc38766

View File

@@ -911,7 +911,7 @@ BEGIN
-- determine postcode
NEW.postcode := coalesce(token_normalized_postcode(NEW.address->'postcode'),
location.postcode,
get_nearest_postcode(NEW.country_code, NEW.geometry));
get_nearest_postcode(NEW.country_code, NEW.centroid));
IF NEW.name is not NULL THEN
NEW.name := add_default_place_name(NEW.country_code, NEW.name);