public class BufferValidatedGeometryOperation extends java.lang.Object implements GeometryOperation
GeometryOperation
which validates the results of the
Geometry
buffer() method.
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.
This class can be used via the -geomop command-line option or by the <geometryOperation> XML test file setting.
Modifier and Type | Field and Description |
---|---|
private int |
argCount |
private GeometryMethodOperation |
chainOp |
private double |
distance |
private int |
endCapStyle |
private int |
quadSegments |
private boolean |
returnEmptyGC |
Constructor and Description |
---|
BufferValidatedGeometryOperation() |
BufferValidatedGeometryOperation(GeometryMethodOperation chainOp)
Creates a new operation which chains to the given
GeometryMethodOperation
for non-intercepted methods. |
Modifier and Type | Method and Description |
---|---|
private void |
checkContainment(Geometry geom,
Geometry buffer) |
private void |
checkDistance(Geometry geom,
double distance,
Geometry buffer) |
private void |
checkEmpty(Geometry geom) |
java.lang.Class |
getReturnType(java.lang.String opName)
Gets the class of the return type of the given operation.
|
Result |
invoke(java.lang.String opName,
Geometry geometry,
java.lang.Object[] args)
Invokes the named operation
|
private Geometry |
invokeBuffer(Geometry geom) |
private Result |
invokeBufferOpValidated(Geometry geometry,
java.lang.Object[] args) |
private boolean |
isEmptyBufferExpected(Geometry geom) |
private void |
parseArgs(java.lang.Object[] args) |
private void |
reportError(java.lang.String msg,
Coordinate loc) |
private void |
validate(Geometry geom,
Geometry buffer) |
private boolean returnEmptyGC
private GeometryMethodOperation chainOp
private int argCount
private double distance
private int quadSegments
private int endCapStyle
public BufferValidatedGeometryOperation()
public BufferValidatedGeometryOperation(GeometryMethodOperation chainOp)
GeometryMethodOperation
for non-intercepted methods.chainOp
- the operation to chain topublic java.lang.Class getReturnType(java.lang.String opName)
GeometryOperation
getReturnType
in interface GeometryOperation
opName
- the name of the operationpublic Result invoke(java.lang.String opName, Geometry geometry, java.lang.Object[] args) throws java.lang.Exception
invoke
in interface GeometryOperation
opName
- geometry
- args
- java.lang.Exception
GeometryOperation.invoke(java.lang.String, org.locationtech.jts.geom.Geometry, java.lang.Object[])
private void parseArgs(java.lang.Object[] args)
private Result invokeBufferOpValidated(Geometry geometry, java.lang.Object[] args)
private boolean isEmptyBufferExpected(Geometry geom)
private void checkEmpty(Geometry geom)
private void reportError(java.lang.String msg, Coordinate loc)