indexOf method

double indexOf(
  1. Coordinate pt
)

Computes the minimum index for a point on the line. If the line is not simple (i.e. loops back on itself) a single point may have more than one possible index. In this case, the smallest index is returned.

The supplied point does not necessarily have to lie precisely on the line, but if it is far from the line the accuracy and performance of this function is not guaranteed. Use {@link #project} to compute a guaranteed result for points which may be far from the line.

@param pt a point on the line @return the minimum index of the point

@see #project(Coordinate)

Implementation

double indexOf(Coordinate pt) {
  return LengthIndexOfPoint.indexOfStatic(linearGeom, pt);
}