public class OffsetCurveBuilder extends 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
.
Note: this may not produce correct results if the input
contains repeated or invalid points.
Repeated points should be removed before calling.
See CoordinateArrays.removeRepeatedOrInvalidPoints(Coordinate[])
.
Constructor and Description |
---|
OffsetCurveBuilder(PrecisionModel precisionModel,
BufferParameters bufParams) |
Modifier and Type | Method and Description |
---|---|
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 valid rings.
|
boolean |
isLineOffsetEmpty(double distance)
Tests whether the offset curve for line or point geometries
at the given offset distance is empty (does not exist).
|
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 boolean isLineOffsetEmpty(double distance)
distance
- the offset curve distancepublic Coordinate[] getRingCurve(Coordinate[] inputPts, int side, double distance)
inputPts
- the coordinates of the ring (must not contain repeated points)side
- side the side Position
of the ring on which to construct the buffer linedistance
- the positive distance at which to create the offsetpublic Coordinate[] getOffsetCurve(Coordinate[] inputPts, double distance)
Copyright © 2024. All rights reserved.