GEOS  3.9.1dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::geomgraph::GeometryGraph Class Reference

A GeometryGraph is a graph that models a given Geometry. More...

#include <GeometryGraph.h>

Inheritance diagram for geos::geomgraph::GeometryGraph:
[legend]
Collaboration diagram for geos::geomgraph::GeometryGraph:
[legend]

Public Member Functions

 GeometryGraph ()
 
 GeometryGraph (int newArgIndex, const geom::Geometry *newParentGeom)
 
 GeometryGraph (int newArgIndex, const geom::Geometry *newParentGeom, const algorithm::BoundaryNodeRule &boundaryNodeRule)
 
 ~GeometryGraph () override
 
const geom::GeometrygetGeometry ()
 
std::vector< Node * > * getBoundaryNodes ()
 Returned object is owned by this GeometryGraph. More...
 
void getBoundaryNodes (std::vector< Node * > &bdyNodes)
 
geom::CoordinateSequencegetBoundaryPoints ()
 Returned object is owned by this GeometryGraph. More...
 
EdgefindEdge (const geom::LineString *line) const
 
void computeSplitEdges (std::vector< Edge * > *edgelist)
 
void addEdge (Edge *e)
 
void addPoint (geom::Coordinate &pt)
 
std::unique_ptr< index::SegmentIntersectorcomputeSelfNodes (algorithm::LineIntersector *li, bool computeRingSelfNodes, const geom::Envelope *env=nullptr)
 Compute self-nodes, taking advantage of the Geometry type to minimize the number of intersection tests. (E.g. rings are not tested for self-intersection, since they are assumed to be valid). More...
 
std::unique_ptr< index::SegmentIntersectorcomputeSelfNodes (algorithm::LineIntersector *li, bool computeRingSelfNodes, bool isDoneIfProperInt, const geom::Envelope *env=nullptr)
 
std::unique_ptr< index::SegmentIntersectorcomputeSelfNodes (algorithm::LineIntersector &li, bool computeRingSelfNodes, const geom::Envelope *env=nullptr)
 
std::unique_ptr< index::SegmentIntersectorcomputeSelfNodes (algorithm::LineIntersector &li, bool computeRingSelfNodes, bool isDoneIfProperInt, const geom::Envelope *env=nullptr)
 
std::unique_ptr< index::SegmentIntersectorcomputeEdgeIntersections (GeometryGraph *g, algorithm::LineIntersector *li, bool includeProper, const geom::Envelope *env=nullptr)
 
std::vector< Edge * > * getEdges ()
 
bool hasTooFewPoints ()
 
const geom::CoordinategetInvalidPoint ()
 
const algorithm::BoundaryNodeRulegetBoundaryNodeRule () const
 
- Public Member Functions inherited from geos::geomgraph::PlanarGraph
 PlanarGraph (const NodeFactory &nodeFact)
 
 PlanarGraph ()
 
virtual ~PlanarGraph ()
 
virtual std::vector< Edge * >::iterator getEdgeIterator ()
 
virtual std::vector< EdgeEnd * > * getEdgeEnds ()
 
virtual bool isBoundaryNode (int geomIndex, const geom::Coordinate &coord)
 
virtual void add (EdgeEnd *e)
 
virtual NodeMap::iterator getNodeIterator ()
 
virtual void getNodes (std::vector< Node * > &)
 
virtual NodeaddNode (Node *node)
 
virtual NodeaddNode (const geom::Coordinate &coord)
 
virtual Nodefind (geom::Coordinate &coord)
 
virtual void addEdges (const std::vector< Edge * > &edgesToAdd)
 Add a set of edges to the graph. For each edge two DirectedEdges will be created. DirectedEdges are NOT linked by this method. More...
 
virtual void linkResultDirectedEdges ()
 
virtual void linkAllDirectedEdges ()
 
virtual EdgeEndfindEdgeEnd (Edge *e)
 Returns the EdgeEnd which has edge e as its base edge (MD 18 Feb 2002 - this should return a pair of edges) More...
 
virtual EdgefindEdge (const geom::Coordinate &p0, const geom::Coordinate &p1)
 Returns the edge whose first two coordinates are p0 and p1. More...
 
virtual EdgefindEdgeInSameDirection (const geom::Coordinate &p0, const geom::Coordinate &p1)
 Returns the edge which starts at p0 and whose first segment is parallel to p1. More...
 
virtual std::string printEdges ()
 
virtual NodeMapgetNodeMap ()
 

Static Public Member Functions

static bool isInBoundary (int boundaryCount)
 
static geom::Location determineBoundary (int boundaryCount)
 
static geom::Location determineBoundary (const algorithm::BoundaryNodeRule &boundaryNodeRule, int boundaryCount)
 
- Static Public Member Functions inherited from geos::geomgraph::PlanarGraph
template<typename It >
static void linkResultDirectedEdges (It first, It last)
 For nodes in the collection (first..last), link the DirectedEdges at the node that are in the result. More...
 

Private Member Functions

