[gdal-dev] Topological Union?

Brent Fraser bfraser at geoanalytic.com
Fri Aug 29 10:53:18 EDT 2008


  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,

More information about the gdal-dev mailing list