public class FastNodingValidator
extends java.lang.Object
SegmentString
s is correctly noded.
Indexing is used to improve performance.
In the most common use case, validation stops after a single
non-noded intersection is detected,
but the class can be requested to detect all intersections
by using the setFindAllIntersections(boolean)
method.
The validator does not check for a-b-a topology collapse situations.
The validator does not check for endpoint-interior vertex intersections. This should not be a problem, since the JTS noders should be able to compute intersections between vertices correctly.
The client may either test the isValid()
condition,
or request that a suitable TopologyException
be thrown.
Modifier and Type | Field and Description |
---|---|
private boolean |
findAllIntersections |
private boolean |
isValid |
private LineIntersector |
li |
private InteriorIntersectionFinder |
segInt |
private java.util.Collection |
segStrings |
Constructor and Description |
---|
FastNodingValidator(java.util.Collection segStrings)
Creates a new noding validator for a given set of linework.
|
Modifier and Type | Method and Description |
---|---|
private void |
checkInteriorIntersections() |
void |
checkValid()
Checks for an intersection and throws
a TopologyException if one is found.
|
static java.util.List |
computeIntersections(java.util.Collection segStrings) |
private void |
execute() |
java.lang.String |
getErrorMessage()
Returns an error message indicating the segments containing
the intersection.
|
java.util.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) |
private LineIntersector li
private java.util.Collection segStrings
private boolean findAllIntersections
private InteriorIntersectionFinder segInt
private boolean isValid
public FastNodingValidator(java.util.Collection segStrings)
segStrings
- a collection of SegmentString
spublic static java.util.List computeIntersections(java.util.Collection segStrings)
public void setFindAllIntersections(boolean findAllIntersections)
public java.util.List getIntersections()
Coordinate
s.
List is empty if none were found.public boolean isValid()
public java.lang.String getErrorMessage()
public void checkValid()
TopologyException
- if an intersection is foundprivate void execute()
private void checkInteriorIntersections()