Class VariableBuffer

Hierarchy: Object , VariableBuffer
public class VariableBuffer
Creates a buffer polygon with a varying buffer distance at each vertex along a line.

Only single lines are supported as input, since buffer widths are typically specified individually for each line.

Authors:
Martin Davis
public VariableBuffer(Geometry line, double[] distance)
Creates a generator for a variable-distance line buffer.
Parameters:
line - line the linestring to buffer
distance - distance the buffer distance for each vertex of the line
public static Geometry buffer(Geometry line, double startDistance, double endDistance)
Creates a buffer polygon along a line with the buffer distance interpolated between a start distance and an end distance.
Parameters:
line - line the line to buffer
startDistance - startDistance the buffer width at the start of the line
endDistance - endDistance the buffer width at the end of the line
Returns:
the variable-distance buffer polygon
public static Geometry buffer(Geometry line, double startDistance, double midDistance, double endDistance)
Creates a buffer polygon along a line with the buffer distance interpolated between a start distance, a middle distance and an end distance. The middle distance is attained at the vertex at or just past the half-length of the line. For smooth buffering of a LinearRing (or the rings of a Polygon) the start distance and end distance should be equal.
Parameters:
line - line the line to buffer
startDistance - startDistance the buffer width at the start of the line
midDistance - midDistance the buffer width at the middle vertex of the line
endDistance - endDistance the buffer width at the end of the line
Returns:
the variable-distance buffer polygon
public static Geometry buffer(Geometry line, double[] distance)
Creates a buffer polygon along a line with the distance specified at each vertex.
Parameters:
line - line the line to buffer
distance - distance the buffer distance for each vertex of the line
Returns:
the variable-distance buffer polygon
public Geometry getResult()
Computes the buffer polygon.
Returns:
a buffer polygon