Computes the buffer of a geometry, for both positive and negative buffer distances. More...
#include <geos/opBuffer.h>
Public Types | |
enum | { CAP_ROUND = BufferParameters::CAP_ROUND, CAP_BUTT = BufferParameters::CAP_FLAT, CAP_SQUARE = BufferParameters::CAP_SQUARE } |
Public Member Functions | |
BufferOp (const geom::Geometry *g) | |
BufferOp (const geom::Geometry *g, const BufferParameters ¶ms) | |
void | setEndCapStyle (int nEndCapStyle) |
void | setQuadrantSegments (int nQuadrantSegments) |
void | setSingleSided (bool isSingleSided) |
geom::Geometry * | getResultGeometry (double nDistance) |
Static Public Member Functions | |
static geom::Geometry * | bufferOp (const geom::Geometry *g, double distance, int quadrantSegments=BufferParameters::DEFAULT_QUADRANT_SEGMENTS, int endCapStyle=BufferParameters::CAP_ROUND) |
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:
anonymous enum |
geos::operation::buffer::BufferOp::BufferOp | ( | const geom::Geometry * | g | ) | [inline] |
geos::operation::buffer::BufferOp::BufferOp | ( | const geom::Geometry * | g, | |
const BufferParameters & | params | |||
) | [inline] |
static geom::Geometry* geos::operation::buffer::BufferOp::bufferOp | ( | const geom::Geometry * | g, | |
double | distance, | |||
int | quadrantSegments = BufferParameters::DEFAULT_QUADRANT_SEGMENTS , |
|||
int | endCapStyle = BufferParameters::CAP_ROUND | |||
) | [static] |
geom::Geometry* geos::operation::buffer::BufferOp::getResultGeometry | ( | double | nDistance | ) |
void geos::operation::buffer::BufferOp::setEndCapStyle | ( | int | nEndCapStyle | ) | [inline] |
Specifies the end cap style of the generated buffer. The styles supported are CAP_ROUND, CAP_BUTT, and CAP_SQUARE. The default is CAP_ROUND.
endCapStyle | the end cap style to specify |
References geos::operation::buffer::BufferParameters::setEndCapStyle().
void geos::operation::buffer::BufferOp::setQuadrantSegments | ( | int | nQuadrantSegments | ) | [inline] |
Specifies the end cap style of the generated buffer. The styles supported are CAP_ROUND, CAP_BUTT, and CAP_SQUARE. The default is CAP_ROUND.
endCapStyle | the end cap style to specify |
References geos::operation::buffer::BufferParameters::setQuadrantSegments().
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:
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
.
isSingleSided | true if a single-sided buffer should be constructed |
References geos::operation::buffer::BufferParameters::setSingleSided().