Craig,

 I've had limited success with the Union function in Geos (via GDAL).  It's 
slow and fails on large polygon sets (some of my files have 10,000 polygons 
with some convoluted geometry), but if your sets are smaller, it may work.  
FYI, Geos is derived (ported?) from JTS; Martin Davis has a good explanation of 
union strategies at 
http://lin-ear-th-inking.blogspot.com/2007/11/fast-polygon-merging-in-jts-using.html.
  Currently, I'm considering using Geotools (http://geotools.codehaus.org/) as 
a framework to get at the JTS functionality.

 And there are other polygon processing libraries out there.  There's a nice 
summary at http://www.complex-a5.ru/polyboolean/comp.html, but I haven't tried 
any of those yet.

Good Luck!
Brent Fraser

Mateusz Loskot wrote:
Craig Miller wrote:
Thanks Mateusz.  That's exactly what I was thinking of doing if
someone hasn't put it together already.

Craig,

BTW, you don't have to convert OGRGeometry (you play with it when reading Shapefile using OGR) to geos::geom::Geometry.

You can union OGRGeometry using OGRGeometry::Union()
or its C API equivalent OGR_G_Union

These operations are based on GEOSUnion function.

Best regards,
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to