Table of Contents

Class IsSimpleOp

Namespace
NetTopologySuite.Operation
Assembly
NetTopologySuite.dll

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.
[Obsolete("Replaced by NetTopologySuite.Operation.Valid.IsSimpleOp")]
public class IsSimpleOp
Inheritance
IsSimpleOp
Inherited Members

Remarks

Simplicity is defined for each Geometry} subclass as follows:

  • Valid IPolygonal geometries are simple by definition, so IsSimple trivially returns true.
    (Note: this means that IsSimple cannot be used to test for (invalid) self-intersections in Polygons. In order to check if a Polygonal geometry has self-intersections, use IsValid).
  • ILineal geometries are simple if and only if they do not self-intersect at interior points (i.e. points other than boundary points). This is equivalent to saying that no two linear components satisfy the SFS Touches(Geometry) predicate.
  • Zero-dimensional (IPuntal) geometries are simple if and only if they have no repeated points.
  • Empty Geometrys are always simple by definition.
For ILineal geometries the evaluation of simplicity can be customized by supplying a IBoundaryNodeRule to define how boundary points are determined. The default is the SFS-standard BoundaryNodeRules.Mod2BoundaryNodeRule. Note that under the Mod-2 rule, closed LineStrings (rings) will never satisfy the touches predicate at their endpoints, since these are interior points, not boundary points. If it is required to test whether a set of LineStrings touch only at their endpoints, use IsSimpleOp with EndpointBoundaryRule. For example, this can be used to validate that a set of lines form a topologically valid linear network.

Constructors

IsSimpleOp(Geometry)

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

public IsSimpleOp(Geometry geom)

Parameters

geom Geometry

The geometry to test

IsSimpleOp(Geometry, IBoundaryNodeRule)

Creates a simplicity checker using a given IBoundaryNodeRule

public IsSimpleOp(Geometry geom, IBoundaryNodeRule boundaryNodeRule)

Parameters

geom Geometry

The geometry to test

boundaryNodeRule IBoundaryNodeRule

The rule to use

Properties

NonSimpleLocation

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 location is accessed

public Coordinate NonSimpleLocation { get; }

Property Value

Coordinate

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

Methods

IsSimple()

Tests whether the geometry is simple.

public bool IsSimple()

Returns

bool

true if the geometry is simple