Class OffsetCurve
Computes an offset curve from a geometry. An offset curve is a linear geometry which is offset a given 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. The curve(s) have the same direction as the input line(s). The result for a zero offset distance is a copy of the input linework.
The offset curve is based on the boundary of the buffer for the geometry at the offset distance(see BufferOp. The normal mode of operation is to return the sections of the buffer boundarywhich lie on the raw offset curve (obtained via RawOffset(LineString, double). The offset curve will contain multiple sections if the input self-intersects or has close approaches.The computed sections are ordered along the raw offset curve. Sections are disjoint.They never self-intersect, but may be rings.- For a LineString the offset curve is a linear geometry (LineString or MultiLineString).
- For a Point or MultiPoint 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 offset curves of the elements.
Inherited Members
Namespace: NetTopologySuite.Operation.Buffer
Assembly: NetTopologySuite.dll
Syntax
public class OffsetCurve
Constructors
| Edit this page View SourceOffsetCurve(Geometry, double)
Creates a new instance for computing an offset curve for a geometry at 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 | The offset distance (positive for left, negative for right) |
OffsetCurve(Geometry, double, BufferParameters)
Creates a new instance for computing an offset curve for a geometry at a given distance. setting the quadrant segments, join style and mitre limit via BufferParameters.
Declaration
public OffsetCurve(Geometry geom, double distance, BufferParameters bufParams)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry |
double | distance | The offset distance (positive for left, negative for right) |
BufferParameters | bufParams | The buffer paramters to use |
Properties
| Edit this page View SourceJoined
Gets or sets a value indicating if a single curve line for each input linear component is computed by joining curve sections in order along the raw offset curve. The default mode is to compute separate curve sections.
Declaration
public bool Joined { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page 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 for left, negative for right) |
Returns
Type | Description |
---|---|
Geometry | The offset curve |
GetCurve(Geometry, double, int, JoinStyle, double)
Computes the offset curve of a geometry at a given distance, with 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 for left, negative for right) |
int | quadSegs | The quadrant segments |
JoinStyle | joinStyle | The join style |
double | mitreLimit | The mitre limit |
Returns
Type | Description |
---|---|
Geometry | The offset curve |
GetCurveJoined(Geometry, double)
Computes the offset curve of a geometry at a given distance, joining curve sections into a single line for each input line.
Declaration
public static Geometry GetCurveJoined(Geometry geom, double distance)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | A geometry |
double | distance | the offset distance (positive for left, negative for right) |
Returns
Type | Description |
---|---|
Geometry | The joined offset curve |
RawOffset(LineString, double)
Gets the raw offset curve for a line at a given distance, with default buffer parameters.
Declaration
public static Coordinate[] RawOffset(LineString line, double distance)
Parameters
Type | Name | Description |
---|---|---|
LineString | line | The |
double | distance | The offset distance (positive for left, negative for right) |
Returns
Type | Description |
---|---|
Coordinate[] | The raw offset line |
RawOffset(LineString, double, BufferParameters)
Gets the raw offset curve for a line at a given distance. The quadrant segments, join style and mitre limit can be specified via BufferParameters.
The raw offset line may contain loops and other artifacts which are not present in the true offset curve.Declaration
public static Coordinate[] RawOffset(LineString line, double distance, BufferParameters bufParams)
Parameters
Type | Name | Description |
---|---|---|
LineString | line | The |
double | distance | The offset distance (positive for left, negative for right) |
BufferParameters | bufParams | The buffer parameters to use |
Returns
Type | Description |
---|---|
Coordinate[] | The raw offset curve points |