X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/350bb0e1cdb55c4ca5316fb4cdcb4bc0bc5b43d5..cad44eb00c081ba32da3f97bcefaef49f1ac7f33:/lib-sql/functions/placex_triggers.sql

diff --git a/lib-sql/functions/placex_triggers.sql b/lib-sql/functions/placex_triggers.sql
index 01f99715..9d0d73b5 100644
--- a/lib-sql/functions/placex_triggers.sql
+++ b/lib-sql/functions/placex_triggers.sql
@@ -668,7 +668,7 @@ BEGIN
   NEW.place_id := nextval('seq_place');
   NEW.indexed_status := 1; --STATUS_NEW
 
-  NEW.centroid := ST_PointOnSurface(NEW.geometry);
+  NEW.centroid := get_center_point(NEW.geometry);
   NEW.country_code := lower(get_country_code(NEW.centroid));
 
   NEW.partition := get_partition(NEW.country_code);
@@ -870,7 +870,7 @@ BEGIN
   END IF;
 
   -- Compute a preliminary centroid.
-  NEW.centroid := ST_PointOnSurface(NEW.geometry);
+  NEW.centroid := get_center_point(NEW.geometry);
 
     -- recalculate country and partition
   IF NEW.rank_search = 4 AND NEW.address is not NULL AND NEW.address ? 'country' THEN
