Package org.locationtech.jts.linearref
Class LocationIndexOfPoint
- java.lang.Object
-
- org.locationtech.jts.linearref.LocationIndexOfPoint
-
class LocationIndexOfPoint extends java.lang.ObjectComputes theLinearLocationof the point on a linearGeometrynearest a givenCoordinate. The nearest point is not necessarily unique; this class always computes the nearest point closest to the start of the geometry.
-
-
Field Summary
Fields Modifier and Type Field Description private GeometrylinearGeom
-
Constructor Summary
Constructors Constructor Description LocationIndexOfPoint(Geometry linearGeom)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearLocationindexOf(Coordinate inputPt)Find the nearest location along a linearGeometryto a given point.static LinearLocationindexOf(Geometry linearGeom, Coordinate inputPt)LinearLocationindexOfAfter(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 Detail
-
linearGeom
private Geometry linearGeom
-
-
Constructor Detail
-
LocationIndexOfPoint
public LocationIndexOfPoint(Geometry linearGeom)
-
-
Method Detail
-
indexOf
public static LinearLocation indexOf(Geometry linearGeom, Coordinate inputPt)
-
indexOfAfter
public static LinearLocation indexOfAfter(Geometry linearGeom, Coordinate inputPt, LinearLocation minIndex)
-
indexOf
public LinearLocation indexOf(Coordinate inputPt)
Find the nearest location along a linearGeometryto a given point.- Parameters:
inputPt- the coordinate to locate- Returns:
- the location of the nearest point
-
indexOfAfter
public LinearLocation indexOfAfter(Coordinate inputPt, LinearLocation minIndex)
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
private LinearLocation indexOfFromStart(Coordinate inputPt, LinearLocation minIndex)
-
-