Class OffsetCurve
- Namespace
- NetTopologySuite.Operation.Buffer
- Assembly
- NetTopologySuite.dll
Computes an offset curve from a geometry. The offset curve is a linear geometry which is offset a specified distance from the input. If the offset distance is positive the curve lies on the left side of the input; if it is negative the curve is on the right side.
- For a LineString the offset curve is a line.
- For a Point the offset curve is an empty LineString.
- For a Polygon the offset curve is the boundary of the polygon buffer (which may be a MultiLineString).
- For a collection the output is a MultiLineString containing the element offset curves.
- For self-intersecting lines, the buffer boundary includes offset lines for both left and right sides of the input line. Only a single contiguous portion on the specified side is returned.
- If the offset corresponds to buffer holes, only the largest hole is used.
public class OffsetCurve
- Inheritance
-
OffsetCurve
- Inherited Members
Constructors
OffsetCurve(Geometry, double)
Creates a new instance for computing an offset curve for a geometryat a given distance. with default quadrant segments(DefaultQuadrantSegments and join style (DefaultJoinStyle).
public OffsetCurve(Geometry geom, double distance)
Parameters
OffsetCurve(Geometry, double, BufferParameters)
public OffsetCurve(Geometry geom, double distance, BufferParameters bufParams)
Parameters
geom
Geometrydistance
doublebufParams
BufferParameters
Methods
GetCurve()
Gets the computed offset curve.
public Geometry GetCurve()
Returns
- Geometry
The offset curve geometry
GetCurve(Geometry, double)
Computes the offset curve of a geometry at a given distance.
public static Geometry GetCurve(Geometry geom, double distance)
Parameters
Returns
- Geometry
The offset curve
GetCurve(Geometry, double, int, JoinStyle, double)
Computes the offset curve of a geometry at a given distance, and for a specified quadrant segments, join style and mitre limit.
public static Geometry GetCurve(Geometry geom, double distance, int quadSegs = -1, JoinStyle joinStyle = JoinStyle.Round, double mitreLimit = -1)
Parameters
geom
GeometryA geometry
distance
doubleThe offset distance (positive = left, negative = right)
quadSegs
intThe quadrant segments
joinStyle
JoinStyleThe join style
mitreLimit
doubleThe mitre limit
Returns
- Geometry
The offset curve
RawOffset(LineString, double)
Gets the raw offset line, with default buffer parameters.
public static Coordinate[] RawOffset(LineString geom, double distance)
Parameters
geom
LineStringThe
LineString
to offsetdistance
doubleThe offset distance
Returns
- Coordinate[]
The raw offset line
RawOffset(LineString, double, BufferParameters)
Gets the raw offset line. The quadrant segments and join style and mitre limit to be set via BufferParameters.
The raw offset line may contain loops and other artifacts which are not present in the true offset curve. The raw offset line is matched to the buffer ring (which is clean) to extract the offset curve.public static Coordinate[] RawOffset(LineString geom, double distance, BufferParameters bufParams)
Parameters
geom
LineStringThe
LineString
to offsetdistance
doubleThe offset distance
bufParams
BufferParametersThe buffer parameters to use
Returns
- Coordinate[]
The raw offset line