[postgis-users] How to clean a geometrycollections table for pgsql2shp?

Muhammad Imran imranserver at yahoo.com
Thu Nov 24 09:09:52 PST 2011


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 <Pierre.Racine at sbf.ulaval.ca> wrote:

> From: Pierre Racine <Pierre.Racine at sbf.ulaval.ca>
> Subject: [postgis-users] How to clean a geometrycollections table for pgsql2shp?
> To: " (postgis-users at postgis.refractions.net)" <postgis-users at postgis.refractions.net>
> 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
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list