Table of Contents

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

precisionModel PrecisionModel
bufParams BufferParameters

Properties

BufferParameters

Gets the buffer parameters being used to generate the curve.

public BufferParameters BufferParameters { get; }

Property Value

BufferParameters

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

inputPts Coordinate[]

The vertices of the line to offset

distance double

The offset distance

Returns

Coordinate[]

A Coordinate array representing the curve
or null if the curve is empty

GetOffsetCurve(Coordinate[], double)

public Coordinate[] GetOffsetCurve(Coordinate[] inputPts, double distance)

Parameters

inputPts Coordinate[]
distance double

Returns

Coordinate[]

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

inputPts Coordinate[]
side Position
distance double

Returns

Coordinate[]

A Coordinate array representing the curve
or null if 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

inputPts Coordinate[]
side Positions
distance double

Returns

Coordinate[]

A Coordinate array representing the curve
or null if 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

distance double

The offset curve distance

Returns

bool

true if the offset curve is empty