index::EdgeSetIntersectorcreateEdgeSetIntersector ()
 Allocates a new EdgeSetIntersector. Remember to delete it! More...
 
void add (const geom::Geometry *g)
 
void addCollection (const geom::GeometryCollection *gc)
 
void addPoint (const geom::Point *p)
 
void addPolygonRing (const geom::LinearRing *lr, geom::Location cwLeft, geom::Location cwRight)
 
void addPolygon (const geom::Polygon *p)
 
void addLineString (const geom::LineString *line)
 
void insertPoint (int argIndex, const geom::Coordinate &coord, geom::Location onLocation)
 
void insertBoundaryPoint (int argIndex, const geom::Coordinate &coord)
 Adds candidate boundary points using the current algorithm::BoundaryNodeRule. More...
 
void addSelfIntersectionNodes (int argIndex)
 
void addSelfIntersectionNode (int argIndex, const geom::Coordinate &coord, geom::Location loc)
 Add a node for a self-intersection. More...
 
 GeometryGraph (const GeometryGraph &other)=delete
 
GeometryGraphoperator= (const GeometryGraph &rhs)=delete
 

Private Attributes

const geom::GeometryparentGeom
 
std::unordered_map< const geom::LineString *, Edge * > lineEdgeMap
 
bool useBoundaryDeterminationRule
 
const algorithm::BoundaryNodeRuleboundaryNodeRule
 
int argIndex
 
std::unique_ptr< geom::CoordinateSequenceboundaryPoints
 Cache for fast responses to getBoundaryPoints. More...
 
std::unique_ptr< std::vector< Node * > > boundaryNodes
 
bool hasTooFewPointsVar
 
geom::Coordinate invalidPoint
 

Additional Inherited Members

- Protected Member Functions inherited from geos::geomgraph::PlanarGraph
virtual void insertEdge (Edge *e)
 
- Protected Attributes inherited from geos::geomgraph::PlanarGraph
std::vector< Edge * > * edges
 
NodeMapnodes
 
std::vector< EdgeEnd * > * edgeEndList
 

Detailed Description

A GeometryGraph is a graph that models a given Geometry.

Definition at line 74 of file GeometryGraph.h.

Constructor & Destructor Documentation

geos::geomgraph::GeometryGraph::GeometryGraph ( const GeometryGraph other)
privatedelete
geos::geomgraph::GeometryGraph::GeometryGraph ( )
geos::geomgraph::GeometryGraph::GeometryGraph ( int  newArgIndex,
const geom::Geometry newParentGeom 
)
geos::geomgraph::GeometryGraph::GeometryGraph ( int  newArgIndex,
const geom::Geometry newParentGeom,
const algorithm::BoundaryNodeRule boundaryNodeRule 
)
geos::geomgraph::GeometryGraph::~GeometryGraph ( )
override

Member Function Documentation

void geos::geomgraph::GeometryGraph::add ( const geom::Geometry g)
private
void geos::geomgraph::GeometryGraph::addCollection ( const geom::GeometryCollection gc)
private
void geos::geomgraph::GeometryGraph::addEdge ( Edge e)
void geos::geomgraph::GeometryGraph::addLineString ( const geom::LineString line)
private
void geos::geomgraph::GeometryGraph::addPoint ( const geom::Point p)
private
void geos::geomgraph::GeometryGraph::addPoint ( geom::Coordinate pt)
void geos::geomgraph::GeometryGraph::addPolygon ( const geom::Polygon p)
private
void geos::geomgraph::GeometryGraph::addPolygonRing ( const geom::LinearRing lr,
geom::Location  cwLeft,
geom::Location  cwRight 
)
private
void geos::geomgraph::GeometryGraph::addSelfIntersectionNode ( int  argIndex,
const geom::Coordinate coord,
geom::Location  loc 
)
private

Add a node for a self-intersection.

If the node is a potential boundary node (e.g. came from an edge which is a boundary) then insert it as a potential boundary node. Otherwise, just add it as a regular node.

void geos::geomgraph::GeometryGraph::addSelfIntersectionNodes ( int  argIndex)
private
std::unique_ptr<index::SegmentIntersector> geos::geomgraph::GeometryGraph::computeEdgeIntersections ( GeometryGraph g,
algorithm::LineIntersector li,
bool  includeProper,
const geom::Envelope env = nullptr 
)
std::unique_ptr<index::SegmentIntersector> geos::geomgraph::GeometryGraph::computeSelfNodes ( algorithm::LineIntersector li,
bool  computeRingSelfNodes,
const geom::Envelope env = nullptr 
)
inline

Compute self-nodes, taking advantage of the Geometry type to minimize the number of intersection tests. (E.g. rings are not tested for self-intersection, since they are assumed to be valid).

Parameters
lithe LineIntersector to use
computeRingSelfNodesif false, intersection checks are optimized to not test rings for self-intersection
envan Envelope
Returns
the SegmentIntersector used, containing information about the intersections found

Definition at line 213 of file GeometryGraph.h.

