Table of Contents

Class IsValidOp

Namespace
NetTopologySuite.Operation.Valid
Assembly
NetTopologySuite.dll

Implements the algorithms required to compute the IsValid method for Geometrys. See the documentation for the various geometry types for a specification of validity.

public class IsValidOp
Inheritance
IsValidOp
Inherited Members

Constructors

IsValidOp(Geometry)

Creates a new validator for a geometry

public IsValidOp(Geometry inputGeometry)

Parameters

inputGeometry Geometry

The geometry to validate

Properties

IsSelfTouchingRingFormingHoleValid

Gets/Sets whether polygons using Self-Touching Rings to form holes are reported as valid. If this flag is set, the following Self-Touching conditions are treated as being valid:
- The shell ring self-touches to create a hole touching the shell.
- A hole ring self-touches to create two holes touching at a point.

The default (following the OGC SFS standard) is that this condition is not valid (false).

This does not affect whether Self-Touching Rings disconnecting the polygon interior are considered valid (these are considered to be invalid under the SFS, and many other spatial models as well). This includes "bow-tie" shells, which self-touch at a single point causing the interior to be disconnected, and "C-shaped" holes which self-touch at a single point causing an island to be formed.

[Obsolete("Use SelfTouchingRingFormingHoleValid")]
public bool IsSelfTouchingRingFormingHoleValid { get; set; }

Property Value

bool

States whether geometry with this condition is valid.

IsValid

Tests the validity of the input geometry.

public bool IsValid { get; }

Property Value

bool

true if the geometry is valid.

SelfTouchingRingFormingHoleValid

Gets or sets a value indicating whether polygons using Self-Touching Rings to form holes are reported as valid. If this flag is set, the following Self-Touching conditions are treated as being valid:

  • the shell ring self-touches to create a hole touching the shell
  • a hole ring self-touches to create two holes touching at a point

The default (following the OGC SFS standard) is that this condition is not valid (false).

Self-Touching Rings which disconnect the the polygon interior are still considered to be invalid (these are invalid under the SFS, and many other spatial models as well). This includes:
  • exverted ("bow-tie") shells which self-touch at a single point
  • inverted shells with the inversion touching the shell at another point
  • exverted holes with exversion touching the hole at another point
  • inverted ("C-shaped") holes which self-touch at a single point causing an island to be formed
  • inverted shells or exverted holes which form part of a chain of touching rings (which disconnect the interior)
public bool SelfTouchingRingFormingHoleValid { get; set; }

Property Value

bool

ValidationError

Gets a value indicating the validity of the geometry If not valid, returns the validation error for the geometry, or null if the geometry is valid.

public TopologyValidationError ValidationError { get; }

Property Value

TopologyValidationError

The validation error, if the geometry is invalid or null if the geometry is valid

Methods

CheckValid(Geometry)

Tests whether a Geometry is valid.

public static bool CheckValid(Geometry geom)

Parameters

geom Geometry

The geometry to test

Returns

bool

true if the geometry is valid

Remarks

In JTS this function is called IsValid

FindPointNotNode(Coordinate[], LinearRing, GeometryGraph)

Find a point from the list of testCoords that is NOT a node in the edge for the list of searchCoords.

[Obsolete]
public static Coordinate FindPointNotNode(Coordinate[] testCoords, LinearRing searchRing, GeometryGraph graph)

Parameters

testCoords Coordinate[]
searchRing LinearRing
graph GeometryGraph

Returns

Coordinate

The point found, or null if none found.

IsValidCoordinate(Coordinate)

Checks whether a coordinate is valid for processing. Coordinates are valid if their x and y ordinates are in the range of the floating point representation.

[Obsolete("Use Coordinate.IsValid")]
public static bool IsValidCoordinate(Coordinate coord)

Parameters

coord Coordinate

The coordinate to validate

Returns

bool

true if the coordinate is valid