コード例 #1
0
 /// <summary>
 /// Computes the indices for a subline of the line.
 /// (The subline must conform 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 double[] IndicesOf(IGeometry subLine)
 {
     LinearLocation[] locIndex = LocationIndexOfLine.IndicesOf(linearGeom, subLine);
     double[]         index    = new double[]
     {
         LengthLocationMap.GetLength(linearGeom, locIndex[0]),
         LengthLocationMap.GetLength(linearGeom, locIndex[1]),
     };
     return(index);
 }
コード例 #2
0
        /// <summary>
        /// Computes the length for a given <see cref="LinearLocation" />
        /// on a linear <see cref="Geometry" />.
        /// </summary>
        /// <param name="linearGeom">The linear geometry to use.</param>
        /// <param name="loc">The <see cref="LinearLocation" /> index of the location.</param>
        /// <returns>The length for the <see cref="LinearLocation" />.</returns>
        public static double GetLength(IGeometry linearGeom, LinearLocation loc)
        {
            LengthLocationMap locater = new LengthLocationMap(linearGeom);

            return(locater.GetLength(loc));
        }
コード例 #3
0
        /// <summary>
        /// Computes the <see cref="LinearLocation" /> for a
        /// given length along a linear <see cref="Geometry" />.
        /// </summary>
        /// <param name="linearGeom">The linear geometry to use.</param>
        /// <param name="length">The length index of the location.</param>
        /// <returns>The <see cref="LinearLocation" /> for the length.</returns>
        public static LinearLocation GetLocation(IGeometry linearGeom, double length)
        {
            LengthLocationMap locater = new LengthLocationMap(linearGeom);

            return(locater.GetLocation(length));
        }
コード例 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="index"></param>
 /// <returns></returns>
 private LinearLocation LocationOf(double index)
 {
     return(LengthLocationMap.GetLocation(linearGeom, index));
 }
コード例 #5
0
        /// <summary>
        /// Computes the <see cref="Coordinate" /> for the point
        /// on the line at the given index.
        /// If the index is out of range the first or last point on the
        /// line will be returned.
        /// </summary>
        /// <param name="index">The index of the desired point.</param>
        /// <returns>The <see cref="Coordinate" /> at the given index.</returns>
        public ICoordinate ExtractPoint(double index)
        {
            LinearLocation loc = LengthLocationMap.GetLocation(linearGeom, index);

            return(loc.GetCoordinate(linearGeom));
        }
コード例 #6
0
ファイル: LengthLocationMap.cs プロジェクト: izambakci/tf-net
 /// <summary>
 /// Computes the <see cref="LinearLocation" /> for a
 /// given length along a linear <see cref="Geometry" />.
 /// </summary>
 /// <param name="linearGeom">The linear geometry to use.</param>
 /// <param name="length">The length index of the location.</param>
 /// <returns>The <see cref="LinearLocation" /> for the length.</returns>
 public static LinearLocation GetLocation(IGeometry linearGeom, double length)
 {
     LengthLocationMap locater = new LengthLocationMap(linearGeom);
     return locater.GetLocation(length);
 }
コード例 #7
0
ファイル: LengthLocationMap.cs プロジェクト: izambakci/tf-net
 /// <summary>
 /// Computes the length for a given <see cref="LinearLocation" />
 /// on a linear <see cref="Geometry" />.
 /// </summary>
 /// <param name="linearGeom">The linear geometry to use.</param>
 /// <param name="loc">The <see cref="LinearLocation" /> index of the location.</param>
 /// <returns>The length for the <see cref="LinearLocation" />.</returns>
 public static double GetLength(IGeometry linearGeom, LinearLocation loc)
 {
     LengthLocationMap locater = new LengthLocationMap(linearGeom);
     return locater.GetLength(loc);
 }