public class FastNodingValidator extends Object
SegmentString
s is correctly noded.
Indexing is used to improve performance.
By default validation stops after a single
non-noded intersection is detected.
Alternatively, it can be requested to detect all intersections
by using setFindAllIntersections(boolean)
.
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.
NodingIntersectionFinder
Constructor and Description |
---|
FastNodingValidator(Collection segStrings)
Creates a new noding validator for a given set of linework.
|
Modifier and Type | Method and Description |
---|---|
void |
checkValid()
Checks for an intersection and throws
a TopologyException if one is found.
|
static List |
computeIntersections(Collection segStrings)
Gets a list of all intersections found.
|
String |
getErrorMessage()
Returns an error message indicating the segments containing
the intersection.
|
List |
getIntersections()
Gets a list of all intersections found.
|
boolean |
isValid()
Checks for an intersection and
reports if one is found.
|
void |
setFindAllIntersections(boolean findAllIntersections) |
public FastNodingValidator(Collection segStrings)
segStrings
- a collection of SegmentString
spublic static List computeIntersections(Collection segStrings)
Coordinate
s.
List is empty if none were found.segStrings
- a collection of SegmentStringspublic void setFindAllIntersections(boolean findAllIntersections)
public List getIntersections()
Coordinate
s.
List is empty if none were found.public boolean isValid()
public String getErrorMessage()
public void checkValid()
TopologyException
- if an intersection is foundCopyright © 2022. All rights reserved.