Table of Contents

Class IsSimpleOp

Namespace
NetTopologySuite.Operation.Valid
Assembly
NetTopologySuite.dll

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

Simplicity is defined for each Geometry type as follows:
  • Pointgeometries are simple.
  • MultiPointgeometries are simple if every point is unique
  • LineStringgeometries are simple if they do not self-intersect at interior points (i.e.points other than the endpoints). Closed linestrings which intersect only at their endpoints are simple (i.e. valid LinearRingss.
  • MultiLineStringgeometries are simple if their elements are simple and they intersect only at points which are boundary points of both elements. (The notion of boundary points can be user-specified - see below).
  • Polygonalgeometries have no definition of simplicity. The IsSimple code checks if all polygon rings are simple. (Note: this means thatIsSimple cannot be used to test for all self-intersections in Polygon s. In order to check if a IPolygonal geometry has self-intersections, use IsValid.
  • GeometryCollectiongeometries are simple if all their elements are simple.
  • Empty geometries are simple
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 Mod2BoundaryRule.

Note that under the Mod-2 rule, closed LineStrings (rings) have no boundary. This means that an intersection at the endpoints of two closed LineStrings makes the geometry non-simple. 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 EndpointBoundaryRule. 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 FindAllLocations before calling IsSimple(), and retrieve the locations via NonSimpleLocations. This can be used to find all intersection points in a linear network.
public class IsSimpleOp
Inheritance
IsSimpleOp
Inherited Members

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

See Also

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 boundary node rule to use

See Also

Properties

FindAllLocations

Gets or sets a value indicating if all non-simple points should be reported.

public bool FindAllLocations { get; set; }

Property Value

bool
See Also

NonSimpleLocation

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

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

See Also

NonSimpleLocations

Gets all non-simple intersection locations.

public IList<Coordinate> NonSimpleLocations { get; }

Property Value

IList<Coordinate>

A list of the Coordinates of non-simple locations.

See Also

Methods

GetNonSimpleLocation(Geometry)

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

public static Coordinate GetNonSimpleLocation(Geometry geom)

Parameters

geom Geometry

The input geometry

Returns

Coordinate

A non-simple location, or null if the geometry is simple

See Also

IsSimple()

Tests whether the geometry is simple.

public bool IsSimple()

Returns

bool

true if the geometry is simple.

See Also

IsSimple(Geometry)

Tests whether a geometry is simple.

public static bool IsSimple(Geometry geom)

Parameters

geom Geometry

The input geometry

Returns

bool

true if the geometry is simple

See Also

See Also