Class VariableBuffer
- java.lang.Object
-
- org.locationtech.jts.operation.buffer.VariableBuffer
-
public class VariableBuffer extends java.lang.Object
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.
- Author:
- Martin Davis
-
-
Constructor Summary
Constructors Constructor Description VariableBuffer(Geometry line, double[] distance)
Creates a generator for a variable-distance line buffer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Geometry
buffer(Geometry line, double[] distance)
Creates a buffer polygon along a line with the distance specified at each vertex.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.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.Geometry
getResult()
Computes the buffer polygon.
-
-
-
Constructor Detail
-
VariableBuffer
public VariableBuffer(Geometry line, double[] distance)
Creates a generator for a variable-distance line buffer.- Parameters:
line
- the linestring to bufferdistance
- the buffer distance for each vertex of the line
-
-
Method Detail
-
buffer
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
- the line to bufferstartDistance
- the buffer width at the start of the lineendDistance
- the buffer width at the end of the line- Returns:
- the variable-distance buffer polygon
-
buffer
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 aLinearRing
(or the rings of aPolygon
) the start distance and end distance should be equal.- Parameters:
line
- the line to bufferstartDistance
- the buffer width at the start of the linemidDistance
- the buffer width at the middle vertex of the lineendDistance
- the buffer width at the end of the line- Returns:
- the variable-distance buffer polygon
-
buffer
public static Geometry buffer(Geometry line, double[] distance)
Creates a buffer polygon along a line with the distance specified at each vertex.- Parameters:
line
- the line to bufferdistance
- the buffer distance for each vertex of the line- Returns:
- the variable-distance buffer polygon
-
getResult
public Geometry getResult()
Computes the buffer polygon.- Returns:
- a buffer polygon
-
-