Class IsValidOp
Implements the algorithms required to compute the IsValid method for Geometrys. See the documentation for the various geometry types for a specification of validity.
Inherited Members
Namespace: NetTopologySuite.Operation.Valid
Assembly: NetTopologySuite.dll
Syntax
public class IsValidOp
Constructors
| Improve this Doc View SourceIsValidOp(Geometry)
Creates a new validator for a geometry
Declaration
public IsValidOp(Geometry inputGeometry)
Parameters
Type | Name | Description |
---|---|---|
Geometry | inputGeometry | The geometry to validate |
Properties
| Improve this Doc View SourceIsSelfTouchingRingFormingHoleValid
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.
Declaration
[Obsolete("Use SelfTouchingRingFormingHoleValid")]
public bool IsSelfTouchingRingFormingHoleValid { get; set; }
Property Value
Type | Description |
---|---|
Boolean | States whether geometry with this condition is valid. |
IsValid
Tests the validity of the input geometry.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
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)
Declaration
public bool SelfTouchingRingFormingHoleValid { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
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.
Declaration
public TopologyValidationError ValidationError { get; }
Property Value
Type | Description |
---|---|
TopologyValidationError | The validation error, if the geometry is invalid or null if the geometry is valid |
Methods
| Improve this Doc View SourceCheckValid(Geometry)
Tests whether a Geometry is valid.
Declaration
public static bool CheckValid(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry to test |
Returns
Type | Description |
---|---|
Boolean |
|
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.
Declaration
[Obsolete]
public static Coordinate FindPointNotNode(Coordinate[] testCoords, LinearRing searchRing, GeometryGraph graph)
Parameters
Type | Name | Description |
---|---|---|
Coordinate[] | testCoords | |
LinearRing | searchRing | |
GeometryGraph | graph |
Returns
Type | Description |
---|---|
Coordinate | The point found, or |
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.
Declaration
[Obsolete("Use Coordinate.IsValid")]
public static bool IsValidCoordinate(Coordinate coord)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | coord | The coordinate to validate |
Returns
Type | Description |
---|---|
Boolean |
|