GEOS
3.6.1
|
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 () |
const geom::Coordinate * | getNonSimpleLocation () const |
bool | isSimple (const geom::LineString *geom) |
bool | isSimple (const geom::MultiLineString *geom) |
bool | isSimple (const geom::MultiPoint *mp) |
bool | isSimpleLinearGeometry (const geom::Geometry *geom) |
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 Geometry::isValid).Geometry
s are always simplegeos::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. |
|
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.
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