public class OverlayValidatedGeometryOperation extends Object implements GeometryOperation
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.
Constructor and Description |
---|
OverlayValidatedGeometryOperation() |
OverlayValidatedGeometryOperation(GeometryMethodOperation chainOp)
Creates a new operation which chains to the given
GeometryMethodOperation
for non-intercepted methods. |
Modifier and Type | Method and Description |
---|---|
static double |
areaDiff(Geometry g0,
Geometry g1) |
Class |
getReturnType(String opName)
Gets the class of the return type of the given operation.
|
Result |
invoke(String opName,
Geometry geometry,
Object[] args)
Invokes the named operation
|
static Geometry |
invokeGeometryOverlayMethod(int opCode,
Geometry g0,
Geometry g1) |
Result |
invokeValidatedOverlayOp(int opCode,
Geometry g0,
Object[] args)
Invokes an overlay op, optionally using snapping,
and optionally validating the result.
|
static int |
overlayOpCode(String methodName) |
public OverlayValidatedGeometryOperation()
public OverlayValidatedGeometryOperation(GeometryMethodOperation chainOp)
GeometryMethodOperation
for non-intercepted methods.chainOp
- the operation to chain topublic static int overlayOpCode(String methodName)
public Class getReturnType(String opName)
GeometryOperation
getReturnType
in interface GeometryOperation
opName
- the name of the operationpublic Result invoke(String opName, Geometry geometry, Object[] args) throws Exception
invoke
in interface GeometryOperation
opName
- geometry
- args
- Exception
GeometryOperation.invoke(java.lang.String, org.locationtech.jts.geom.Geometry, java.lang.Object[])
public Result invokeValidatedOverlayOp(int opCode, Geometry g0, Object[] args) throws Exception
opCode
- g0
- args
- Exception
Copyright © 2018. All rights reserved.