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.
LineString
s 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
GeometryThe geometry to test
IsSimpleOp(Geometry, IBoundaryNodeRule)
Creates a simplicity checker using a given IBoundaryNodeRule
public IsSimpleOp(Geometry geom, IBoundaryNodeRule boundaryNodeRule)
Parameters
geom
GeometryThe geometry to test
boundaryNodeRule
IBoundaryNodeRuleThe 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