Class IsSimpleOp
- Namespace
- NetTopologySuite.Operation.Valid
- Assembly
- NetTopologySuite.dll
Tests whether a Geometry
is simple as defined by the OGC SFS specification.
- 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
LineString
s 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
GeometryThe geometry to test
- See Also
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 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
- 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 ornull
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
Coordinate
s 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
GeometryThe 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
GeometryThe input geometry
Returns
- bool
true
if the geometry is simple
- See Also