Package org.locationtech.jts.linearref
Class LocationIndexOfPoint
java.lang.Object
org.locationtech.jts.linearref.LocationIndexOfPoint
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.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionindexOf
(Coordinate inputPt) Find the nearest location along a linearGeometry
to a given point.static LinearLocation
indexOf
(Geometry linearGeom, Coordinate inputPt) indexOfAfter
(Coordinate inputPt, LinearLocation minIndex) Find the nearestLinearLocation
along the linearGeometry
to a givenCoordinate
after the specified minimumLinearLocation
.static LinearLocation
indexOfAfter
(Geometry linearGeom, Coordinate inputPt, LinearLocation minIndex) private LinearLocation
indexOfFromStart
(Coordinate inputPt, LinearLocation minIndex)
-
Field Details
-
linearGeom
-
-
Constructor Details
-
LocationIndexOfPoint
-
-
Method Details
-
indexOf
-
indexOfAfter
public static LinearLocation indexOfAfter(Geometry linearGeom, Coordinate inputPt, LinearLocation minIndex) -
indexOf
Find the nearest location along a linearGeometry
to a given point.- Parameters:
inputPt
- the coordinate to locate- Returns:
- the location of the nearest point
-
indexOfAfter
Find the nearestLinearLocation
along the linearGeometry
to a givenCoordinate
after the specified minimumLinearLocation
. If possible the location returned will be strictly greater than theminLocation
. If this is not possible, the value returned will equalminLocation
. (An example where this is not possible is when minLocation = [end of line] ).- Parameters:
inputPt
- the coordinate to locateminIndex
- the minimum location for the point location- Returns:
- the location of the nearest point
-
indexOfFromStart
-