Пример #1
0
        /// <summary>
        /// Creates a buffer polygon along a line with the buffer distance interpolated
        /// between a start distance and an end distance.
        /// </summary>
        /// <param name="line">The line to buffer</param>
        /// <param name="startDistance">The buffer width at the start of the line</param>
        /// <param name="endDistance">The buffer width at the end of the line</param>
        /// <returns>The variable-distance buffer polygon</returns>
        public static Geometry Buffer(Geometry line, double startDistance,
                                      double endDistance)
        {
            double[] distance = Interpolate((LineString)line,
                                            startDistance, endDistance);
            var vb = new VariableBuffer(line, distance);

            return(vb.GetResult());
        }
Пример #2
0
        /// <summary>
        /// Creates a buffer polygon along a line with the distance specified
        /// at each vertex.
        /// </summary>
        /// <param name="line">The line to buffer</param>
        /// <param name="distance">The buffer distance for each vertex of the line</param>
        /// <returns>The variable-width buffer polygon</returns>
        public static Geometry Buffer(Geometry line, double[] distance)
        {
            var vb = new VariableBuffer(line, distance);

            return(vb.GetResult());
        }