You probably want to do a ST_Dump as well if you are talking about Multipolygons and also exterior ring returns the linestring -- need to use ST_MakePolygon to turn it back into a polygon
SELECT s.gid, ST_Collect(ST_MakePolygon(s.the_geom)) As the_geom FROM (SELECT gid, ST_ExteriorRing((ST_Dump(the_geom)).geom) As the_geom FROM sometable ) As s GROUP BY gid; Leo -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of strk Sent: Tuesday, November 03, 2009 3:15 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Removing holes from polygons On Tue, Nov 03, 2009 at 02:23:28PM -0500, Akhil Jaggarwal wrote: > Any tips or hints on a query which removes all the inner holes from a > polygon and returns and keeps the geometry of the largest one intact? SELECT ST_ExteriorRing(geometry) ... --strk; Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
