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

#include <EdgeNodingBuilder.h>

Collaboration diagram for geos::operation::overlayng::EdgeNodingBuilder:
[legend]

Public Member Functions

 EdgeNodingBuilder (const PrecisionModel *p_pm, Noder *p_customNoder)
 
 ~EdgeNodingBuilder ()
 
void setClipEnvelope (const Envelope *clipEnv)
 
bool hasEdgesFor (int geomIndex) const
 
std::vector< Edge * > build (const Geometry *geom0, const Geometry *geom1)
 

Private Member Functions

NodergetNoder ()
 
std::unique_ptr< NodercreateFixedPrecisionNoder (const PrecisionModel *pm)
 
std::unique_ptr< NodercreateFloatingPrecisionNoder (bool doValidation)
 
void addCollection (const GeometryCollection *gc, int geomIndex)
 
void addGeometryCollection (const GeometryCollection *gc, int geomIndex, int expectedDim)
 
void addPolygon (const Polygon *poly, int geomIndex)
 
void addPolygonRing (const LinearRing *ring, bool isHole, int geomIndex)
 
void addLine (const LineString *line, int geomIndex)
 
void addLine (std::unique_ptr< CoordinateArraySequence > &pts, int geomIndex)
 
void addEdge (std::unique_ptr< std::vector< Coordinate >> pts, const EdgeSourceInfo *info)
 
void addEdge (std::unique_ptr< CoordinateArraySequence > &cas, const EdgeSourceInfo *info)
 
const EdgeSourceInfocreateEdgeSourceInfo (int index, int depthDelta, bool isHole)
 
const EdgeSourceInfocreateEdgeSourceInfo (int index)
 
bool isClippedCompletely (const Envelope *env)
 
bool isToBeLimited (const LineString *line) const
 
std::vector< std::unique_ptr< CoordinateArraySequence > > & limit (const LineString *line)
 
std::unique_ptr< CoordinateArraySequenceclip (const LinearRing *line)
 
std::unique_ptr< CoordinateArraySequenceremoveRepeatedPoints (const LineString *line)
 
int computeDepthDelta (const LinearRing *ring, bool isHole)
 
void add (const Geometry *g, int geomIndex)
 
std::vector< Edge * > node (std::vector< SegmentString * > *segStrings)
 
std::vector< Edge * > createEdges (std::vector< SegmentString * > *segStrings)
 

Private Attributes

const PrecisionModelpm
 
std::unique_ptr< std::vector< SegmentString * > > inputEdges
 
NodercustomNoder
 
std::array< bool, 2 > hasEdges
 
const EnvelopeclipEnv
 
std::unique_ptr< RingClipperclipper
 
std::unique_ptr< LineLimiterlimiter
 
LineIntersector lineInt
 
IntersectionAdder intAdder
 
std::unique_ptr< NoderinternalNoder
 
std::unique_ptr< NoderspareInternalNoder
 
std::deque< EdgeSourceInfoedgeSourceInfoQue
 
std::deque< EdgeedgeQue
 

Static Private Attributes

static constexpr int MIN_LIMIT_PTS = 20
 
static constexpr bool IS_NODING_VALIDATED = true
 

Detailed Description

Builds a set of noded, unique, labelled Edges from the edges of the two input geometries.

It performs the following steps:

Author
mdavis

Definition at line 80 of file EdgeNodingBuilder.h.

Constructor & Destructor Documentation

geos::operation::overlayng::EdgeNodingBuilder::EdgeNodingBuilder ( const PrecisionModel p_pm,
Noder p_customNoder 
)
inline

Creates a new builder, with an optional custom noder. If the noder is not provided, a suitable one will be used based on the supplied precision model.

Definition at line 198 of file EdgeNodingBuilder.h.

geos::operation::overlayng::EdgeNodingBuilder::~EdgeNodingBuilder ( )
inline

Definition at line 207 of file EdgeNodingBuilder.h.

Member Function Documentation

