Class BufferParameters
A value class containing the parameters which specify how a buffer should be constructed.
The parameters allow control over:
- Quadrant segments (accuracy of approximation for circular arcs)
- End Cap style
- Join style
- Mitre limit
- whether the buffer is single-sided
Inherited Members
Namespace: NetTopologySuite.Operation.Buffer
Assembly: NetTopologySuite.dll
Syntax
public class BufferParameters
Constructors
| Improve this Doc View SourceBufferParameters()
Creates a default set of parameters
Declaration
public BufferParameters()
BufferParameters(Int32)
Creates a set of parameters with the given quadrantSegments value.
Declaration
public BufferParameters(int quadrantSegments)
Parameters
Type | Name | Description |
---|---|---|
Int32 | quadrantSegments | The number of quadrant segments to use |
BufferParameters(Int32, EndCapStyle)
Creates a set of parameters with the given quadrantSegments and endCapStyle values.
Declaration
public BufferParameters(int quadrantSegments, EndCapStyle endCapStyle)
Parameters
Type | Name | Description |
---|---|---|
Int32 | quadrantSegments | the number of quadrant segments to use |
EndCapStyle | endCapStyle | the end cap style to use |
BufferParameters(Int32, EndCapStyle, JoinStyle, Double)
Creates a set of parameters with the given parameter values.
Declaration
public BufferParameters(int quadrantSegments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit)
Parameters
Type | Name | Description |
---|---|---|
Int32 | quadrantSegments | the number of quadrant segments to use |
EndCapStyle | endCapStyle | the end cap style to use |
JoinStyle | joinStyle | the join style to use |
Double | mitreLimit | the mitre limit to use |
Fields
| Improve this Doc View SourceDefaultJoinStyle
The default number of facets into which to divide a fillet of 90 degrees.
A value of 8 gives less than 2% max error in the buffer distance.
For a max error of < 1%, use QS = 12.
For a max error of < 0.1%, use QS = 18.
Declaration
public const JoinStyle DefaultJoinStyle = JoinStyle.Round
Field Value
Type | Description |
---|---|
JoinStyle |
DefaultMitreLimit
The default mitre limit Allows fairly pointy mitres.
Declaration
public const double DefaultMitreLimit = 5
Field Value
Type | Description |
---|---|
Double |
DefaultQuadrantSegments
The default number of facets into which to divide a fillet of 90 degrees.
A value of 8 gives less than 2% max error in the buffer distance.
For a max error of < 1%, use QS = 12.
For a max error of < 0.1%, use QS = 18.
Declaration
public const int DefaultQuadrantSegments = 8
Field Value
Type | Description |
---|---|
Int32 |
DefaultSimplifyFactor
The default simplify factor. Provides an accuracy of about 1%, which matches the accuracy of the DefaultQuadrantSegments parameter.
Declaration
public const double DefaultSimplifyFactor = 0.01
Field Value
Type | Description |
---|---|
Double |
Properties
| Improve this Doc View SourceEndCapStyle
Gets or sets the end cap style of the generated buffer.
Declaration
public EndCapStyle EndCapStyle { get; set; }
Property Value
Type | Description |
---|---|
EndCapStyle |
Remarks
| Improve this Doc View SourceIsSingleSided
Gets or sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line.
The side used is determined by the sign of the buffer distance:
- a positive distance indicates the left-hand side
- a negative distance indicates the right-hand side
The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of Flat.
Declaration
public bool IsSingleSided { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
JoinStyle
Gets/Sets the join style for outside (reflex) corners between line segments.
Declaration
public JoinStyle JoinStyle { get; set; }
Property Value
Type | Description |
---|---|
JoinStyle |
Remarks
| Improve this Doc View SourceMitreLimit
Sets the limit on the mitre ratio used for very sharp corners.
Declaration
public double MitreLimit { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
The mitre ratio is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend far beyond the original geometry. (and in the extreme case will be infinitely far.) To prevent unreasonable geometry, the mitre limit allows controlling the maximum length of the join corner. Corners with a ratio which exceed the limit will be beveled.
QuadrantSegments
Gets or sets the number of line segments in a quarter-circle used to approximate angle fillets in round endcaps and joins. The value should be at least 1.
This determines the
error in the approximation to the true buffer curve.
The default value of 8 gives less than 2% error in the buffer distance.
For an error of < 1%, use QS = 12.
For an error of < 0.1%, use QS = 18.
The error is always less than the buffer distance (in other words, the computed buffer curve is always inside the true curve).
Declaration
public int QuadrantSegments { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
SimplifyFactor
Factor used to determine the simplify distance tolerance for input simplification. Simplifying can increase the performance of computing buffers. Generally the simplify factor should be greater than 0. Values between 0.01 and .1 produce relatively good accuracy for the generate buffer. Larger values sacrifice accuracy in return for performance.
Declaration
public double SimplifyFactor { get; set; }
Property Value
Type | Description |
---|---|
Double |
Methods
| Improve this Doc View SourceBufferDistanceError(Int32)
Computes the maximum distance error due to a given level of approximation to a true arc.
Declaration
public static double BufferDistanceError(int quadSegs)
Parameters
Type | Name | Description |
---|---|---|
Int32 | quadSegs | The number of segments used to approximate a quarter-circle |
Returns
Type | Description |
---|---|
Double | The error of approximation |
Copy()
Creates a copy
Declaration
public BufferParameters Copy()
Returns
Type | Description |
---|---|
BufferParameters |