Class BufferOp
Computes the buffer of a geometry, for both positive and negative buffer distances.
Inherited Members
Namespace: NetTopologySuite.Operation.Buffer
Assembly: NetTopologySuite.dll
Syntax
public class BufferOp
Remarks
In GIS, the positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with a circle of radius equal to the absolute value of the buffer distance. In the CAD/CAM world buffers are known as offset curves. In morphological analysis the operation of positive and negative buffering is referred to as erosion and dilation
The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty Polygon.
Since true buffer curves may contain circular arcs, computed buffer polygons are only approximations to the true geometry. The user can control the accuracy of the approximation by specifying the number of linear segments used to approximate arcs. This is specified via QuadrantSegments or QuadrantSegments.
The EndCapStyle of a linear buffer may be specified. The following end cap styles are supported:
- Round - the usual round end caps
- Flat - end caps are truncated flat at the line ends
- Square - end caps are squared off at the buffer distance beyond the line ends
The JoinStyle of the corners in a buffer may be specified. The following join styles are supported:
- Round - the usual round join
- Mitre - corners are "sharp" (up to a MitreLimit distance limit})
- Bevel - corners are beveled (clipped off)
The buffer algorithm may perform simplification on the input to increase performance. The simplification is performed a way that always increases the buffer area (so that the simplified input covers the original input). The degree of simplification can be specified with SimplifyFactor, with a DefaultSimplifyFactor used otherwise. Note that if the buffer distance is zero then so is the computed simplify tolerance, no matter what the simplify factor.
Buffer results are always valid geometry. Given this, computing a zero-width buffer of an invalid polygonal geometry is an effective way to "validify" the geometry. Note however that in the case of self-intersecting "bow-tie" geometries, only the largest enclosed area will be retained.
Constructors
| Improve this Doc View SourceBufferOp(Geometry)
Initializes a buffer computation for the given geometry
Declaration
public BufferOp(Geometry g)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g | the geometry to buffer |
BufferOp(Geometry, BufferParameters)
Initializes a buffer computation for the given geometry with the given set of parameters
Declaration
public BufferOp(Geometry g, BufferParameters bufParams)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g | the geometry to buffer |
BufferParameters | bufParams | the buffer parameters to use |
Properties
| Improve this Doc View SourceQuadrantSegments
Gets or sets the number of line segments in a quarter-circle used to approximate angle fillets for round end caps and joins.
Declaration
public int QuadrantSegments { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceBuffer(Geometry, Double)
Computes the buffer of a geometry for a given buffer distance.
Declaration
public static Geometry Buffer(Geometry g, double distance)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g | the geometry to buffer |
Double | distance | the buffer distance |
Returns
Type | Description |
---|---|
Geometry | the buffer of the input geometry |
Buffer(Geometry, Double, BufferParameters)
Computes the buffer for a geometry for a given buffer distance and accuracy of approximation.
Declaration
public static Geometry Buffer(Geometry g, double distance, BufferParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g | the geometry to buffer |
Double | distance | the buffer distance |
BufferParameters | parameters | the buffer parameters to use |
Returns
Type | Description |
---|---|
Geometry | the buffer of the input geometry |
Buffer(Geometry, Double, Int32)
Computes the buffer for a geometry for a given buffer distance and accuracy of approximation.
Declaration
public static Geometry Buffer(Geometry g, double distance, int quadrantSegments)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g | the geometry to buffer |
Double | distance | the buffer distance |
Int32 | quadrantSegments | the number of segments used to approximate a quarter circle |
Returns
Type | Description |
---|---|
Geometry | the buffer of the input geometry |
GetResultGeometry(Double)
Returns the buffer computed for a geometry for a given buffer distance.
Declaration
public Geometry GetResultGeometry(double distance)
Parameters
Type | Name | Description |
---|---|---|
Double | distance | the buffer distance |
Returns
Type | Description |
---|---|
Geometry | the buffer of the input geometry |