Class OffsetCurve
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.
The offset curve is computed as a single contiguous section of the geometry buffer boundary. In some geometric situations this definition is ill-defined. This algorithm provides a "best-effort" interpretation. In particular:
- 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.
Inherited Members
Namespace: NetTopologySuite.Operation.Buffer
Assembly: NetTopologySuite.dll
Syntax
public class OffsetCurve
Constructors
| Improve this Doc View SourceOffsetCurve(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).
Declaration
public OffsetCurve(Geometry geom, double distance)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry |
Double | distance | A distance value |
OffsetCurve(Geometry, Double, BufferParameters)
Declaration
public OffsetCurve(Geometry geom, double distance, BufferParameters bufParams)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | |
Double | distance | |
BufferParameters | bufParams |
Methods
| Improve this Doc View SourceGetCurve()
Gets the computed offset curve.
Declaration
public Geometry GetCurve()
Returns
Type | Description |
---|---|
Geometry | The offset curve geometry |
GetCurve(Geometry, Double)
Computes the offset curve of a geometry at a given distance.
Declaration
public static Geometry GetCurve(Geometry geom, double distance)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | A geometry |
Double | distance | the offset distance (positive = left, negative = right) |
Returns
Type | Description |
---|---|
Geometry | The offset curve |
GetCurve(Geometry, Double, Int32, JoinStyle, Double)
Computes the offset curve of a geometry at a given distance, and for a specified quadrant segments, join style and mitre limit.
Declaration
public static Geometry GetCurve(Geometry geom, double distance, int quadSegs = -1, JoinStyle joinStyle = JoinStyle.Round, double mitreLimit = -1)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | A geometry |
Double | distance | The offset distance (positive = left, negative = right) |
Int32 | quadSegs | The quadrant segments |
JoinStyle | joinStyle | The join style |
Double | mitreLimit | The mitre limit |
Returns
Type | Description |
---|---|
Geometry | The offset curve |
RawOffset(LineString, Double)
Gets the raw offset line, with default buffer parameters.
Declaration
public static Coordinate[] RawOffset(LineString geom, double distance)
Parameters
Type | Name | Description |
---|---|---|
LineString | geom | The |
Double | distance | The offset distance |
Returns
Type | Description |
---|---|
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.
Declaration
public static Coordinate[] RawOffset(LineString geom, double distance, BufferParameters bufParams)
Parameters
Type | Name | Description |
---|---|---|
LineString | geom | The |
Double | distance | The offset distance |
BufferParameters | bufParams | The buffer parameters to use |
Returns
Type | Description |
---|---|
Coordinate[] | The raw offset line |