GEOS
3.9.1dev
|
Represents a ring of PolygonizeDirectedEdge which form a ring of a polygon. The ring may be either an outer shell or a hole. More...
#include <EdgeRing.h>
Public Member Functions | |
void | add (const PolygonizeDirectedEdge *de) |
Adds a DirectedEdge which is known to form part of this ring. More... | |
EdgeRing * | findEdgeRingContaining (const std::vector< EdgeRing * > &erList) |
Find the innermost enclosing shell EdgeRing containing this, if any. More... | |
EdgeRing (const geom::GeometryFactory *newFactory) | |
~EdgeRing ()=default | |
void | build (PolygonizeDirectedEdge *startDE) |
void | computeHole () |
bool | isHole () const |
Tests whether this ring is a hole. More... | |
bool | isIncludedSet () const |
bool | isIncluded () const |
void | setIncluded (bool included) |
bool | isProcessed () const |
void | setProcessed (bool processed) |
void | setShell (EdgeRing *shellRing) |
Sets the containing shell ring of a ring that has been determined to be a hole. More... | |
bool | hasShell () const |
Tests whether this ring has a shell assigned to it. More... | |
EdgeRing * | getShell () |
Gets the shell for this ring. The shell is the ring itself if it is not a hole, otherwise it is the parent shell. More... | |
bool | isOuterHole () const |
Tests whether this ring is an outer hole. A hole is an outer hole if it is not contained by any shell. More... | |
bool | isOuterShell () const |
Tests whether this ring is an outer shell. More... | |
EdgeRing * | getOuterHole () const |
Gets the outer hole of a shell, if it has one. An outer hole is one that is not contained in any other shell. More... | |
void | updateIncludedRecursive () |
Updates the included status for currently non-included shells based on whether they are adjacent to an included shell. More... | |
void | addHole (geom::LinearRing *hole) |
Adds a hole to the polygon formed by this ring. More... | |
void | addHole (EdgeRing *holeER) |
std::unique_ptr< geom::Polygon > | getPolygon () |
Computes the Polygon formed by this ring and any contained holes. More... | |
bool | isValid () |
Tests if the LinearRing ring formed by this edge ring is topologically valid. More... | |
std::unique_ptr< geom::LineString > | getLineString () |
Gets the coordinates for this ring as a LineString. More... | |
geom::LinearRing * | getRingInternal () |
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topology problem). More... | |
std::unique_ptr< geom::LinearRing > | getRingOwnership () |
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topology problem). More... | |
bool | isInRing (const geom::Coordinate &pt) |
Static Public Member Functions | |
static std::vector< PolygonizeDirectedEdge * > | findDirEdgesInRing (PolygonizeDirectedEdge *startDE) |
Traverses a ring of DirectedEdges, accumulating them into a list. More... | |
static const geom::Coordinate & | ptNotInList (const geom::CoordinateSequence *testPts, const geom::CoordinateSequence *pts) |
Finds a point in a list of points which is not contained in another list of points. More... | |
static bool | isInList (const geom::Coordinate &pt, const geom::CoordinateSequence *pts) |
Tests whether a given point is in an array of points. Uses a value-based test. More... | |
Private Types | |
typedef std::vector< const PolygonizeDirectedEdge * > | DeList |
Private Member Functions | |
const geom::CoordinateSequence * | getCoordinates () |
Computes the list of coordinates which are contained in this ring. The coordinates are computed once only and cached. More... | |
algorithm::locate::PointOnGeometryLocator * | getLocator () |
Static Private Member Functions | |
static void | addEdge (const geom::CoordinateSequence *coords, bool isForward, geom::CoordinateArraySequence *coordList) |
Private Attributes | |
const geom::GeometryFactory * | factory |
DeList | deList |
std::unique_ptr< geom::LinearRing > | ring |
std::unique_ptr< geom::CoordinateArraySequence > | ringPts |
std::unique_ptr< algorithm::locate::PointOnGeometryLocator > | ringLocator |
std::unique_ptr< std::vector< std::unique_ptr< geom::LinearRing > > > | holes |
EdgeRing * | shell = nullptr |
bool | is_hole |
bool | is_processed = false |
bool | is_included_set = false |
bool | is_included = false |
bool | visitedByUpdateIncludedRecursive = false |
Represents a ring of PolygonizeDirectedEdge which form a ring of a polygon. The ring may be either an outer shell or a hole.
Definition at line 66 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 70 of file operation/polygonize/EdgeRing.h.
|
explicit |
|
default |
void geos::operation::polygonize::EdgeRing::add | ( | const PolygonizeDirectedEdge * | de | ) |
Adds a DirectedEdge which is known to form part of this ring.
de | the DirectedEdge to add. Ownership to the caller. |
|
staticprivate |
void geos::operation::polygonize::EdgeRing::addHole | ( | geom::LinearRing * | hole | ) |
Adds a hole to the polygon formed by this ring.
hole | the LinearRing forming the hole. |
void geos::operation::polygonize::EdgeRing::addHole | ( | EdgeRing * | holeER | ) |
void geos::operation::polygonize::EdgeRing::build | ( | PolygonizeDirectedEdge * | startDE | ) |
void geos::operation::polygonize::EdgeRing::computeHole | ( | ) |
|
static |
Traverses a ring of DirectedEdges, accumulating them into a list.
This assumes that all dangling directed edges have been removed from the graph, so that there is always a next dirEdge.
startDE | the DirectedEdge to start traversing at |
EdgeRing* geos::operation::polygonize::EdgeRing::findEdgeRingContaining | ( | const std::vector< EdgeRing * > & | erList | ) |
Find the innermost enclosing shell EdgeRing containing this, if any.
The innermost enclosing ring is the smallest enclosing ring. The algorithm used depends on the fact that:
ring A contains ring B iff envelope(ring A) contains envelope(ring B)
This routine is only safe to use if the chosen point of the hole is known to be properly contained in a shell (which is guaranteed to be the case if the hole does not touch its shell)
|
private |
Computes the list of coordinates which are contained in this ring. The coordinates are computed once only and cached.
std::unique_ptr<geom::LineString> geos::operation::polygonize::EdgeRing::getLineString | ( | ) |
Gets the coordinates for this ring as a LineString.
Used to return the coordinates in this ring as a valid geometry, when it has been detected that the ring is topologically invalid.
|
inlineprivate |
Definition at line 99 of file operation/polygonize/EdgeRing.h.
EdgeRing* geos::operation::polygonize::EdgeRing::getOuterHole | ( | ) | const |
Gets the outer hole of a shell, if it has one. An outer hole is one that is not contained in any other shell.
Each disjoint connected group of shells is surrounded by an outer hole.
std::unique_ptr<geom::Polygon> geos::operation::polygonize::EdgeRing::getPolygon | ( | ) |
Computes the Polygon formed by this ring and any contained holes.
LinearRings ownership is transferred to returned polygon. Subsequent calls to the function will return NULL.
geom::LinearRing* geos::operation::polygonize::EdgeRing::getRingInternal | ( | ) |
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topology problem).
Ownership of ring is retained by the object. Details of problems are written to standard output.
std::unique_ptr<geom::LinearRing> geos::operation::polygonize::EdgeRing::getRingOwnership | ( | ) |
Returns this ring as a LinearRing, or null if an Exception occurs while creating it (such as a topology problem).
Details of problems are written to standard output. Caller gets ownership of ring.
|
inline |
Gets the shell for this ring. The shell is the ring itself if it is not a hole, otherwise it is the parent shell.
Definition at line 241 of file operation/polygonize/EdgeRing.h.
|
inline |
Tests whether this ring has a shell assigned to it.
Definition at line 231 of file operation/polygonize/EdgeRing.h.
|
inline |
Tests whether this ring is a hole.
Due to the way the edges in the polyongization graph are linked, a ring is a hole if it is oriented counter-clockwise.
true
if this ring is a hole Definition at line 186 of file operation/polygonize/EdgeRing.h.
|
inline |
Definition at line 200 of file operation/polygonize/EdgeRing.h.
|
inline |
Definition at line 193 of file operation/polygonize/EdgeRing.h.
|
static |
Tests whether a given point is in an array of points. Uses a value-based test.
pt | a Coordinate for the test point |
pts | an array of Coordinate to test |
true
if the point is in the array
|
inline |
Definition at line 338 of file operation/polygonize/EdgeRing.h.
References geos::geom::EXTERIOR.
|
inline |
Tests whether this ring is an outer hole. A hole is an outer hole if it is not contained by any shell.
Definition at line 251 of file operation/polygonize/EdgeRing.h.
|
inline |
Tests whether this ring is an outer shell.
Definition at line 264 of file operation/polygonize/EdgeRing.h.
|
inline |
Definition at line 209 of file operation/polygonize/EdgeRing.h.
bool geos::operation::polygonize::EdgeRing::isValid | ( | ) |
Tests if the LinearRing ring formed by this edge ring is topologically valid.
|
static |
Finds a point in a list of points which is not contained in another list of points.
testPts | the CoordinateSequence to test |
pts | the CoordinateSequence to test the input points against |
testPts
which is not in pts
, or Coordinate::nullCoord
|
inline |
Definition at line 204 of file operation/polygonize/EdgeRing.h.
|
inline |
Definition at line 213 of file operation/polygonize/EdgeRing.h.
|
inline |
Sets the containing shell ring of a ring that has been determined to be a hole.
shellRing | the shell ring |
Definition at line 222 of file operation/polygonize/EdgeRing.h.
void geos::operation::polygonize::EdgeRing::updateIncludedRecursive | ( | ) |
Updates the included status for currently non-included shells based on whether they are adjacent to an included shell.
|
private |
Definition at line 71 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 68 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 78 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 81 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 84 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 83 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 82 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 74 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 76 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 75 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 80 of file operation/polygonize/EdgeRing.h.
|
private |
Definition at line 85 of file operation/polygonize/EdgeRing.h.