GEOS 3.14.0dev
Public Member Functions | List of all members
geos::operation::buffer::BufferBuilder Class Reference

Builds the buffer geometry for a given input geometry and precision model. More...

#include <BufferBuilder.h>

Public Member Functions

 BufferBuilder (const BufferParameters &nBufParams)
 
void setWorkingPrecisionModel (const geom::PrecisionModel *pm)
 
void setNoder (noding::Noder *newNoder)
 
void setInvertOrientation (bool p_isInvertOrientation)
 
std::unique_ptr< geom::Geometrybuffer (const geom::Geometry *g, double distance)
 
std::unique_ptr< geom::GeometrybufferLineSingleSided (const geom::Geometry *g, double distance, bool leftSide)
 

Detailed Description

Builds the buffer geometry for a given input geometry and precision model.

Allows setting the level of approximation for circular arcs, and the precision model in which to carry out the computation.

When computing buffers in floating point double-precision it can happen that the process of iterated noding can fail to converge (terminate).

In this case a TopologyException will be thrown. Retrying the computation in a fixed precision can produce more robust results.

Constructor & Destructor Documentation

◆ BufferBuilder()

geos::operation::buffer::BufferBuilder::BufferBuilder ( const BufferParameters nBufParams)
inline

Creates a new BufferBuilder

Parameters
nBufParamsbuffer parameters, this object will keep a reference to the passed parameters so caller must make sure the object is kept alive for the whole lifetime of the buffer builder.

Member Function Documentation

◆ bufferLineSingleSided()

std::unique_ptr< geom::Geometry > geos::operation::buffer::BufferBuilder::bufferLineSingleSided ( const geom::Geometry g,
double  distance,
bool  leftSide 
)

Generates offset curve for linear geometry.

Parameters
gnon-areal geometry object
distancewidth of offset
leftSidecontrols on which side of the input geometry offset curve is generated.
Note
For left-side offset curve, the offset will be at the left side of the input line and retain the same direction. For right-side offset curve, it'll be at the right side and in the opposite direction.
BufferParameters::setSingleSided parameter, which is specific to areal geometries only, is ignored by this routine.
Not in JTS: this is a GEOS extension

◆ setInvertOrientation()

void geos::operation::buffer::BufferBuilder::setInvertOrientation ( bool  p_isInvertOrientation)
inline

Sets whether the offset curve is generated using the inverted orientation of input rings. This allows generating a buffer(0) polygon from the smaller lobes of self-crossing rings.

Parameters
p_isInvertOrientationtrue if input ring orientation should be inverted

◆ setNoder()

void geos::operation::buffer::BufferBuilder::setNoder ( noding::Noder newNoder)
inline

Sets the noding::Noder to use during noding. This allows choosing fast but non-robust noding, or slower but robust noding.

Parameters
newNoderthe noder to use

◆ setWorkingPrecisionModel()

void geos::operation::buffer::BufferBuilder::setWorkingPrecisionModel ( const geom::PrecisionModel pm)
inline

Sets the precision model to use during the curve computation and noding, if it is different to the precision model of the Geometry. If the precision model is less than the precision of the Geometry precision model, the Geometry must have previously been rounded to that precision.

Parameters
pmthe precision model to use

The documentation for this class was generated from the following file: