Class OffsetCurveBuilder
- Namespace
- NetTopologySuite.Operation.Buffer
- Assembly
- NetTopologySuite.dll
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).g 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.
public class OffsetCurveBuilder
- Inheritance
-
OffsetCurveBuilder
- Inherited Members
Constructors
OffsetCurveBuilder(PrecisionModel, BufferParameters)
public OffsetCurveBuilder(PrecisionModel precisionModel, BufferParameters bufParams)
Parameters
precisionModelPrecisionModelbufParamsBufferParameters
Properties
BufferParameters
Gets the buffer parameters being used to generate the curve.
public BufferParameters BufferParameters { get; }
Property Value
Methods
GetLineCurve(Coordinate[], double)
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).
public Coordinate[] GetLineCurve(Coordinate[] inputPts, double distance)
Parameters
inputPtsCoordinate[]The vertices of the line to offset
distancedoubleThe offset distance
Returns
- Coordinate[]
A Coordinate array representing the curve
ornullif the curve is empty
GetOffsetCurve(Coordinate[], double)
public Coordinate[] GetOffsetCurve(Coordinate[] inputPts, double distance)
Parameters
inputPtsCoordinate[]distancedouble
Returns
GetRingCurve(Coordinate[], Position, double)
This method handles the degenerate cases of single points and lines, as well as rings.
public Coordinate[] GetRingCurve(Coordinate[] inputPts, Position side, double distance)
Parameters
inputPtsCoordinate[]sidePositiondistancedouble
Returns
- Coordinate[]
A Coordinate array representing the curve
ornullif the curve is empty
GetRingCurve(Coordinate[], Positions, double)
This method handles the degenerate cases of single points and lines, as well as rings.
[Obsolete("Use GetRingCurve(Coordinate[], Geometries.Position, double)")]
public Coordinate[] GetRingCurve(Coordinate[] inputPts, Positions side, double distance)
Parameters
inputPtsCoordinate[]sidePositionsdistancedouble
Returns
- Coordinate[]
A Coordinate array representing the curve
ornullif the curve is empty
IsLineOffsetEmpty(double)
Tests whether the offset curve for line or point geometries at the given offset distance is empty (does not exist). This is the case if:
- the distance is zero
- the distance is negative, except for the case of singled-sided buffers
public bool IsLineOffsetEmpty(double distance)
Parameters
distancedoubleThe offset curve distance
Returns
- bool
trueif the offset curve is empty