Search in sources :

Example 1 with GeometryResult

use of com.revolsys.geometry.test.testrunner.GeometryResult in project com.revolsys.open by revolsys.

the class OverlayValidatedGeometryOperation method invokeValidatedOverlayOp.

/**
 * Invokes an overlay op, optionally using snapping,
 * and optionally validating the result.
 *
 * @param opCode
 * @param g0
 * @param args
 * @return the result
 * @throws Exception
 */
public Result invokeValidatedOverlayOp(final int opCode, final Geometry g0, final Object[] args) throws Exception {
    Geometry result = null;
    final Geometry g1 = (Geometry) args[0];
    result = invokeGeometryOverlayMethod(opCode, g0, g1);
    // validate
    validate(opCode, g0, g1, result);
    areaValidate(g0, g1);
    /**
     * Return an empty GeometryCollection as the result.
     * This allows the test case to avoid specifying an exact result
     */
    if (this.returnEmptyGC) {
        result = result.getGeometryFactory().geometryCollection();
    }
    return new GeometryResult(result);
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometryResult(com.revolsys.geometry.test.testrunner.GeometryResult)

Example 2 with GeometryResult

use of com.revolsys.geometry.test.testrunner.GeometryResult in project com.revolsys.open by revolsys.

the class BufferValidatedGeometryOperation method invokeBufferOpValidated.

private Result invokeBufferOpValidated(final Geometry geometry, final Object[] args) {
    Geometry result = null;
    result = invokeBuffer(geometry);
    // validate
    validate(geometry, result);
    /**
     * Return an empty GeometryCollection as the result.
     * This allows the test case to avoid specifying an exact result
     */
    if (this.returnEmptyGC) {
        result = result.getGeometryFactory().geometryCollection();
    }
    return new GeometryResult(result);
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometryResult(com.revolsys.geometry.test.testrunner.GeometryResult)

Aggregations

Geometry (com.revolsys.geometry.model.Geometry)2 GeometryResult (com.revolsys.geometry.test.testrunner.GeometryResult)2