class LengthIndexOfPoint
extends java.lang.Object
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.| Modifier and Type | Field and Description |
|---|---|
private Geometry |
linearGeom |
| Constructor and Description |
|---|
LengthIndexOfPoint(Geometry linearGeom) |
| Modifier and Type | Method and Description |
|---|---|
double |
indexOf(Coordinate inputPt)
Find the nearest location along a linear
Geometry to a given point. |
static double |
indexOf(Geometry linearGeom,
Coordinate inputPt) |
double |
indexOfAfter(Coordinate inputPt,
double minIndex)
Finds the nearest index along the linear
Geometry
to a given Coordinate
after the specified minimum index. |
static double |
indexOfAfter(Geometry linearGeom,
Coordinate inputPt,
double minIndex) |
private double |
indexOfFromStart(Coordinate inputPt,
double minIndex) |
private double |
segmentNearestMeasure(LineSegment seg,
Coordinate inputPt,
double segmentStartMeasure) |
private Geometry linearGeom
public LengthIndexOfPoint(Geometry linearGeom)
public static double indexOf(Geometry linearGeom, Coordinate inputPt)
public static double indexOfAfter(Geometry linearGeom, Coordinate inputPt, double minIndex)
public double indexOf(Coordinate inputPt)
Geometry to a given point.inputPt - the coordinate to locatepublic double indexOfAfter(Coordinate inputPt, double minIndex)
Geometry
to a given Coordinate
after the specified minimum index.
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 locateminIndex - the minimum location for the point locationprivate double indexOfFromStart(Coordinate inputPt, double minIndex)
private double segmentNearestMeasure(LineSegment seg, Coordinate inputPt, double segmentStartMeasure)