public class OffsetCurveBuilder
extends java.lang.Object
Geometry
component (ring, line or point).
A raw offset curve line is not noded -
it may contain self-intersections (and usually will).
The final buffer polygon is computed by forming a topological graph
of all the noded raw curves and tracing outside contours.
The points in the raw curve are rounded
to a given PrecisionModel
.Modifier and Type | Field and Description |
---|---|
private BufferParameters |
bufParams |
private double |
distance |
private PrecisionModel |
precisionModel |
Constructor and Description |
---|
OffsetCurveBuilder(PrecisionModel precisionModel,
BufferParameters bufParams) |
Modifier and Type | Method and Description |
---|---|
private void |
computeLineBufferCurve(Coordinate[] inputPts,
OffsetSegmentGenerator segGen) |
private void |
computeOffsetCurve(Coordinate[] inputPts,
boolean isRightSide,
OffsetSegmentGenerator segGen) |
private void |
computePointCurve(Coordinate pt,
OffsetSegmentGenerator segGen) |
private void |
computeRingBufferCurve(Coordinate[] inputPts,
int side,
OffsetSegmentGenerator segGen) |
private void |
computeSingleSidedBufferCurve(Coordinate[] inputPts,
boolean isRightSide,
OffsetSegmentGenerator segGen) |
private static Coordinate[] |
copyCoordinates(Coordinate[] pts) |
BufferParameters |
getBufferParameters()
Gets the buffer parameters being used to generate the curve.
|
Coordinate[] |
getLineCurve(Coordinate[] inputPts,
double distance)
This method handles single points as well as LineStrings.
|
Coordinate[] |
getOffsetCurve(Coordinate[] inputPts,
double distance) |
Coordinate[] |
getRingCurve(Coordinate[] inputPts,
int side,
double distance)
This method handles the degenerate cases of single points and lines,
as well as rings.
|
private OffsetSegmentGenerator |
getSegGen(double distance) |
private double |
simplifyTolerance(double bufDistance)
Computes the distance tolerance to use during input
line simplification.
|
private double distance
private PrecisionModel precisionModel
private BufferParameters bufParams
public OffsetCurveBuilder(PrecisionModel precisionModel, BufferParameters bufParams)
public BufferParameters getBufferParameters()
public Coordinate[] getLineCurve(Coordinate[] inputPts, double distance)
inputPts
- the vertices of the line to offsetdistance
- the offset distancepublic Coordinate[] getRingCurve(Coordinate[] inputPts, int side, double distance)
public Coordinate[] getOffsetCurve(Coordinate[] inputPts, double distance)
private static Coordinate[] copyCoordinates(Coordinate[] pts)
private OffsetSegmentGenerator getSegGen(double distance)
private double simplifyTolerance(double bufDistance)
distance
- the buffer distanceprivate void computePointCurve(Coordinate pt, OffsetSegmentGenerator segGen)
private void computeLineBufferCurve(Coordinate[] inputPts, OffsetSegmentGenerator segGen)
private void computeSingleSidedBufferCurve(Coordinate[] inputPts, boolean isRightSide, OffsetSegmentGenerator segGen)
private void computeOffsetCurve(Coordinate[] inputPts, boolean isRightSide, OffsetSegmentGenerator segGen)
private void computeRingBufferCurve(Coordinate[] inputPts, int side, OffsetSegmentGenerator segGen)