Пример #1
0
        /// <summary>
        /// Computes the <see cref="LineString" /> for the interval
        /// on the line between the given indices.
        /// If the <paramref name="endIndex" /> lies before the <paramref name="startIndex" />,
        /// the computed geometry is reversed.
        /// </summary>
        /// <param name="startIndex"></param>
        /// <param name="endIndex"></param>
        /// <returns></returns>
        public IGeometry ExtractLine(double startIndex, double endIndex)
        {
            LocationIndexedLine lil      = new LocationIndexedLine(linearGeom);
            LinearLocation      startLoc = LocationOf(startIndex);
            LinearLocation      endLoc   = LocationOf(endIndex);

            return(ExtractLineByLocation.Extract(linearGeom, startLoc, endLoc));
        }
Пример #2
0
        /// <summary>
        /// Computes the subline of a <see cref="LineString" /> between
        /// two LineStringLocations 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>The extracted subline.</returns>
        public static IGeometry Extract(IGeometry line, LinearLocation start, LinearLocation end)
        {
            ExtractLineByLocation ls = new ExtractLineByLocation(line);

            return(ls.Extract(start, end));
        }
Пример #3
0
 /// <summary>
 /// Computes the subline of a <see cref="LineString" /> between
 /// two LineStringLocations 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>The extracted subline.</returns>
 public static IGeometry Extract(IGeometry line, LinearLocation start, LinearLocation end)
 {
     ExtractLineByLocation ls = new ExtractLineByLocation(line);
     return ls.Extract(start, end);
 }
Пример #4
0
 /// <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 IGeometry ExtractLine(LinearLocation startIndex, LinearLocation endIndex)
 {
     return(ExtractLineByLocation.Extract(linearGeom, startIndex, endIndex));
 }