[postgis-users] Using cleangeometry() on only the Multipolygons in a field of type geometry

Pete Yunker peter.yunker at homejunction.com
Mon Jan 24 18:35:52 PST 2011


We have a field of type geometry containing both Multipolygon and Point entities.  How can cleangeometry be used on only the Multipolygons, since cleangeometry cannot be used on a field of type geometry?

The following query fails with "ERROR:  function cleangeometry(geometry) does not exist"

UPDATE prod.mytable
SET the_geom = cleangeometry(the_geom)
WHERE the_geom IS NOT NULL
AND ST_IsValid(the_geom)
AND ST_GeometryType(the_geom) = 'MULTIPOLYGON'
;

Using
8.3.6 PostgreSQL
1.3.6 PostGIS
3.1.0 GEOS
4.6.0 PROJ
1.13.0 GDAL

Thanks,
Pete


More information about the postgis-users mailing list