public class OffsetCurveSetBuilder
extends java.lang.Object
Geometry
.
Raw curves need to be noded together and polygonized to form the final buffer area.Modifier and Type | Field and Description |
---|---|
private OffsetCurveBuilder |
curveBuilder |
private java.util.List |
curveList |
private double |
distance |
private Geometry |
inputGeom |
Constructor and Description |
---|
OffsetCurveSetBuilder(Geometry inputGeom,
double distance,
OffsetCurveBuilder curveBuilder) |
Modifier and Type | Method and Description |
---|---|
private void |
add(Geometry g) |
private void |
addCollection(GeometryCollection gc) |
private void |
addCurve(Coordinate[] coord,
int leftLoc,
int rightLoc)
Creates a
SegmentString for a coordinate list which is a raw offset curve,
and adds it to the list of buffer curves. |
private void |
addLineString(LineString line) |
private void |
addPoint(Point p)
Add a Point to the graph.
|
private void |
addPolygon(Polygon p) |
private void |
addPolygonRing(Coordinate[] coord,
double offsetDistance,
int side,
int cwLeftLoc,
int cwRightLoc)
Adds an offset curve for a polygon ring.
|
java.util.List |
getCurves()
Computes the set of raw offset curves for the buffer.
|
private boolean |
isErodedCompletely(LinearRing ring,
double bufferDistance)
The ringCoord is assumed to contain no repeated points.
|
private boolean |
isTriangleErodedCompletely(Coordinate[] triangleCoord,
double bufferDistance)
Tests whether a triangular ring would be eroded completely by the given
buffer distance.
|
private Geometry inputGeom
private double distance
private OffsetCurveBuilder curveBuilder
private java.util.List curveList
public OffsetCurveSetBuilder(Geometry inputGeom, double distance, OffsetCurveBuilder curveBuilder)
public java.util.List getCurves()
Label
indicating
its left and right location.private void addCurve(Coordinate[] coord, int leftLoc, int rightLoc)
SegmentString
for a coordinate list which is a raw offset curve,
and adds it to the list of buffer curves.
The SegmentString is tagged with a Label giving the topology of the curve.
The curve may be oriented in either direction.
If the curve is oriented CW, the locations will be:
private void add(Geometry g)
private void addCollection(GeometryCollection gc)
private void addPoint(Point p)
private void addLineString(LineString line)
private void addPolygon(Polygon p)
private void addPolygonRing(Coordinate[] coord, double offsetDistance, int side, int cwLeftLoc, int cwRightLoc)
coord
- the coordinates of the ring (must not contain repeated points)offsetDistance
- the distance at which to create the bufferside
- the side of the ring on which to construct the buffer linecwLeftLoc
- the location on the L side of the ring (if it is CW)cwRightLoc
- the location on the R side of the ring (if it is CW)private boolean isErodedCompletely(LinearRing ring, double bufferDistance)
ringCoord
- offsetDistance
- private boolean isTriangleErodedCompletely(Coordinate[] triangleCoord, double bufferDistance)
triangleCoord
- bufferDistance
-