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

Creates all the raw offset curves for a buffer of a Geometry. More...

#include <OffsetCurveSetBuilder.h>

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

Public Member Functions

 OffsetCurveSetBuilder (const geom::Geometry &newInputGeom, double newDistance, OffsetCurveBuilder &newCurveBuilder)
 Constructor. More...
 
 ~OffsetCurveSetBuilder ()
 Destructor. More...
 
std::vector< noding::SegmentString * > & getCurves ()
 Computes the set of raw offset curves for the buffer. More...
 
void addCurves (const std::vector< geom::CoordinateSequence * > &lineList, geom::Location leftLoc, geom::Location rightLoc)
 Add raw curves for a set of CoordinateSequences. More...
 

Private Member Functions

void addCurve (geom::CoordinateSequence *coord, geom::Location leftLoc, geom::Location rightLoc)
 
void add (const geom::Geometry &g)
 
void addCollection (const geom::GeometryCollection *gc)
 
void addPoint (const geom::Point *p)
 
void addLineString (const geom::LineString *line)
 
void addPolygon (const geom::Polygon *p)
 
void addRingBothSides (const geom::CoordinateSequence *coord, double p_distance)
 
void addRingSide (const geom::CoordinateSequence *coord, double offsetDistance, int side, geom::Location cwLeftLoc, geom::Location cwRightLoc)
 
bool isErodedCompletely (const geom::LinearRing *ringCoord, double bufferDistance)
 
bool isTriangleErodedCompletely (const geom::CoordinateSequence *triCoords, double bufferDistance)
 
 OffsetCurveSetBuilder (const OffsetCurveSetBuilder &other)=delete
 
OffsetCurveSetBuilderoperator= (const OffsetCurveSetBuilder &rhs)=delete
 

Private Attributes

std::vector< geomgraph::Label * > newLabels
 
const geom::GeometryinputGeom
 
double distance
 
OffsetCurveBuildercurveBuilder
 
std::vector< noding::SegmentString * > curveList
 

Detailed Description

Creates all the raw offset curves for a buffer of a Geometry.

Raw curves need to be noded together and polygonized to form the final buffer area.

Definition at line 71 of file OffsetCurveSetBuilder.h.

Constructor & Destructor Documentation

geos::operation::buffer::OffsetCurveSetBuilder::OffsetCurveSetBuilder ( const OffsetCurveSetBuilder other)
privatedelete
geos::operation::buffer::OffsetCurveSetBuilder::OffsetCurveSetBuilder ( const geom::Geometry newInputGeom,
double  newDistance,
OffsetCurveBuilder newCurveBuilder 
)

Constructor.

geos::operation::buffer::OffsetCurveSetBuilder::~OffsetCurveSetBuilder ( )

Destructor.

Member Function Documentation

void geos::operation::buffer::OffsetCurveSetBuilder::add ( const geom::Geometry g)
private
void geos::operation::buffer::OffsetCurveSetBuilder::addCollection ( const geom::GeometryCollection gc)
private
void geos::operation::buffer::OffsetCurveSetBuilder::addCurve ( geom::CoordinateSequence coord,
geom::Location  leftLoc,
geom::Location  rightLoc 
)
private

Creates a noding::SegmentString for a coordinate list which is a raw offset curve, and adds it to the list of buffer curves. The noding::SegmentString is tagged with a geomgraph::Label giving the topology of the curve. The curve may be oriented in either direction. If the curve is oriented CW, the locations will be:

  • Left: Location.EXTERIOR
  • Right: Location.INTERIOR
Parameters
coordis raw offset curve, ownership transferred here
void geos::operation::buffer::OffsetCurveSetBuilder::addCurves ( const std::vector< geom::CoordinateSequence * > &  lineList,
geom::Location  leftLoc,
geom::Location  rightLoc 
)

Add raw curves for a set of CoordinateSequences.

