Class IsSimpleOp
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.
Inherited Members
Namespace: NetTopologySuite.Operation
Assembly: NetTopologySuite.dll
Syntax
[Obsolete("Replaced by NetTopologySuite.Operation.Valid.IsSimpleOp")]
public class IsSimpleOp
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
| Improve this Doc View SourceIsSimpleOp(Geometry)
Creates a simplicity checker using the default SFS Mod-2 Boundary Node Rule
Declaration
public IsSimpleOp(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry to test |
IsSimpleOp(Geometry, IBoundaryNodeRule)
Creates a simplicity checker using a given IBoundaryNodeRule
Declaration
public IsSimpleOp(Geometry geom, IBoundaryNodeRule boundaryNodeRule)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry to test |
IBoundaryNodeRule | boundaryNodeRule | The rule to use |
Properties
| Improve this Doc View SourceNonSimpleLocation
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
Declaration
public Coordinate NonSimpleLocation { get; }
Property Value
Type | Description |
---|---|
Coordinate | a coordinate for the location of the non-boundary self-intersection
or |
Methods
| Improve this Doc View SourceIsSimple()
Tests whether the geometry is simple.
Declaration
public bool IsSimple()
Returns
Type | Description |
---|---|
Boolean | true if the geometry is simple |