From: Sarah Hoffmann Date: Wed, 26 May 2021 09:04:02 +0000 (+0200) Subject: always compute guessed postcode for POIs from centroid X-Git-Tag: v4.0.0~72 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/f74dc38766ea786b0419bae8de7791b70171841d 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. --- diff --git a/lib-sql/functions/placex_triggers.sql b/lib-sql/functions/placex_triggers.sql index 9a31f3ae..e3be9503 100644 --- a/lib-sql/functions/placex_triggers.sql +++ b/lib-sql/functions/placex_triggers.sql @@ -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);