void geos::operation::overlayng::EdgeNodingBuilder::add ( const Geometry g,
int  geomIndex 
)
private
void geos::operation::overlayng::EdgeNodingBuilder::addCollection ( const GeometryCollection gc,
int  geomIndex 
)
private
void geos::operation::overlayng::EdgeNodingBuilder::addEdge ( std::unique_ptr< std::vector< Coordinate >>  pts,
const EdgeSourceInfo info 
)
private
void geos::operation::overlayng::EdgeNodingBuilder::addEdge ( std::unique_ptr< CoordinateArraySequence > &  cas,
const EdgeSourceInfo info 
)
private
void geos::operation::overlayng::EdgeNodingBuilder::addGeometryCollection ( const GeometryCollection gc,
int  geomIndex,
int  expectedDim 
)
private
void geos::operation::overlayng::EdgeNodingBuilder::addLine ( const LineString line,
int  geomIndex 
)
private
void geos::operation::overlayng::EdgeNodingBuilder::addLine ( std::unique_ptr< CoordinateArraySequence > &  pts,
int  geomIndex 
)
private
void geos::operation::overlayng::EdgeNodingBuilder::addPolygon ( const Polygon poly,
int  geomIndex 
)
private
void geos::operation::overlayng::EdgeNodingBuilder::addPolygonRing ( const LinearRing ring,
bool  isHole,
int  geomIndex 
)
private
std::vector<Edge*> geos::operation::overlayng::EdgeNodingBuilder::build ( const Geometry geom0,
const Geometry geom1 
)

Creates a set of labelled {Edge}s. representing the fully noded edges of the input geometries. Coincident edges (from the same or both geometries) are merged along with their labels into a single unique, fully labelled edge.

Parameters
geom0the first geometry
geom1the second geometry
Returns
the noded, merged, labelled edges
std::unique_ptr<CoordinateArraySequence> geos::operation::overlayng::EdgeNodingBuilder::clip ( const LinearRing line)
private

If a clipper is present, clip the line to the clip extent. Otherwise, remove duplicate points from the ring.

If clipping is enabled, then every ring MUST be clipped, to ensure that holes are clipped to be inside the shell. This means it is not possible to skip clipping for rings with few vertices.

Parameters
ringthe line to clip
Returns
the points in the clipped line
int geos::operation::overlayng::EdgeNodingBuilder::computeDepthDelta ( const LinearRing ring,
bool  isHole 
)
private
std::vector<Edge*> geos::operation::overlayng::EdgeNodingBuilder::createEdges ( std::vector< SegmentString * > *  segStrings)
private
const EdgeSourceInfo* geos::operation::overlayng::EdgeNodingBuilder::createEdgeSourceInfo ( int  index,
int  depthDelta,
bool  isHole 
)
private
const EdgeSourceInfo* geos::operation::overlayng::EdgeNodingBuilder::createEdgeSourceInfo ( int  index)
private
std::unique_ptr<Noder> geos::operation::overlayng::EdgeNodingBuilder::createFixedPrecisionNoder ( const PrecisionModel pm)
private
std::unique_ptr<Noder> geos::operation::overlayng::EdgeNodingBuilder::createFloatingPrecisionNoder ( bool  doValidation)
private
Noder* geos::operation::overlayng::EdgeNodingBuilder::getNoder ( )
private

Gets a noder appropriate for the precision model supplied. This is one of:

  • Fixed precision: a snap-rounding noder (which should be fully robust)
  • Floating precision: a conventional nodel (which may be non-robust). In this case, a validation step is applied to the output from the noder.
bool geos::operation::overlayng::EdgeNodingBuilder::hasEdgesFor ( int  geomIndex) const

Reports whether there are noded edges for the given input geometry. If there are none, this indicates that either the geometry was empty, or has completely collapsed (because it is smaller than the noding precision).

Parameters
geomIndexindex of input geometry
Returns
true if there are edges for the geometry
bool geos::operation::overlayng::EdgeNodingBuilder::isClippedCompletely ( const Envelope env)
private

