Exemple #1
0
        /// <summary>
        /// Computes the subline of a <see cref="LineString"/> between
        /// two <see cref="LineStringLocation"/>s on the line.
        /// If the start location is after the end location,
        /// the computed geometry is reversed.
        /// </summary>
        /// <param name="line">The line to use as the baseline.</param>
        /// <param name="start">The start location.</param>
        /// <param name="end">The end location.</param>
        /// <returns> Returns the extracted subline.</returns>
        public static Geometry Extract(Geometry line, LinearLocation start,
                                       LinearLocation end)
        {
            ExtractLineByLocation ls = new ExtractLineByLocation(line);

            return(ls.Extract(start, end));
        }
        /// <summary>
        /// Computes the <see cref="LineString"/> for the interval on the line
        /// between the given indices.
        /// </summary>
        /// <param name="startIndex">
        /// The index of the start of the interval.
        /// </param>
        /// <param name="endIndex">
        /// The index of the end of the interval.
        /// </param>
        /// <returns>The linear interval between the indices.</returns>
        /// <remarks>
        /// If the endIndex lies before the startIndex, the computed
        /// geometry is reversed.
        /// </remarks>
        public virtual Geometry ExtractLine(double startIndex, double endIndex)
        {
//			LocationIndexedLine lil = new LocationIndexedLine(linearGeom);

            LinearLocation startLoc = LocationOf(startIndex);
            LinearLocation endLoc   = LocationOf(endIndex);

            return(ExtractLineByLocation.Extract(linearGeom,
                                                 startLoc, endLoc));
        }
 /// <summary> Computes the <see cref="LineString"/> for the interval
 /// on the line between the given indices.
 ///
 /// </summary>
 /// <param name="startIndex">the index of the start of the interval
 /// </param>
 /// <param name="endIndex">the index of the end of the interval
 /// </param>
 /// <returns> the linear interval between the indices
 /// </returns>
 public Geometry ExtractLine(LinearLocation startIndex,
                             LinearLocation endIndex)
 {
     return(ExtractLineByLocation.Extract(linearGeom,
                                          startIndex, endIndex));
 }