Exemplo n.º 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    =
     {
         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 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)
        {
            var locIndex = LocationIndexOfLine.IndicesOf(_linearGeom, subLine);
            var index    = new[]
            {
                LengthLocationMap.GetLength(_linearGeom, locIndex[0]),
                LengthLocationMap.GetLength(_linearGeom, locIndex[1]),
            };

            return(index);
        }
Exemplo n.º 3
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(Geometry linearGeom, LinearLocation loc)
        {
            var locater = new LengthLocationMap(linearGeom);

            return(locater.GetLength(loc));
        }
 /// <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)
 {
     var locater = new LengthLocationMap(linearGeom);
     return locater.GetLength(loc);
 }