Computes the buffer of a geometry, for both positive and negative buffer distances.
More...
Computes the buffer of a geometry, for both positive and negative buffer distances.
In GIS, the positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with a circle with 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 can only be approximations to the true geometry. The user can control the accuracy of the curve approximation by specifying the number of linear segments with which to approximate a curve.
The end cap style of a linear buffer may be specified. The following end cap styles are supported:
- CAP_ROUND - the usual round end caps
- CAP_BUTT - end caps are truncated flat at the line ends
- CAP_SQUARE - end caps are squared off at the buffer distance beyond the line ends
static std::unique_ptr< geom::Geometry > geos::operation::buffer::BufferOp::bufferByZero |
( |
const geom::Geometry * |
geom, |
|
|
bool |
isBothOrientations |
|
) |
| |
|
static |
Buffers a geometry with distance zero. The result can be computed using the maximum-signed-area orientation, or by combining both orientations.
This can be used to fix an invalid polygonal geometry to be valid (i.e. with no self-intersections). For some uses (e.g. fixing the result of a simplification) a better result is produced by using only the max-area orientation. Other uses (e.g. fixing geometry) require both orientations to be used.
This function is for INTERNAL use only.
- Parameters
-
geom | the polygonal geometry to buffer by zero |
isBothOrientations | true if both orientations of input rings should be used |
- Returns
- the buffered polygonal geometry
void geos::operation::buffer::BufferOp::setSingleSided |
( |
bool |
isSingleSided | ) |
|
|
inline |
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 single-sided buffer of point geometries is the same as the regular buffer.
The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of CAP_FLAT
.
- Parameters
-
isSingleSided | true if a single-sided buffer should be constructed |
References geos::operation::buffer::BufferParameters::setSingleSided().