Package com.github.micycle1.geoblitz
Class FastVariableBuffer
java.lang.Object
com.github.micycle1.geoblitz.FastVariableBuffer
Identical to JTS'
VariableBuffer but uses
HilbertParallelPolygonUnion under the hood for faster unioning of buffer
components.- Author:
- Martin Davis, Michael Carleton
-
Constructor Summary
ConstructorsConstructorDescriptionFastVariableBuffer(org.locationtech.jts.geom.Geometry line, double[] distance) Creates a generator for a variable-distance line buffer. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.Geometrybuffer(org.locationtech.jts.geom.Geometry line, double[] distance) Creates a buffer polygon along a line with the distance specified at each vertex.static org.locationtech.jts.geom.Geometrybuffer(org.locationtech.jts.geom.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 org.locationtech.jts.geom.Geometrybuffer(org.locationtech.jts.geom.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.org.locationtech.jts.geom.GeometryComputes the variable buffer polygon.
-
Constructor Details
-
FastVariableBuffer
public FastVariableBuffer(org.locationtech.jts.geom.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 Details
-
buffer
public static org.locationtech.jts.geom.Geometry buffer(org.locationtech.jts.geom.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 org.locationtech.jts.geom.Geometry buffer(org.locationtech.jts.geom.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 org.locationtech.jts.geom.Geometry buffer(org.locationtech.jts.geom.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 org.locationtech.jts.geom.Geometry getResult()Computes the variable buffer polygon.- Returns:
- a buffer polygon
-