GEOS 3.11.1
Public Member Functions | Static Public Member Functions | List of all members
geos::operation::valid::IsSimpleOp Class Reference

#include <IsSimpleOp.h>

Public Member Functions

 IsSimpleOp (const geom::Geometry *geom)
 
 IsSimpleOp (const geom::Geometry &geom)
 
 IsSimpleOp (const geom::Geometry &geom, const algorithm::BoundaryNodeRule &p_boundaryNodeRule)
 
geom::Coordinate getNonSimpleLocation (const geom::Geometry &geom)
 
void setFindAllLocations (bool isFindAll)
 
bool isSimple ()
 
geom::Coordinate getNonSimpleLocation ()
 
const std::vector< geom::Coordinate > & getNonSimpleLocations ()
 

Static Public Member Functions

static bool isSimple (const geom::Geometry &geom)
 
static bool isSimple (const geom::Geometry *geom)
 

Detailed Description

Tests whether a Geometry is simple as defined by the OGC SFS specification.

Simplicity is defined for each geom::Geometry type as follows:

For linear geometries the evaluation of simplicity can be customized by supplying a BoundaryNodeRule to define how boundary points are determined. The default is the SFS-standard.

Note that under the Mod-2 rule, closed LineStrings (rings) have no boundary. This means that an intersection at their endpoints makes the geometry non-simple. If it is required to test whether a set of LineStrings touch only at their endpoints, use BoundaryNodeRule::getBoundaryEndPoint(). For example, this can be used to validate that a collection of lines form a topologically valid linear network.

By default this class finds a single non-simple location. To find all non-simple locations, set setFindAllLocations(bool) before calling isSimple(), and retrieve the locations via getNonSimpleLocations(). This can be used to find all intersection points in a linear network.

See also
BoundaryNodeRule

Constructor & Destructor Documentation

◆ IsSimpleOp() [1/2]

geos::operation::valid::IsSimpleOp::IsSimpleOp ( const geom::Geometry geom)
inline

Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule

Parameters
geomthe geometry to test

◆ IsSimpleOp() [2/2]

geos::operation::valid::IsSimpleOp::IsSimpleOp ( const geom::Geometry geom,
const algorithm::BoundaryNodeRule p_boundaryNodeRule 
)
inline

Creates a simplicity checker using a given algorithm::BoundaryNodeRule

Parameters
geomthe geometry to test
p_boundaryNodeRulethe boundary node rule to use.

Member Function Documentation

◆ getNonSimpleLocation() [1/2]

geom::Coordinate geos::operation::valid::IsSimpleOp::getNonSimpleLocation ( )

Gets the coordinate for an location where the geometry fails to be simple. (i.e. where it has a non-boundary self-intersection).

Returns
a coordinate for the location of the non-boundary self-intersection or null if the geometry is simple

◆ getNonSimpleLocation() [2/2]

geom::Coordinate geos::operation::valid::IsSimpleOp::getNonSimpleLocation ( const geom::Geometry geom)

Gets a non-simple location in a geometry, if any.

Parameters
geomthe input geometry
Returns
a non-simple location, or null if the geometry is simple

◆ getNonSimpleLocations()

const std::vector< geom::Coordinate > & geos::operation::valid::IsSimpleOp::getNonSimpleLocations ( )

Gets all non-simple intersection locations.

Returns
a list of the coordinates of non-simple locations

◆ isSimple() [1/2]

bool geos::operation::valid::IsSimpleOp::isSimple ( )

Tests whether the geometry is simple.

Returns
true if the geometry is simple

◆ isSimple() [2/2]

static bool geos::operation::valid::IsSimpleOp::isSimple ( const geom::Geometry geom)
static

Tests whether a geometry is simple.

Parameters
geomthe geometry to test
Returns
true if the geometry is simple

◆ setFindAllLocations()

void geos::operation::valid::IsSimpleOp::setFindAllLocations ( bool  isFindAll)

Sets whether all non-simple intersection points will be found.

Parameters
isFindAllwhether to find all non-simple points

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