Esempio n. 1
0
        ///<summary>
        /// Computes the <see cref="Coordinate"/> for the point on the line at the given index, offset by the given distance.
        ///</summary>
        /// <remarks>
        /// If the index is out of range the first or last point on the line will be returned.
        /// The computed point is offset to the left of the line if the offset distance is
        /// positive, to the right if negative.
        /// The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist.
        /// </remarks>
        /// <param name="index">The index of the desired point</param>
        /// <param name="offsetDistance">The distance the point is offset from the segment (positive is to the left, negative is to the right)</param>
        /// <returns>The Coordinate at the given index</returns>
        public Coordinate ExtractPoint(double index, double offsetDistance)
        {
            LinearLocation loc    = LengthLocationMap.GetLocation(_linearGeom, index);
            LinearLocation locLow = loc.ToLowest(_linearGeom);

            return(locLow.GetSegment(_linearGeom).PointAlongOffset(locLow.SegmentFraction, offsetDistance));
        }
Esempio n. 2
0
        /// <summary>
        /// Computes the <see cref="Coordinate"/> for the point
        /// on the line at the given index, offset by the given distance.
        /// If the index is out of range the first or last point on the
        /// line will be returned.<para/>
        /// The computed point is offset to the left of the line if the offset distance is
        /// positive, to the right if negative.<para/>
        /// The Z-ordinate of the computed point will be interpolated from
        /// the Z-ordinates of the line segment containing it, if they exist.
        /// </summary>
        /// <param name="index">The index of the desired point</param>
        /// <param name="offsetDistance">The distance the point is offset from the segment
        /// (positive is to the left, negative is to the right)</param>
        /// <returns>The Coordinate at the given index</returns>
        public Coordinate ExtractPoint(LinearLocation index, double offsetDistance)
        {
            var indexLow = index.ToLowest(_linearGeom);

            return(indexLow.GetSegment(_linearGeom).PointAlongOffset(indexLow.SegmentFraction, offsetDistance));
        }