GEOS 3.6.2
geos::operation::IsSimpleOp Class Reference

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.
 IsSimpleOp (const geom::Geometry &geom)
 Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule.
 IsSimpleOp (const geom::Geometry &geom, const algorithm::BoundaryNodeRule &boundaryNodeRule)
 Creates a simplicity checker using a given algorithm::BoundaryNodeRule.
bool isSimple ()
const geom::CoordinategetNonSimpleLocation () 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)

Detailed Description

Tests whether a Geometry is simple.

In general, the SFS specification of simplicity follows the rule:

  • A Geometry is simple if and only if the only self-intersections are at boundary points.

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:

  • Valid polygonal geometries are simple by definition, so isSimple trivially returns true. (Hint: in order to check if a polygonal geometry has self-intersections, use Geometry::isValid).
  • Linear geometries are simple iff they do not self-intersect at points other than boundary points. (Using the Mod-2 rule, this means that closed linestrings cannot be touched at their endpoints, since these are interior points, not boundary points).
  • Zero-dimensional geometries (points) are simple iff they have no repeated points.
  • Empty Geometrys are always simple
See also
algorithm::BoundaryNodeRule

Constructor & Destructor Documentation

◆ IsSimpleOp() [1/3]

geos::operation::IsSimpleOp::IsSimpleOp ( )

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

Deprecated
use IsSimpleOp(Geometry)

◆ IsSimpleOp() [2/3]

geos::operation::IsSimpleOp::IsSimpleOp ( const geom::Geometry & geom)

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

Parameters
geomThe geometry to test. Will store a reference: keep it alive.

◆ IsSimpleOp() [3/3]

geos::operation::IsSimpleOp::IsSimpleOp ( const geom::Geometry & geom,
const algorithm::BoundaryNodeRule & boundaryNodeRule )

Creates a simplicity checker using a given algorithm::BoundaryNodeRule.

Parameters
geomthe geometry to test
boundaryNodeRulethe rule to use.

Member Function Documentation

◆ getNonSimpleLocation()

const geom::Coordinate * geos::operation::IsSimpleOp::getNonSimpleLocation ( ) const
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.

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

◆ isSimple() [1/4]

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

Tests whether the geometry is simple.

Returns
true if the geometry is simple

◆ isSimple() [2/4]

bool geos::operation::IsSimpleOp::isSimple ( const geom::LineString * geom)

Reports whether a geom::LineString is simple.

Parameters
geomthe lineal geometry to test
Returns
true if the geometry is simple
Deprecated
use isSimple()

◆ isSimple() [3/4]

bool geos::operation::IsSimpleOp::isSimple ( const geom::MultiLineString * geom)

Reports whether a geom::MultiLineString is simple.

Parameters
geomthe lineal geometry to test
Returns
true if the geometry is simple
Deprecated
use isSimple()

◆ isSimple() [4/4]

bool geos::operation::IsSimpleOp::isSimple ( const geom::MultiPoint * mp)

A MultiPoint is simple iff it has no repeated points

Deprecated
use isSimple()

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