We can use the new geos operations to compute difference and intersection (and possibly other). Algorithms are more robusts and there is less error messages like "no diredge found".
The little patch:
diff -r -N gdal-1.4.0/ogr/ogrgeometry.cpp gdal-1.4.0-fb/ogr/ogrgeometry.cpp
167a168,174
> #ifdef HAVE_GEOS
> #if GEOS_VERSION_MAJOR >= 3
> #include <geos/precision/EnhancedPrecisionOp.h>
> #endif
> #endif
>
>
1724c1731,1735
< hGeosProduct = GEOSIntersection( hThisGeosGeom, hOtherGeosGeom );
---
> #if GEOS_VERSION_MAJOR >= 3
> hGeosProduct = (GEOSGeometry*)geos::precision::EnhancedPrecisionOp::intersection(( geos::geom::Geometry*) hThisGeosGeom, (geos::geom::Geometry*)hOtherGeosGeom );
> #else
> hGeosProduct = GEOSIntersection( hThisGeosGeom, hOtherGeosGeom );
> #endif
1862a1874,1876
> #if GEOS_VERSION_MAJOR >= 3
> hGeosProduct = (GEOSGeometry*)geos::precision::EnhancedPrecisionOp::difference(( geos::geom::Geometry*) hThisGeosGeom, (geos::geom::Geometry*)hOtherGeosGeom );
> #else
1863a1878
> #endif