Opened 18 years ago

Last modified 18 years ago

#1227 closed defect (fixed)

GEOS DistanceOp is not available in OGR

Reported by: bryan@… Owned by: Mateusz Łoskot
Priority: highest Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc:

Description

The GEOS Distance operation was not originally exposed in the GEOS C API so an error is returned when accessing that operation.  Presumably it's now available and can be added to the OGR functionality.
This simple Python script demonstrates the problem:
import ogr
mPT = ogr.CreateGeometryFromWkt("POINT (0 0)")
mPT2 = ogr.CreateGeometryFromWkt("POINT (1 1)")
print mPT.Distance(mPT2)

Change History (2)

comment:1 by warmerdam, 18 years ago

Mateusz,

Could you look into making sure the OGRGeometry.Distance() method has
a GEOS C API implementation when the appropriate version of the C API is
available?  

I'll try and update FWTools and push out a new release when you get it in.

comment:2 by Mateusz Łoskot, 18 years ago

Fixed and committed to the GDAL CVS.

Please, take some tests and report if you meet any problems.

NOTE: This fix also includes first attempt of new
changes - remove usage of GEOS C++ API.
Now, GDAL requires GEOS >= 2.2.0 because OGR will use only C API.
(Migration from GEOS C++ to C API is in progres)
Note: See TracTickets for help on using tickets.