Tests whether a geometry (represented by its envelope) lies completely outside the clip extent(if any).

bool geos::operation::overlayng::EdgeNodingBuilder::isToBeLimited ( const LineString line) const
private

Tests whether it is worth limiting a line. Lines that have few vertices or are covered by the clip extent do not need to be limited.

std::vector<std::unique_ptr<CoordinateArraySequence> >& geos::operation::overlayng::EdgeNodingBuilder::limit ( const LineString line)
private

If limiter is provided, limit the line to the clip envelope.

std::vector<Edge*> geos::operation::overlayng::EdgeNodingBuilder::node ( std::vector< SegmentString * > *  segStrings)
private

Nodes a set of segment strings and creates Edges from the result. The input segment strings each carry a EdgeSourceInfo object, which is used to provide source topology info to the constructed Edges (and is then discarded).

std::unique_ptr<CoordinateArraySequence> geos::operation::overlayng::EdgeNodingBuilder::removeRepeatedPoints ( const LineString line)
private

Removes any repeated points from a linear component. This is required so that noding can be computed correctly.

Parameters
linethe line to process
Returns
the points of the line with repeated points removed
void geos::operation::overlayng::EdgeNodingBuilder::setClipEnvelope ( const Envelope clipEnv)

Member Data Documentation

const Envelope* geos::operation::overlayng::EdgeNodingBuilder::clipEnv
private

Definition at line 93 of file EdgeNodingBuilder.h.

std::unique_ptr<RingClipper> geos::operation::overlayng::EdgeNodingBuilder::clipper
private

Definition at line 94 of file EdgeNodingBuilder.h.

Noder* geos::operation::overlayng::EdgeNodingBuilder::customNoder
private

Definition at line 91 of file EdgeNodingBuilder.h.

std::deque<Edge> geos::operation::overlayng::EdgeNodingBuilder::edgeQue
private

Definition at line 104 of file EdgeNodingBuilder.h.

std::deque<EdgeSourceInfo> geos::operation::overlayng::EdgeNodingBuilder::edgeSourceInfoQue
private

Definition at line 103 of file EdgeNodingBuilder.h.

std::array<bool, 2> geos::operation::overlayng::EdgeNodingBuilder::hasEdges
private

Definition at line 92 of file EdgeNodingBuilder.h.

std::unique_ptr<std::vector<SegmentString*> > geos::operation::overlayng::EdgeNodingBuilder::inputEdges
private

Definition at line 90 of file EdgeNodingBuilder.h.

IntersectionAdder geos::operation::overlayng::EdgeNodingBuilder::intAdder
private

Definition at line 99 of file EdgeNodingBuilder.h.

std::unique_ptr<Noder> geos::operation::overlayng::EdgeNodingBuilder::internalNoder
private

Definition at line 100 of file EdgeNodingBuilder.h.

constexpr bool geos::operation::overlayng::EdgeNodingBuilder::IS_NODING_VALIDATED = true
staticprivate

Definition at line 86 of file EdgeNodingBuilder.h.

std::unique_ptr<LineLimiter> geos::operation::overlayng::EdgeNodingBuilder::limiter
private

Definition at line 95 of file EdgeNodingBuilder.h.

LineIntersector geos::operation::overlayng::EdgeNodingBuilder::lineInt
private

Definition at line 98 of file EdgeNodingBuilder.h.

constexpr int geos::operation::overlayng::EdgeNodingBuilder::MIN_LIMIT_PTS = 20
staticprivate

Definition at line 85 of file EdgeNodingBuilder.h.

const PrecisionModel* geos::operation::overlayng::EdgeNodingBuilder::pm
private

Definition at line 89 of file EdgeNodingBuilder.h.

std::unique_ptr<Noder> geos::operation::overlayng::EdgeNodingBuilder::spareInternalNoder
private

Definition at line 101 of file EdgeNodingBuilder.h.


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