diff --git a/lib-sql/functions/placex_triggers.sql b/lib-sql/functions/placex_triggers.sql index 9d0d73b51..6840f0931 100644 --- a/lib-sql/functions/placex_triggers.sql +++ b/lib-sql/functions/placex_triggers.sql @@ -1162,7 +1162,7 @@ BEGIN -- Use the linked point as the centre point of the geometry, -- but only if it is within the area of the boundary. geom := coalesce(location.centroid, ST_Centroid(location.geometry)); - IF geom is not NULL AND ST_Within(geom, NEW.geometry) THEN + IF geom is not NULL AND ST_Covers(NEW.geometry, geom) THEN NEW.centroid := geom; END IF;