Hi Pierre, You can try st_collectionextract(geometry, integer) to extract polygon geometery by specifying (3 == POLYGON as integer), given your GEOMETRYCOLLECTION of points, lines and polygons.
Regards, Muhammad Imran ITC, The Netherlands --- On Thu, 11/24/11, Pierre Racine <[email protected]> wrote: > From: Pierre Racine <[email protected]> > Subject: [postgis-users] How to clean a geometrycollections table for > pgsql2shp? > To: " ([email protected])" > <[email protected]> > Date: Thursday, November 24, 2011, 10:19 PM > Hi, > > When doing intersections between two tables containing many > polygons the resulting table often contains > geometrycollections of points, polylines and polygons. You > have to clean such a table of point and lines if you want to > export it as a polygon shapefile. > > Isn't there a function in PostGIS to remove line and points > from a table of geometrycollections? > > SELECT ST_ExtractPolygons(geom) FROM mymessyresults ? > > Thanks > > Pierre > _______________________________________________ > 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
