Class BufferResultValidator
- java.lang.Object
-
- org.meteoinfo.jts.operation.buffer.validate.BufferResultValidator
-
public class BufferResultValidator extends java.lang.ObjectValidates that the result of a buffer operation is geometrically correct, within a computed tolerance.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.)
This test may be (much) more expensive than the original buffer computation.
-
-
Constructor Summary
Constructors Constructor Description BufferResultValidator(Geometry input, double distance, Geometry result)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GeometrygetErrorIndicator()Gets a geometry which indicates the location and nature of a validation failure.CoordinategetErrorLocation()java.lang.StringgetErrorMessage()booleanisValid()static booleanisValid(Geometry g, double distance, Geometry result)static java.lang.StringisValidMsg(Geometry g, double distance, Geometry result)Checks whether the geometry buffer is valid, and returns an error message if not.
-
-
-
Method Detail
-
isValidMsg
public static java.lang.String isValidMsg(Geometry g, double distance, Geometry result)
Checks whether the geometry buffer is valid, and returns an error message if not.- Parameters:
g-distance-result-- Returns:
- an appropriate error message or null if the buffer is valid
-
isValid
public boolean isValid()
-
getErrorMessage
public java.lang.String getErrorMessage()
-
getErrorLocation
public Coordinate getErrorLocation()
-
getErrorIndicator
public Geometry getErrorIndicator()
Gets a geometry which indicates the location and nature of a validation failure.If the failure is due to the buffer curve being too far or too close to the input, the indicator is a line segment showing the location and size of the discrepancy.
- Returns:
- a geometric error indicator or null if no error was found
-
-