Parameters
lineListis a list of CoordinateSequence, ownership of which is transferred here
leftLocleft location
rightLocright location
void geos::operation::buffer::OffsetCurveSetBuilder::addLineString ( const geom::LineString line)
private
void geos::operation::buffer::OffsetCurveSetBuilder::addPoint ( const geom::Point p)
private

Add a Point to the graph.

void geos::operation::buffer::OffsetCurveSetBuilder::addPolygon ( const geom::Polygon p)
private
void geos::operation::buffer::OffsetCurveSetBuilder::addRingBothSides ( const geom::CoordinateSequence coord,
double  p_distance 
)
private
void geos::operation::buffer::OffsetCurveSetBuilder::addRingSide ( const geom::CoordinateSequence coord,
double  offsetDistance,
int  side,
geom::Location  cwLeftLoc,
geom::Location  cwRightLoc 
)
private

Add an offset curve for a polygon ring. The side and left and right topological location arguments assume that the ring is oriented CW. If the ring is in the opposite orientation, the left and right locations must be interchanged and the side flipped.

Parameters
coordthe coordinates of the ring (must not contain repeated points)
offsetDistancethe distance at which to create the buffer
sidethe side of the ring on which to construct the buffer line
cwLeftLocthe location on the L side of the ring (if it is CW)
cwRightLocthe location on the R side of the ring (if it is CW)
std::vector<noding::SegmentString*>& geos::operation::buffer::OffsetCurveSetBuilder::getCurves ( )

Computes the set of raw offset curves for the buffer.

Each offset curve has an attached geomgraph::Label indicating its left and right location.

Returns
a Collection of SegmentStrings representing the raw buffer curves
bool geos::operation::buffer::OffsetCurveSetBuilder::isErodedCompletely ( const geom::LinearRing ringCoord,
double  bufferDistance 
)
private

The ringCoord is assumed to contain no repeated points. It may be degenerate (i.e. contain only 1, 2, or 3 points). In this case it has no area, and hence has a minimum diameter of 0.

Parameters
ringCoord
bufferDistance
Returns
bool geos::operation::buffer::OffsetCurveSetBuilder::isTriangleErodedCompletely ( const geom::CoordinateSequence triCoords,
double  bufferDistance 
)
private

Tests whether a triangular ring would be eroded completely by the given buffer distance. This is a precise test. It uses the fact that the inner buffer of a triangle converges on the inCentre of the triangle (the point equidistant from all sides). If the buffer distance is greater than the distance of the inCentre from a side, the triangle will be eroded completely.

This test is important, since it removes a problematic case where the buffer distance is slightly larger than the inCentre distance. In this case the triangle buffer curve "inverts" with incorrect topology, producing an incorrect hole in the buffer.

Parameters
triCoord
bufferDistance
Returns
OffsetCurveSetBuilder& geos::operation::buffer::OffsetCurveSetBuilder::operator= ( const OffsetCurveSetBuilder rhs)
privatedelete

Member Data Documentation

OffsetCurveBuilder& geos::operation::buffer::OffsetCurveSetBuilder::curveBuilder
private

Definition at line 83 of file OffsetCurveSetBuilder.h.

std::vector<noding::SegmentString*> geos::operation::buffer::OffsetCurveSetBuilder::curveList
private

The raw offset curves computed. This class holds ownership of std::vector elements.

Definition at line 88 of file OffsetCurveSetBuilder.h.

double geos::operation::buffer::OffsetCurveSetBuilder::distance
private

Definition at line 81 of file OffsetCurveSetBuilder.h.

const geom::Geometry& geos::operation::buffer::OffsetCurveSetBuilder::inputGeom
private

Definition at line 79 of file OffsetCurveSetBuilder.h.

std::vector<geomgraph::Label*> geos::operation::buffer::OffsetCurveSetBuilder::newLabels
private

Definition at line 77 of file OffsetCurveSetBuilder.h.


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