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 linearGeometryto a given point.static LinearLocationindexOf(Geometry linearGeom, Coordinate inputPt) indexOfAfter(Coordinate inputPt, LinearLocation minIndex) Find the nearestLinearLocationalong the linearGeometryto a givenCoordinateafter the specified minimumLinearLocation.static LinearLocationindexOfAfter(Geometry linearGeom, Coordinate inputPt, LinearLocation minIndex) private LinearLocationindexOfFromStart(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 linearGeometryto a given point.- Parameters:
inputPt- the coordinate to locate- Returns:
- the location of the nearest point
-
indexOfAfter
Find the nearestLinearLocationalong the linearGeometryto a givenCoordinateafter 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
-