/** * MD - this algorithm has been extracted into a class * because it is intended to validate that the subline truly is a subline, * and also to use the internal vertex information to unambiguously locate the subline. */ public static LinearLocation[] indicesOf(Geometry linearGeom, Geometry subLine) { LocationIndexOfLine locater = new LocationIndexOfLine(linearGeom); return locater.indicesOf(subLine); }
/** * Computes the indices for a subline of the line. * (The subline must <i>conform</i> to the line; that is, * all vertices in the subline (except possibly the first and last) * must be vertices of the line and occur in the same order). * * @param subLine a subLine of the line * @return a pair of indices for the start and end of the subline. */ public LinearLocation[] indicesOf(Geometry subLine) { return LocationIndexOfLine.indicesOf(linearGeom, subLine); }
/** * Computes the indices for a subline of the line. * (The subline must <b>conform</b> to the line; that is, * all vertices in the subline (except possibly the first and last) * must be vertices of the line and occur in the same order). * * @param subLine a subLine of the line * @return a pair of indices for the start and end of the subline. */ public double[] indicesOf(Geometry subLine) { LinearLocation[] locIndex = LocationIndexOfLine.indicesOf(linearGeom, subLine); double[] index = new double[] { LengthLocationMap.getLength(linearGeom, locIndex[0]), LengthLocationMap.getLength(linearGeom, locIndex[1]) }; return index; }