GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
geos::operation::buffer::OffsetCurveBuilder Class Reference

Computes the raw offset curve for a single Geometry component (ring, line or point). More...

#include <OffsetCurveBuilder.h>

Collaboration diagram for geos::operation::buffer::OffsetCurveBuilder:
[legend]

Public Member Functions

 OffsetCurveBuilder (const geom::PrecisionModel *newPrecisionModel, const BufferParameters &nBufParams)
 
const BufferParametersgetBufferParameters () const
 Gets the buffer parameters being used to generate the curve. More...
 
bool isLineOffsetEmpty (double distance)
 
void getLineCurve (const geom::CoordinateSequence *inputPts, double distance, std::vector< geom::CoordinateSequence * > &lineList)
 This method handles single points as well as lines. More...
 
void getSingleSidedLineCurve (const geom::CoordinateSequence *inputPts, double distance, std::vector< geom::CoordinateSequence * > &lineList, bool leftSide, bool rightSide)
 This method handles single points as well as lines. More...
 
void getRingCurve (const geom::CoordinateSequence *inputPts, int side, double distance, std::vector< geom::CoordinateSequence * > &lineList)
 This method handles the degenerate cases of single points and lines, as well as rings. More...
 

Private Member Functions

double simplifyTolerance (double bufDistance)
 Computes the distance tolerance to use during input line simplification. More...
 
void computeLineBufferCurve (const geom::CoordinateSequence &inputPts, OffsetSegmentGenerator &segGen)
 
void computeSingleSidedBufferCurve (const geom::CoordinateSequence &inputPts, bool isRightSide, OffsetSegmentGenerator &segGen)
 
void computeRingBufferCurve (const geom::CoordinateSequence &inputPts, int side, OffsetSegmentGenerator &segGen)
 
std::unique_ptr< OffsetSegmentGeneratorgetSegGen (double dist)
 
void computePointCurve (const geom::Coordinate &pt, OffsetSegmentGenerator &segGen)
 
 OffsetCurveBuilder (const OffsetCurveBuilder &other)=delete
 
OffsetCurveBuilderoperator= (const OffsetCurveBuilder &rhs)=delete
 

Private Attributes

double distance
 
const geom::PrecisionModelprecisionModel
 
const BufferParametersbufParams
 

Static Private Attributes

static const double SIMPLIFY_FACTOR
 Use a value which results in a potential distance error which is significantly less than the error due to the quadrant segment discretization. More...
 

Detailed Description

Computes the raw offset curve for a single Geometry component (ring, line or point).

A raw offset curve line is not noded - it may contain self-intersections (and usually will). The final buffer polygon is computed by forming a topological graph of all the noded raw curves and tracing outside contours. The points in the raw curve are rounded to a given geom::PrecisionModel.

Definition at line 62 of file OffsetCurveBuilder.h.

Constructor & Destructor Documentation

geos::operation::buffer::OffsetCurveBuilder::OffsetCurveBuilder ( const geom::PrecisionModel newPrecisionModel,
const BufferParameters nBufParams 
)
inline

Definition at line 72 of file OffsetCurveBuilder.h.

geos::operation::buffer::OffsetCurveBuilder::OffsetCurveBuilder ( const OffsetCurveBuilder other)
privatedelete

Member Function Documentation

void geos::operation::buffer::OffsetCurveBuilder::computeLineBufferCurve ( const geom::CoordinateSequence inputPts,
OffsetSegmentGenerator segGen 
)
private
void geos::operation::buffer::OffsetCurveBuilder::computePointCurve ( const geom::Coordinate pt,
OffsetSegmentGenerator segGen 
)
private
void geos::operation::buffer::OffsetCurveBuilder::computeRingBufferCurve ( const geom::CoordinateSequence inputPts,
int  side,
OffsetSegmentGenerator segGen 
)
private
void geos::operation::buffer::OffsetCurveBuilder::computeSingleSidedBufferCurve ( const geom::CoordinateSequence inputPts,
bool  isRightSide,
OffsetSegmentGenerator segGen 
)
private
const BufferParameters& geos::operation::buffer::OffsetCurveBuilder::getBufferParameters ( ) const
inline

Gets the buffer parameters being used to generate the curve.

Returns
the buffer parameters being used

Definition at line 86 of file OffsetCurveBuilder.h.

void geos::operation::buffer::OffsetCurveBuilder::getLineCurve ( const geom::CoordinateSequence inputPts,
double  distance,
std::vector< geom::CoordinateSequence * > &  lineList 
)

This method handles single points as well as lines.

Lines are assumed to not be closed (the function will not fail for closed lines, but will generate superfluous line caps).

Parameters
inputPtsinput points
distanceoffset distance
lineListthe std::vector to which the newly created CoordinateSequences will be pushed_back. Caller is responsible to delete these new elements.
void geos::operation::buffer::OffsetCurveBuilder::getRingCurve ( const geom::CoordinateSequence inputPts,
int  side,
double  distance,
std::vector< geom::CoordinateSequence * > &  lineList 
)

This method handles the degenerate cases of single points and lines, as well as rings.

Parameters
inputPtsinput points
sidea Position
distanceoffset distance
lineListthe std::vector to which CoordinateSequences will be pushed_back
std::unique_ptr<OffsetSegmentGenerator> geos::operation::buffer::OffsetCurveBuilder::getSegGen ( double  dist)
private
void geos::operation::buffer::OffsetCurveBuilder::getSingleSidedLineCurve ( const geom::CoordinateSequence inputPts,
double  distance,
std::vector< geom::CoordinateSequence * > &  lineList,
bool  leftSide,
bool  rightSide 
)

This method handles single points as well as lines.

Lines are assumed to not be closed (the function will not fail for closed lines, but will generate superfluous line caps).

Parameters
inputPtsinput points
distanceoffset distance
lineListthe std::vector to which newly created CoordinateSequences will be pushed_back. Caller will be responsible to delete them.
leftSideindicates that the left side buffer will be obtained/skipped
rightSideindicates that the right side buffer will be obtained/skipped
Note
This is a GEOS extension.
bool geos::operation::buffer::OffsetCurveBuilder::isLineOffsetEmpty ( double  distance)

Tests whether the offset curve for line or point geometries at the given offset distance is empty (does not exist). This is the case if:

  • the distance is zero,
  • the distance is negative, except for the case of singled-sided buffers
Parameters
distancethe offset curve distance
Returns
true if the offset curve is empty
OffsetCurveBuilder& geos::operation::buffer::OffsetCurveBuilder::operator= ( const OffsetCurveBuilder rhs)
privatedelete
double geos::operation::buffer::OffsetCurveBuilder::simplifyTolerance ( double  bufDistance)
private

Computes the distance tolerance to use during input line simplification.

Parameters
bufDistancethe buffer distance
Returns
the simplification tolerance

Member Data Documentation

const BufferParameters& geos::operation::buffer::OffsetCurveBuilder::bufParams
private

Definition at line 163 of file OffsetCurveBuilder.h.

double geos::operation::buffer::OffsetCurveBuilder::distance
private

Definition at line 159 of file OffsetCurveBuilder.h.

const geom::PrecisionModel* geos::operation::buffer::OffsetCurveBuilder::precisionModel
private

Definition at line 161 of file OffsetCurveBuilder.h.

const double geos::operation::buffer::OffsetCurveBuilder::SIMPLIFY_FACTOR
staticprivate

Use a value which results in a potential distance error which is significantly less than the error due to the quadrant segment discretization.

For QS = 8 a value of 100 is reasonable. This should produce a maximum of 1% distance error.

Definition at line 172 of file OffsetCurveBuilder.h.


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