std::unique_ptr<index::SegmentIntersector> geos::geomgraph::GeometryGraph::computeSelfNodes ( algorithm::LineIntersector li,
bool  computeRingSelfNodes,
bool  isDoneIfProperInt,
const geom::Envelope env = nullptr 
)
inline

Definition at line 222 of file GeometryGraph.h.

std::unique_ptr<index::SegmentIntersector> geos::geomgraph::GeometryGraph::computeSelfNodes ( algorithm::LineIntersector li,
bool  computeRingSelfNodes,
const geom::Envelope env = nullptr 
)
std::unique_ptr<index::SegmentIntersector> geos::geomgraph::GeometryGraph::computeSelfNodes ( algorithm::LineIntersector li,
bool  computeRingSelfNodes,
bool  isDoneIfProperInt,
const geom::Envelope env = nullptr 
)
void geos::geomgraph::GeometryGraph::computeSplitEdges ( std::vector< Edge * > *  edgelist)
index::EdgeSetIntersector* geos::geomgraph::GeometryGraph::createEdgeSetIntersector ( )
private

Allocates a new EdgeSetIntersector. Remember to delete it!

static geom::Location geos::geomgraph::GeometryGraph::determineBoundary ( int  boundaryCount)
static
static geom::Location geos::geomgraph::GeometryGraph::determineBoundary ( const algorithm::BoundaryNodeRule boundaryNodeRule,
int  boundaryCount 
)
static
Edge* geos::geomgraph::GeometryGraph::findEdge ( const geom::LineString line) const
const algorithm::BoundaryNodeRule& geos::geomgraph::GeometryGraph::getBoundaryNodeRule ( ) const
inline

Definition at line 252 of file GeometryGraph.h.

std::vector<Node*>* geos::geomgraph::GeometryGraph::getBoundaryNodes ( )

Returned object is owned by this GeometryGraph.

void geos::geomgraph::GeometryGraph::getBoundaryNodes ( std::vector< Node * > &  bdyNodes)
geom::CoordinateSequence* geos::geomgraph::GeometryGraph::getBoundaryPoints ( )

Returned object is owned by this GeometryGraph.

std::vector<Edge*>* geos::geomgraph::GeometryGraph::getEdges ( )
const geom::Geometry* geos::geomgraph::GeometryGraph::getGeometry ( )
const geom::Coordinate& geos::geomgraph::GeometryGraph::getInvalidPoint ( )
bool geos::geomgraph::GeometryGraph::hasTooFewPoints ( )
void geos::geomgraph::GeometryGraph::insertBoundaryPoint ( int  argIndex,
const geom::Coordinate coord 
)
private

Adds candidate boundary points using the current algorithm::BoundaryNodeRule.

This is used to add the boundary points of dim-1 geometries (Curves/MultiCurves).

void geos::geomgraph::GeometryGraph::insertPoint ( int  argIndex,
const geom::Coordinate coord,
geom::Location  onLocation 
)
private
static bool geos::geomgraph::GeometryGraph::isInBoundary ( int  boundaryCount)
static
GeometryGraph& geos::geomgraph::GeometryGraph::operator= ( const GeometryGraph rhs)
privatedelete

Member Data Documentation

int geos::geomgraph::GeometryGraph::argIndex
private

the index of this geometry as an argument to a spatial function (used for labelling)

Definition at line 104 of file GeometryGraph.h.

const algorithm::BoundaryNodeRule& geos::geomgraph::GeometryGraph::boundaryNodeRule
private

Definition at line 98 of file GeometryGraph.h.

std::unique_ptr< std::vector<Node*> > geos::geomgraph::GeometryGraph::boundaryNodes
private

Definition at line 109 of file GeometryGraph.h.

std::unique_ptr< geom::CoordinateSequence > geos::geomgraph::GeometryGraph::boundaryPoints
private

Cache for fast responses to getBoundaryPoints.

Definition at line 107 of file GeometryGraph.h.

bool geos::geomgraph::GeometryGraph::hasTooFewPointsVar
private

Definition at line 111 of file GeometryGraph.h.

geom::Coordinate geos::geomgraph::GeometryGraph::invalidPoint
private

Definition at line 113 of file GeometryGraph.h.

std::unordered_map<const geom::LineString*, Edge*> geos::geomgraph::GeometryGraph::lineEdgeMap
private

The lineEdgeMap is a map of the linestring components of the parentGeometry to the edges which are derived from them. This is used to efficiently perform findEdge queries

Following the above description there's no need to compare LineStrings other then by pointer value.

Definition at line 90 of file GeometryGraph.h.

const geom::Geometry* geos::geomgraph::GeometryGraph::parentGeom
private

Definition at line 80 of file GeometryGraph.h.

bool geos::geomgraph::GeometryGraph::useBoundaryDeterminationRule
private

If this flag is true, the Boundary Determination Rule will used when deciding whether nodes are in the boundary or not

Definition at line 96 of file GeometryGraph.h.


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