From f74dc38766ea786b0419bae8de7791b70171841d Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 26 May 2021 11:04:02 +0200 Subject: [PATCH] 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. --- lib-sql/functions/placex_triggers.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5