/// <summary> /// Computes the index for the closest point on the line to the given point. /// If more than one point has the closest distance the first one along the line is returned. /// (The point does not necessarily have to lie precisely on the line.) /// </summary> /// <param name="pt"></param> /// <returns></returns> public double Project(Coordinate pt) { return(LengthIndexOfPoint.IndexOf(_linearGeom, pt)); }
public static double IndexOfAfter(IGeometry linearGeom, Coordinate inputPt, double minIndex) { var locater = new LengthIndexOfPoint(linearGeom); return(locater.IndexOfAfter(inputPt, minIndex)); }
/// <summary> /// Finds the index for a point on the line /// which is greater than the given index. /// If no such index exists, returns <paramref name="minIndex" />. /// This method can be used to determine all indexes for /// a point which occurs more than once on a non-simple line. /// It can also be used to disambiguate cases where the given point lies /// slightly off the line and is equidistant from two different /// points on the line. /// 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 <see cref="Project" /> to compute a guaranteed result for points /// which may be far from the line. /// </summary> /// <param name="pt">A point on the line.</param> /// <param name="minIndex">The value the returned index must be greater than.</param> /// <returns>The index of the point greater than the given minimum index.</returns> /// <seealso cref="Project(Coordinate)"/> public double IndexOfAfter(Coordinate pt, double minIndex) { return(LengthIndexOfPoint.IndexOfAfter(_linearGeom, pt, minIndex)); }
public static double IndexOf(IGeometry linearGeom, Coordinate inputPt) { var locater = new LengthIndexOfPoint(linearGeom); return(locater.IndexOf(inputPt)); }