Ticket #1497 (closed enhancement: wontfix)

Opened 1 year ago

Last modified 2 months ago

Use EnhancedPrecisionOp for difference and intersection operations

Reported by: fabien@brachere.net Assigned to: mloskot
Priority: normal Milestone: 1.6.0
Component: OGR_SF Version: svn-trunk
Severity: minor Keywords: geos intersection precision
Cc:

Description (Last modified by mloskot)

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

03/26/07 15:21:39 changed by warmerdam

  • priority changed from highest to normal.
  • description changed.

04/17/07 23:16:32 changed by mloskot

  • description changed.

04/17/07 23:17:49 changed by mloskot

  • status changed from new to assigned.

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.

05/09/08 00:59:34 changed by mloskot

  • keywords set to geos intersection precision.
  • version changed from unspecified to svn-trunk.
  • milestone set to 1.6.0.

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)

05/09/08 01:09:29 changed by mloskot

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?

05/09/08 01:12:47 changed by mloskot

To complete the discussion: (geos-devel) Any plan to add EnhancedPrecisionOp to C API ?

05/10/08 13:02:51 changed by mloskot

  • status changed from assigned to closed.
  • resolution set to wontfix.

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.