geos::operation::distance::DistanceOp Class Reference

Computes the distance and closest points between two Geometrys. More...

#include <DistanceOp.h>

List of all members.

Public Member Functions

 DistanceOp (const geom::Geometry *g0, const geom::Geometry *g1)
double distance ()
geom::CoordinateSequenceclosestPoints ()
std::vector< GeometryLocation * > * closestLocations ()

Static Public Member Functions

static double distance (const geom::Geometry *g0, const geom::Geometry *g1)
static geom::CoordinateSequenceclosestPoints (geom::Geometry *g0, geom::Geometry *g1)


Detailed Description

Computes the distance and closest points between two Geometrys.

The distance computation finds a pair of points in the input geometries which have minimum distance between them. These points may not be vertices of the geometries, but may lie in the interior of a line segment. In this case the coordinate computed is a close approximation to the exact point.

The algorithms used are straightforward O(n^2) comparisons. This worst-case performance could be improved on by using Voronoi techniques.


Constructor & Destructor Documentation

geos::operation::distance::DistanceOp::DistanceOp ( const geom::Geometry g0,
const geom::Geometry g1 
)

Constructs a DistanceOp that computes the distance and closest points between the two specified geometries.


Member Function Documentation

std::vector<GeometryLocation*>* geos::operation::distance::DistanceOp::closestLocations (  ) 

Report the locations of the closest points in the input geometries. The locations are presented in the same order as the input Geometries.

Returns:
a pair of GeometryLocations for the closest points. Ownership of returned object is left to this instance and it's reference will be invalidated by next call to distance()

geom::CoordinateSequence* geos::operation::distance::DistanceOp::closestPoints (  ) 

Report the coordinates of the closest points in the input geometries. The points are presented in the same order as the input Geometries.

Returns:
a pair of Coordinates of the closest points as a newly allocated object (ownership to caller)

static geom::CoordinateSequence* geos::operation::distance::DistanceOp::closestPoints ( geom::Geometry g0,
geom::Geometry g1 
) [static]

Compute the the closest points of two geometries. The points are presented in the same order as the input Geometries.

Parameters:
g0 a Geometry
g1 another Geometry
Returns:
the closest points in the geometries

double geos::operation::distance::DistanceOp::distance (  ) 

Report the distance between the closest points on the input geometries.

Returns:
the distance between the geometries

static double geos::operation::distance::DistanceOp::distance ( const geom::Geometry g0,
const geom::Geometry g1 
) [static]

Compute the distance between the closest points of two geometries.

Parameters:
g0 a Geometry
g1 another Geometry
Returns:
the distance between the geometries


The documentation for this class was generated from the following file:

Generated on Sat Dec 6 11:12:25 2008 for GEOS by  doxygen 1.5.7.1