com.vividsolutions.jts.operation.buffer

Class BufferBuilder


public class BufferBuilder
extends java.lang.Object

Builds the buffer geometry for a given input geometry and precision model. Allows setting the level of approximation for circular arcs, and the precision model in which to carry out the computation.

When computing buffers in floating point double-precision it can happen that the process of iterated noding can fail to converge (terminate). In this case a TopologyException will be thrown. Retrying the computation in a fixed precision can produce more robust results.

Version:
1.6

Constructor Summary

BufferBuilder()
Creates a new BufferBuilder

Method Summary

Geometry
buffer(Geometry g, double distance)
protected void
insertEdge(Edge e)
Inserted edges are checked to see if an identical edge already exists.
void
setEndCapStyle(int endCapStyle)
void
setQuadrantSegments(int quadrantSegments)
Sets the number of segments used to approximate a angle fillet
void
setWorkingPrecisionModel(PrecisionModel pm)
Sets the precision model to use during the curve computation and noding, if it is different to the precision model of the Geometry.

Constructor Details

BufferBuilder

public BufferBuilder()
Creates a new BufferBuilder

Method Details

buffer

public Geometry buffer(Geometry g,
                       double distance)

insertEdge

protected void insertEdge(Edge e)
Inserted edges are checked to see if an identical edge already exists. If so, the edge is not inserted, but its label is merged with the existing edge.

setEndCapStyle

public void setEndCapStyle(int endCapStyle)

setQuadrantSegments

public void setQuadrantSegments(int quadrantSegments)
Sets the number of segments used to approximate a angle fillet
Parameters:
quadrantSegments - the number of segments in a fillet for a quadrant

setWorkingPrecisionModel

public void setWorkingPrecisionModel(PrecisionModel pm)
Sets the precision model to use during the curve computation and noding, if it is different to the precision model of the Geometry. If the precision model is less than the precision of the Geometry precision model, the Geometry must have previously been rounded to that precision.
Parameters:
pm - the precision model to use