Opened 17 years ago
Closed 16 years ago
#1497 closed enhancement (wontfix)
Use EnhancedPrecisionOp for difference and intersection operations
Reported by: | Owned by: | Mateusz Łoskot | |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.0 |
Component: | OGR_SF | Version: | svn-trunk |
Severity: | minor | Keywords: | geos intersection precision |
Cc: |
Description (last modified by )
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
Change History (7)
comment:1 by , 17 years ago
Description: | modified (diff) |
---|---|
Priority: | highest → normal |
comment:2 by , 17 years ago
Description: | modified (diff) |
---|
comment:3 by , 17 years ago
Status: | new → assigned |
---|
comment:4 by , 16 years ago
Keywords: | geos intersection precision added |
---|---|
Milestone: | → 1.6.0 |
Version: | unspecified → svn-trunk |
My previous diagnosis was not precise. The old GEOS operations do not automatically use enhanced precision. So, Fabien's idea is a good one.
GDAL requires GEOS 2.2.0 which provides initial version of enhanced precision operations. Following Fabien's patch, we can safely assume that GEOS 3.0.0 provides complete implementation. I'll apply this patch to trunk only (setting milestone to 1.6.0)
comment:5 by , 16 years ago
There is one issue with this proposal, as I see the EnhancedPrecisionOp is not available in GEOS C API. In the OGR we moved from GEOS C++ API to C API. Now, the question is if we want to partially move back to the C++, if we want to use the enhanced precision operations.
Frank,
What is your opinion?
comment:6 by , 16 years ago
To complete the discussion: (geos-devel) Any plan to add EnhancedPrecisionOp to C API ?
comment:7 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
I'm closing this ticket due to the fact the EnhancedPrecisionOp is not available through GEOS C API. We may get back to this when/if the C API is extended.
Fabien,
As I've checked, GEOS is supposed to use these new enhancements automatically. I'm not sure we should call it directly from OGR.