Exemple #1
0
        /// <summary>
        /// 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.
        /// </summary>
        public static LinearLocation[] IndicesOf(Geometry linearGeom,
                                                 Geometry subLine)
        {
            LocationIndexOfLine locater = new LocationIndexOfLine(linearGeom);

            return(locater.IndicesOf(subLine));
        }
        /// <summary>
        /// Computes the indices for a subline of the line.
        /// </summary>
        /// <param name="subLine">A subLine of the line.</param>
        /// <returns>
        /// A pair of indices for the start and end of the subline.
        /// </returns>
        /// <remarks>
        /// (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 occcur in the same order).
        /// </remarks>
        public virtual 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);
        }
 /// <summary> 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 occcur in the same order).
 ///
 /// </summary>
 /// <param name="subLine">a subLine of the line
 /// </param>
 /// <returns> a pair of indices for the start and end of the subline.
 /// </returns>
 public LinearLocation[] IndicesOf(Geometry subLine)
 {
     return(LocationIndexOfLine.IndicesOf(linearGeom, subLine));
 }