class BufferBuilder
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
private BufferParameters |
bufParams |
private EdgeList |
edgeList |
private GeometryFactory |
geomFact |
private PlanarGraph |
graph |
private Noder |
workingNoder |
private PrecisionModel |
workingPrecisionModel |
Constructor and Description |
---|
BufferBuilder(BufferParameters bufParams)
Creates a new BufferBuilder
|
Modifier and Type | Method and Description |
---|---|
Geometry |
buffer(Geometry g,
double distance) |
private void |
buildSubgraphs(java.util.List subgraphList,
PolygonBuilder polyBuilder)
Completes the building of the input subgraphs by depth-labelling them,
and adds them to the PolygonBuilder.
|
private void |
computeNodedEdges(java.util.List bufferSegStrList,
PrecisionModel precisionModel) |
private static Geometry |
convertSegStrings(java.util.Iterator it) |
private Geometry |
createEmptyResultGeometry()
Gets the standard result for an empty buffer.
|
private java.util.List |
createSubgraphs(PlanarGraph graph) |
private static int |
depthDelta(Label label)
Compute the change in depth as an edge is crossed from R to L
|
private Noder |
getNoder(PrecisionModel precisionModel) |
protected void |
insertUniqueEdge(Edge e)
Inserted edges are checked to see if an identical edge already exists.
|
void |
setNoder(Noder noder)
Sets the
Noder to use during noding. |
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.
|
private BufferParameters bufParams
private PrecisionModel workingPrecisionModel
private Noder workingNoder
private GeometryFactory geomFact
private PlanarGraph graph
private EdgeList edgeList
public BufferBuilder(BufferParameters bufParams)
private static int depthDelta(Label label)
public void setWorkingPrecisionModel(PrecisionModel pm)
pm
- the precision model to usepublic void setNoder(Noder noder)
Noder
to use during noding.
This allows choosing fast but non-robust noding, or slower
but robust noding.noder
- the noder to useprivate Noder getNoder(PrecisionModel precisionModel)
private void computeNodedEdges(java.util.List bufferSegStrList, PrecisionModel precisionModel)
protected void insertUniqueEdge(Edge e)
private java.util.List createSubgraphs(PlanarGraph graph)
private void buildSubgraphs(java.util.List subgraphList, PolygonBuilder polyBuilder)
subgraphList
- the subgraphs to buildpolyBuilder
- the PolygonBuilder which will build the final polygonsprivate static Geometry convertSegStrings(java.util.Iterator it)
private Geometry createEmptyResultGeometry()