Class FastNodingValidator
Validates that a collection of ISegmentStrings is correctly noded. Indexing is used to improve performance.
Inherited Members
Namespace: NetTopologySuite.Noding
Assembly: NetTopologySuite.dll
Syntax
public class FastNodingValidator
Remarks
By default validation stops after a single non-noded intersection is detected. Alternatively, it can be requested to detect all intersections by using the FindAllIntersections property.
The validator does not check for topology collapse situations (e.g. where two segment strings are fully co-incident).
The validator checks for the following situations which indicated incorrect noding:
The client may either test the IsValid condition, or request that a suitable TopologyException be thrown.
Constructors
| Improve this Doc View SourceFastNodingValidator(IEnumerable<ISegmentString>)
Creates a new noding validator for a given set of linework.
Declaration
public FastNodingValidator(IEnumerable<ISegmentString> segStrings)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ISegmentString> | segStrings | A collection of ISegmentStrings |
Properties
| Improve this Doc View SourceFindAllIntersections
Gets or sets whether all intersections should be found.
Declaration
public bool FindAllIntersections { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Intersections
Gets a list of all intersections found.
Declaration
public IList<Coordinate> Intersections { get; }
Property Value
Type | Description |
---|---|
IList<Coordinate> |
IsValid
Checks for an intersection and reports if one is found.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceCheckValid()
Checks for an intersection and throws a TopologyException if one is found.
Declaration
public void CheckValid()
Exceptions
Type | Condition |
---|---|
TopologyException | if an intersection is found |
ComputeIntersections(IEnumerable<ISegmentString>)
Gets a list of all intersections found. Intersections are represented as Coordinates. List is empty if none were found.
A collection of SegmentStringsDeclaration
public static IList<Coordinate> ComputeIntersections(IEnumerable<ISegmentString> segStrings)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ISegmentString> | segStrings |
Returns
Type | Description |
---|---|
IList<Coordinate> |
GetErrorMessage()
Returns an error message indicating the segments containing the intersection.
Declaration
public string GetErrorMessage()
Returns
Type | Description |
---|---|
String | an error message documenting the intersection location |