GEOS
3.9.1dev
|
Tests whether a Geometry is simple. More...
#include <IsSimpleOp.h>
Public Member Functions | |
IsSimpleOp () | |
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule. More... | |
IsSimpleOp (const geom::Geometry &geom) | |
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule. More... | |
IsSimpleOp (const geom::Geometry &geom, const algorithm::BoundaryNodeRule &boundaryNodeRule) | |
Creates a simplicity checker using a given algorithm::BoundaryNodeRule. More... | |
bool | isSimple () |
Tests whether the geometry is simple. More... | |
const geom::Coordinate * | getNonSimpleLocation () const |
Gets a coordinate for the location where the geometry fails to be simple (i.e. where it has a non-boundary self-intersection). More... | |
bool | isSimple (const geom::LineString *geom) |
Reports whether a geom::LineString is simple. More... | |
bool | isSimple (const geom::MultiLineString *geom) |
Reports whether a geom::MultiLineString is simple. More... | |
bool | isSimple (const geom::MultiPoint *mp) |
A MultiPoint is simple iff it has no repeated points. More... | |
bool | isSimpleLinearGeometry (const geom::Geometry *geom) |
Private Member Functions | |
bool | hasNonEndpointIntersection (geomgraph::GeometryGraph &graph) |
bool | hasClosedEndpointIntersection (geomgraph::GeometryGraph &graph) |
bool | computeSimple (const geom::Geometry *geom) |
bool | isSimplePolygonal (const geom::Geometry *geom) |
bool | isSimpleGeometryCollection (const geom::GeometryCollection *col) |
void | addEndpoint (std::map< const geom::Coordinate *, EndpointInfo *, geom::CoordinateLessThen > &endPoints, const geom::Coordinate *p, bool isClosed) |
bool | isSimpleMultiPoint (const geom::MultiPoint &mp) |
Private Attributes | |
bool | isClosedEndpointsInInterior |
const geom::Geometry * | geom |
std::unique_ptr< geom::Coordinate > | nonSimpleLocation |
Tests whether a Geometry is simple.
In general, the SFS specification of simplicity follows the rule:
This definition relies on the definition of boundary points. The SFS uses the Mod-2 rule to determine which points are on the boundary of lineal geometries, but this class supports using other BoundaryNodeRules as well.
Simplicity is defined for each Geometry subclass as follows:
isSimple
trivially returns true. (Hint: in order to check if a polygonal geometry has self-intersections, use geom::Geometry::isValid()).Geometry
s are always simpleDefinition at line 96 of file IsSimpleOp.h.
geos::operation::IsSimpleOp::IsSimpleOp | ( | ) |
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule.
geos::operation::IsSimpleOp::IsSimpleOp | ( | const geom::Geometry & | geom | ) |
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule.
geom | The geometry to test. Will store a reference: keep it alive. |
geos::operation::IsSimpleOp::IsSimpleOp | ( | const geom::Geometry & | geom, |
const algorithm::BoundaryNodeRule & | boundaryNodeRule | ||
) |
Creates a simplicity checker using a given algorithm::BoundaryNodeRule.
geom | the geometry to test |
boundaryNodeRule | the rule to use. |
|
private |
Add an endpoint to the map, creating an entry for it if none exists
|
private |
|
inline |
Gets a coordinate for the location where the geometry fails to be simple (i.e. where it has a non-boundary self-intersection).
isSimple must be called before this method is called.
Definition at line 145 of file IsSimpleOp.h.
|
private |
Tests that no edge intersection is the endpoint of a closed line. This ensures that closed lines are not touched at their endpoint, which is an interior point according to the Mod-2 rule To check this we compute the degree of each endpoint. The degree of endpoints of closed lines must be exactly 2.
|
private |
For all edges, check if there are any intersections which are NOT at an endpoint. The Geometry is not simple if there are intersections not at endpoints.
bool geos::operation::IsSimpleOp::isSimple | ( | ) |
Tests whether the geometry is simple.
bool geos::operation::IsSimpleOp::isSimple | ( | const geom::LineString * | geom | ) |
Reports whether a geom::LineString is simple.
geom | the lineal geometry to test |
bool geos::operation::IsSimpleOp::isSimple | ( | const geom::MultiLineString * | geom | ) |
Reports whether a geom::MultiLineString is simple.
geom | the lineal geometry to test |
bool geos::operation::IsSimpleOp::isSimple | ( | const geom::MultiPoint * | mp | ) |
A MultiPoint is simple iff it has no repeated points.
|
private |
bool geos::operation::IsSimpleOp::isSimpleLinearGeometry | ( | const geom::Geometry * | geom | ) |
|
private |
|
private |
|
private |
Definition at line 214 of file IsSimpleOp.h.
|
private |
Definition at line 210 of file IsSimpleOp.h.
|
private |
Definition at line 216 of file IsSimpleOp.h.