[postgis-users] How can I convert a geometry column to polygons

Eric Lam elam at lisasoft.com
Thu May 18 23:23:57 PDT 2006


Brent Wood wrote:

>I have a table with a polygon geometry table. I want to select a subset of the
>polygons via an area, which is defined by another polygon.
>
>I can sort of get the result using intersection() but the result is a set of
>geometries, not polygons. 
>
>How can I turn these into polygons?
>
>Thanks,
>
>  Brent Wood
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>  
>
This does not return the same result as the functin intersection(), at 
lest I don't think so.

this finds every polygon which intersects with the polygon of gid = 1.
select the_geom from polyTable where the_geom && (select the_geom from 
polyTable where gid=1);

that probably did not help

or you could try the following functions
MakeLine(geometry set)
MakePolygon(linestring, [linestring[]])
 or
Polygonize(geometry set)

I have not tried these funcitons myself but they might do what you want.

Regards
Eric Lam



More information about the postgis-users mailing list