public class BufferDistanceValidator
extends java.lang.Object
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.)
Modifier and Type | Field and Description |
---|---|
private double |
bufDistance |
private java.lang.String |
errMsg |
private Geometry |
errorIndicator |
private Coordinate |
errorLocation |
private Geometry |
input |
private boolean |
isValid |
private static double |
MAX_DISTANCE_DIFF_FRAC
Maximum allowable fraction of buffer distance the
actual distance can differ by.
|
private double |
maxDistanceFound |
private double |
maxValidDistance |
private double |
minDistanceFound |
private double |
minValidDistance |
private Geometry |
result |
private static boolean |
VERBOSE |
Constructor and Description |
---|
BufferDistanceValidator(Geometry input,
double bufDistance,
Geometry result) |
Modifier and Type | Method and Description |
---|---|
private void |
checkMaximumDistance(Geometry input,
Geometry bufCurve,
double maxDist)
Checks that the furthest distance from the buffer curve to the input
is less than the given maximum distance.
|
private void |
checkMinimumDistance(Geometry g1,
Geometry g2,
double minDist)
Checks that two geometries are at least a minimum distance apart.
|
private void |
checkNegativeValid() |
private void |
checkPositiveValid() |
Geometry |
getErrorIndicator()
Gets a geometry which indicates the location and nature of a validation failure.
|
Coordinate |
getErrorLocation() |
java.lang.String |
getErrorMessage() |
private Geometry |
getPolygonLines(Geometry g) |
boolean |
isValid() |
private static boolean VERBOSE
private static final double MAX_DISTANCE_DIFF_FRAC
private Geometry input
private double bufDistance
private Geometry result
private double minValidDistance
private double maxValidDistance
private double minDistanceFound
private double maxDistanceFound
private boolean isValid
private java.lang.String errMsg
private Coordinate errorLocation
private Geometry errorIndicator
public boolean isValid()
public java.lang.String getErrorMessage()
public Coordinate getErrorLocation()
public Geometry getErrorIndicator()
The indicator is a line segment showing the location and size of the distance discrepancy.
private void checkPositiveValid()
private void checkNegativeValid()
private void checkMinimumDistance(Geometry g1, Geometry g2, double minDist)
g1
- a geometryg2
- a geometryminDist
- the minimum distance the geometries should be separated byprivate void checkMaximumDistance(Geometry input, Geometry bufCurve, double maxDist)
input
- a geometrybufCurve
- a geometrymaxDist
- the maximum distance that a buffer result can be from the input