Package org.locationtech.jtstest.geomop
Class OverlayValidatedGeometryOperation
java.lang.Object
org.locationtech.jtstest.geomop.OverlayValidatedGeometryOperation
- All Implemented Interfaces:
GeometryOperation
A
GeometryOperation
which validates the result of overlay operations.
If an invalid result is found, an exception is thrown (this is the most
convenient and noticeable way of flagging the problem when using the TestRunner).
All other Geometry methods are executed normally.
In order to eliminate the need to specify the precise result of an overlay, this class forces the final return value to be GEOMETRYCOLLECTION EMPTY.
This class can be used via the -geomop command-line option or by the <geometryOperation> XML test file setting.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final double
private GeometryMethodOperation
private boolean
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new operation which chains to the givenGeometryMethodOperation
for non-intercepted methods. -
Method Summary
Modifier and TypeMethodDescriptionstatic double
private void
areaValidate
(Geometry g0, Geometry g1) getReturnType
(String opName) Gets the class of the return type of the given operation.Invokes the named operationstatic Geometry
invokeGeometryOverlayMethod
(int opCode, Geometry g0, Geometry g1) invokeValidatedOverlayOp
(int opCode, Geometry g0, Object[] args) Invokes an overlay op, optionally using snapping, and optionally validating the result.static int
overlayOpCode
(String methodName) private void
reportError
(String msg) private void
-
Field Details
-
returnEmptyGC
private boolean returnEmptyGC -
chainOp
-
AREA_DIFF_TOL
private static final double AREA_DIFF_TOL- See Also:
-
-
Constructor Details
-
OverlayValidatedGeometryOperation
public OverlayValidatedGeometryOperation() -
OverlayValidatedGeometryOperation
Creates a new operation which chains to the givenGeometryMethodOperation
for non-intercepted methods.- Parameters:
chainOp
- the operation to chain to
-
-
Method Details
-
overlayOpCode
-
getReturnType
Description copied from interface:GeometryOperation
Gets the class of the return type of the given operation.- Specified by:
getReturnType
in interfaceGeometryOperation
- Parameters:
opName
- the name of the operation- Returns:
- the class of the return type of the specified operation
-
invoke
Invokes the named operation- Specified by:
invoke
in interfaceGeometryOperation
- Parameters:
opName
-geometry
-args
-- Returns:
- the result
- Throws:
Exception
- See Also:
-
invokeValidatedOverlayOp
Invokes an overlay op, optionally using snapping, and optionally validating the result.- Parameters:
opCode
-g0
-args
-- Returns:
- the result
- Throws:
Exception
-
validate
-
areaValidate
-
areaDiff
-
reportError
-
invokeGeometryOverlayMethod
-