Class OverlayResultValidator
- java.lang.Object
-
- org.locationtech.jts.operation.overlay.validate.OverlayResultValidator
-
public class OverlayResultValidator extends java.lang.ObjectValidates that the result of an overlay operation is geometrically correct, within a determined tolerance. Uses fuzzy point location to find points which are definitely in either the interior or exterior of the result geometry, and compares these results with the expected ones.This algorithm is only useful where the inputs are polygonal. This is a heuristic test, and may return false positive results (I.e. it may fail to detect an invalid result.) It should never return a false negative result, however (I.e. it should never report a valid result as invalid.)
- Version:
- 1.7
- See Also:
OverlayOp
-
-
Field Summary
Fields Modifier and Type Field Description private doubleboundaryDistanceToleranceprivate Geometry[]geomprivate CoordinateinvalidLocationprivate int[]locationprivate FuzzyPointLocator[]locFinderprivate java.util.ListtestCoordsprivate static doubleTOLERANCE
-
Constructor Summary
Constructors Constructor Description OverlayResultValidator(Geometry a, Geometry b, Geometry result)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddTestPts(Geometry g)private booleancheckValid(int overlayOp)private booleancheckValid(int overlayOp, Coordinate pt)private static doublecomputeBoundaryDistanceTolerance(Geometry g0, Geometry g1)CoordinategetInvalidLocation()private static booleanhasLocation(int[] location, int loc)booleanisValid(int overlayOp)static booleanisValid(Geometry a, Geometry b, int overlayOp, Geometry result)private booleanisValidResult(int overlayOp, int[] location)private voidreportResult(int overlayOp, int[] location, boolean expectedInterior)
-
-
-
Field Detail
-
TOLERANCE
private static final double TOLERANCE
- See Also:
- Constant Field Values
-
geom
private Geometry[] geom
-
locFinder
private FuzzyPointLocator[] locFinder
-
location
private int[] location
-
invalidLocation
private Coordinate invalidLocation
-
boundaryDistanceTolerance
private double boundaryDistanceTolerance
-
testCoords
private java.util.List testCoords
-
-
Method Detail
-
computeBoundaryDistanceTolerance
private static double computeBoundaryDistanceTolerance(Geometry g0, Geometry g1)
-
isValid
public boolean isValid(int overlayOp)
-
getInvalidLocation
public Coordinate getInvalidLocation()
-
addTestPts
private void addTestPts(Geometry g)
-
checkValid
private boolean checkValid(int overlayOp)
-
checkValid
private boolean checkValid(int overlayOp, Coordinate pt)
-
hasLocation
private static boolean hasLocation(int[] location, int loc)
-
isValidResult
private boolean isValidResult(int overlayOp, int[] location)
-
reportResult
private void reportResult(int overlayOp, int[] location, boolean expectedInterior)
-
-