Package org.locationtech.jtstest.geomop
Class BufferValidatedGeometryOperation
- java.lang.Object
-
- org.locationtech.jtstest.geomop.BufferValidatedGeometryOperation
-
- All Implemented Interfaces:
GeometryOperation
public class BufferValidatedGeometryOperation extends java.lang.Object implements GeometryOperation
AGeometryOperation
which validates the results of theGeometry
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.
-
-
Field Summary
Fields Modifier and Type Field Description private int
argCount
private GeometryMethodOperation
chainOp
private double
distance
private int
endCapStyle
private int
quadSegments
private boolean
returnEmptyGC
-
Constructor Summary
Constructors Constructor Description BufferValidatedGeometryOperation()
BufferValidatedGeometryOperation(GeometryMethodOperation chainOp)
Creates a new operation which chains to the givenGeometryMethodOperation
for non-intercepted methods.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 operationprivate 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)
-
-
-
Field Detail
-
returnEmptyGC
private boolean returnEmptyGC
-
chainOp
private GeometryMethodOperation chainOp
-
argCount
private int argCount
-
distance
private double distance
-
quadSegments
private int quadSegments
-
endCapStyle
private int endCapStyle
-
-
Constructor Detail
-
BufferValidatedGeometryOperation
public BufferValidatedGeometryOperation()
-
BufferValidatedGeometryOperation
public BufferValidatedGeometryOperation(GeometryMethodOperation chainOp)
Creates a new operation which chains to the givenGeometryMethodOperation
for non-intercepted methods.- Parameters:
chainOp
- the operation to chain to
-
-
Method Detail
-
getReturnType
public java.lang.Class getReturnType(java.lang.String opName)
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
public Result invoke(java.lang.String opName, Geometry geometry, java.lang.Object[] args) throws java.lang.Exception
Invokes the named operation- Specified by:
invoke
in interfaceGeometryOperation
- Parameters:
opName
-geometry
-args
-- Returns:
- the result
- Throws:
java.lang.Exception
- See Also:
GeometryOperation.invoke(java.lang.String, org.locationtech.jts.geom.Geometry, java.lang.Object[])
-
parseArgs
private void parseArgs(java.lang.Object[] args)
-
invokeBufferOpValidated
private Result invokeBufferOpValidated(Geometry geometry, java.lang.Object[] args)
-
isEmptyBufferExpected
private boolean isEmptyBufferExpected(Geometry geom)
-
checkEmpty
private void checkEmpty(Geometry geom)
-
reportError
private void reportError(java.lang.String msg, Coordinate loc)
-
-