Class OverlayValidatedGeometryOperation

  • All Implemented Interfaces:
    GeometryOperation

    public class OverlayValidatedGeometryOperation
    extends java.lang.Object
    implements 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.

    • Constructor Detail

      • OverlayValidatedGeometryOperation

        public OverlayValidatedGeometryOperation()
      • OverlayValidatedGeometryOperation

        public OverlayValidatedGeometryOperation​(GeometryMethodOperation chainOp)
        Creates a new operation which chains to the given GeometryMethodOperation for non-intercepted methods.
        Parameters:
        chainOp - the operation to chain to
    • Method Detail

      • overlayOpCode

        public static int overlayOpCode​(java.lang.String methodName)
      • 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 interface GeometryOperation
        Parameters:
        opName - the name of the operation
        Returns:
        the class of the return type of the specified operation
      • invokeValidatedOverlayOp

        public Result invokeValidatedOverlayOp​(int opCode,
                                               Geometry g0,
                                               java.lang.Object[] args)
                                        throws java.lang.Exception
        Invokes an overlay op, optionally using snapping, and optionally validating the result.
        Parameters:
        opCode -
        g0 -
        args -
        Returns:
        the result
        Throws:
        java.lang.Exception
      • reportError

        private void reportError​(java.lang.String msg)
      • invokeGeometryOverlayMethod

        public static Geometry invokeGeometryOverlayMethod​(int opCode,
                                                           Geometry g0,
                                                           Geometry g1)