Search Results for

    Show / Hide Table of Contents

    Class IsSimpleOp

    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.
    Inheritance
    object
    IsSimpleOp
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Operation.Valid
    Assembly: NetTopologySuite.dll
    Syntax
    public class IsSimpleOp

    Constructors

    | Edit this page View Source

    IsSimpleOp(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

    | Edit this page View Source

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

    Properties

    | Edit this page View Source

    FindAllLocations

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

    Declaration
    public bool FindAllLocations { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    NonSimpleLocation

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

    Declaration
    public Coordinate NonSimpleLocation { get; }
    Property Value
    Type Description
    Coordinate

    A Coordinate for the location of the non-boundary self-intersection or null if the geometry is simple

    | Edit this page View Source

    NonSimpleLocations

    Gets all non-simple intersection locations.

    Declaration
    public IList<Coordinate> NonSimpleLocations { get; }
    Property Value
    Type Description
    IList<Coordinate>

    A list of the Coordinates of non-simple locations.

    Methods

    | Edit this page View Source

    GetNonSimpleLocation(Geometry)

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

    Declaration
    public static Coordinate GetNonSimpleLocation(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom

    The input geometry

    Returns
    Type Description
    Coordinate

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

    | Edit this page View Source

    IsSimple()

    Tests whether the geometry is simple.

    Declaration
    public bool IsSimple()
    Returns
    Type Description
    bool

    true if the geometry is simple.

    | Edit this page View Source

    IsSimple(Geometry)

    Tests whether a geometry is simple.

    Declaration
    public static bool IsSimple(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom

    The input geometry

    Returns
    Type Description
    bool

    true if the geometry is simple

    See Also

    IBoundaryNodeRule
    IsEmpty
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX