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