#include <DistanceOp.h>
Public Member Functions | |
DistanceOp (const geom::Geometry *g0, const geom::Geometry *g1) | |
double | distance () |
geom::CoordinateSequence * | closestPoints () |
std::vector< GeometryLocation * > * | closestLocations () |
Static Public Member Functions | |
static double | distance (const geom::Geometry *g0, const geom::Geometry *g1) |
static geom::CoordinateSequence * | closestPoints (geom::Geometry *g0, geom::Geometry *g1) |
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.
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.
static double geos::operation::distance::DistanceOp::distance | ( | const geom::Geometry * | g0, | |
const geom::Geometry * | g1 | |||
) | [static] |
static geom::CoordinateSequence* geos::operation::distance::DistanceOp::closestPoints | ( | geom::Geometry * | g0, | |
geom::Geometry * | g1 | |||
) | [static] |
double geos::operation::distance::DistanceOp::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.
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.