[postgis-users] Intersection of several geoms in a table

Markus Schaber schabi at logix-tt.com
Tue May 17 04:20:03 PDT 2005


Hi, Mark,

Mark Fenbers wrote:
> Being new to PostGIS, I haven't figured out how to properly compute the
> Intersection of all 14 records in my table (i.e., compute the region
> that all 14 polygons share in common).
> 
> Since Intersection() only takes 2 geoms as args, I'm a little lost as to
> how I would build a query to do the job.  I wish PostGIS's
> Intersection() function would work with Geometry Sets like the GeomUnion
> function does.  If that were the case, I could do:
> 
> select Intersection( (select the Geom from theGeometries) );
> 
> But since, this is not the case, how do acquire the same results from a
> query?

Maybe you could create your own aggregate using psql and the postgis
intersection() function. If you post the source here, the chances are
high that it will be included into PostGIS. :-)

Markus




More information about the postgis-users mailing list