ST_PointOnSurface instead of topoint

This commit is contained in:
stirringhalo
2017-01-17 09:03:40 -05:00
parent 0945c5f04c
commit 153976735f
4 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ DROP TRIGGER IF EXISTS trigger_refresh ON poi.updates;
CREATE OR REPLACE FUNCTION convert_poi_point() RETURNS VOID AS $$
BEGIN
UPDATE osm_poi_polygon SET geometry=topoint(geometry) WHERE ST_GeometryType(geometry) <> 'ST_Point';
UPDATE osm_poi_polygon SET geometry=ST_PointOnSurface(geometry) WHERE ST_GeometryType(geometry) <> 'ST_Point';
ANALYZE osm_poi_polygon;
END;
$$ LANGUAGE plpgsql;