/// <summary> /// 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 <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> /// <returns>The minimum index of the point.</returns> public virtual double IndexOf(Coordinate pt) { return(LengthIndexOfPoint.IndexOf(linearGeom, pt)); }
/// <summary> /// /// </summary> /// <param name="linearGeom"></param> /// <param name="inputPt"></param> /// <returns></returns> public static double IndexOf(Geometry linearGeom, Coordinate inputPt) { LengthIndexOfPoint locater = new LengthIndexOfPoint(linearGeom); return(locater.IndexOf(inputPt)); }