Class OffsetCurveBuilder
java.lang.Object
org.locationtech.jts.operation.buffer.OffsetCurveBuilder
Computes the raw offset curve for a
single
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
.- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOffsetCurveBuilder
(PrecisionModel precisionModel, BufferParameters bufParams) -
Method Summary
Modifier and TypeMethodDescriptionprivate 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) Gets the buffer parameters being used to generate the curve.getLineCurve
(Coordinate[] inputPts, double distance) This method handles single points as well as LineStrings.getOffsetCurve
(Coordinate[] inputPts, double distance) 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.
-
Field Details
-
distance
private double distance -
precisionModel
-
bufParams
-
-
Constructor Details
-
OffsetCurveBuilder
-
-
Method Details
-
getBufferParameters
Gets the buffer parameters being used to generate the curve.- Returns:
- the buffer parameters being used
-
getLineCurve
This method handles single points as well as LineStrings. LineStrings are assumed not to be closed (the function will not fail for closed lines, but will generate superfluous line caps).- Parameters:
inputPts
- the vertices of the line to offsetdistance
- the offset distance- Returns:
- a Coordinate array representing the curve or null if the curve is empty
-
getRingCurve
This method handles the degenerate cases of single points and lines, as well as rings.- Returns:
- a Coordinate array representing the curve or null if the curve is empty
-
getOffsetCurve
-
copyCoordinates
-
getSegGen
-
simplifyTolerance
private double simplifyTolerance(double bufDistance) Computes the distance tolerance to use during input line simplification.- Parameters:
distance
- the buffer distance- Returns:
- the simplification tolerance
-
computePointCurve
-
computeLineBufferCurve
-
computeSingleSidedBufferCurve
private void computeSingleSidedBufferCurve(Coordinate[] inputPts, boolean isRightSide, OffsetSegmentGenerator segGen) -
computeOffsetCurve
private void computeOffsetCurve(Coordinate[] inputPts, boolean isRightSide, OffsetSegmentGenerator segGen) -
computeRingBufferCurve
-