GEOS
3.14.0dev
|
Computes the LinearLocation of the point on a linear Geometry nearest a given Coordinate. More...
#include <LocationIndexOfPoint.h>
Public Member Functions | |
LocationIndexOfPoint (const geom::Geometry *linearGeom) | |
LinearLocation | indexOf (const geom::CoordinateXY &inputPt) const |
Find the nearest location along a linear Geometry to a given point. More... | |
LinearLocation | indexOfAfter (const geom::CoordinateXY &inputPt, const LinearLocation *minIndex) const |
Find the nearest LinearLocation along the linear Geometry to a given Coordinate after the specified minimum LinearLocation. More... | |
Static Public Member Functions | |
static LinearLocation | indexOf (const geom::Geometry *linearGeom, const geom::CoordinateXY &inputPt) |
static LinearLocation | indexOfAfter (const geom::Geometry *linearGeom, const geom::CoordinateXY &inputPt, const LinearLocation *minIndex) |
Computes the LinearLocation of the point on a linear Geometry nearest a given Coordinate.
The nearest point is not necessarily unique; this class always computes the nearest point closest to the start of the geometry.
LinearLocation geos::linearref::LocationIndexOfPoint::indexOf | ( | const geom::CoordinateXY & | inputPt | ) | const |
Find the nearest location along a linear Geometry to a given point.
inputPt | the coordinate to locate |
LinearLocation geos::linearref::LocationIndexOfPoint::indexOfAfter | ( | const geom::CoordinateXY & | inputPt, |
const LinearLocation * | minIndex | ||
) | const |
Find the nearest LinearLocation along the linear Geometry to a given Coordinate after the specified minimum LinearLocation.
If possible the location returned will be strictly greater than the minLocation
. If this is not possible, the value returned will equal minLocation
. (An example where this is not possible is when minLocation = [end of line]
).
inputPt | the coordinate to locate |
minIndex | the minimum location for the point location |