AffineProcess implements RasterProcess { @DescribeResult(name = "result", description = "Raster transformed by an Affine transformation") public GridCoverage2D execute( @DescribeParameter(name = "coverage", description = "Input raster", min = 1) GridCoverage2D coverage, @DescribeParameter(name = "scalex", description = "Scale parameter for the X direction", min = 0) Double scaleX, @DescribeParameter(name = "scaley", description = "Scale parameter for the Y direction", min = 0) Double scaleY, @DescribeParameter(name = "shearx", description = "Shear parameter for the X direction", min = 0) Double shearX, @DescribeParameter(name = "sheary", description = "Shear parameter for the Y direction", min = 0) Double shearY, @DescribeParameter(name = "translatex", description = "Offset parameter for the X direction", min = 0) Double translateX, @DescribeParameter(name = "translatey", description = "Offset parameter for the Y direction", min = 0) Double translateY, @DescribeParameter(name = "nodata", description = "Output coverage nodata values", min = 0) double[] nodata, @DescribeParameter(name = "interpolation", description = "Interpolation function to use. Values are NEAREST, BILINEAR, BICUBIC2, BICUBIC", min = 0) Interpolation interp) throws ProcessException { double xScale = scaleX != null ? scaleX : 1; double yScale = scaleY != null ? scaleY : 1; double xShear = shearX != null ? shearX : 0; double yShear = shearY != null ? shearY : 0; double xTrans = translateX != null ? translateX : 0; double yTrans = translateY != null ? translateY : 0; AffineTransform transform = new AffineTransform(xScale, yShear, xShear, yScale, xTrans, yTrans); final ParameterValueGroup params = AFFINE.getParameters(); params.parameter("Source").setValue(coverage); params.parameter("transform").setValue(transform); if (nodata != null) { params.parameter("backgroundValues").setValue(nodata); } if (interp != null) { params.parameter("interpolation").setValue(interp); } return (GridCoverage2D) PROCESSOR.doOperation(params); }  @DescribeResult(name = "result", description = "Raster transformed by an Affine transformation") GridCoverage2D execute(
            @DescribeParameter(name = "coverage", description = "Input raster", min = 1) GridCoverage2D coverage,
            @DescribeParameter(name = "scalex", description = "Scale parameter for the X direction", min = 0) Double scaleX,
            @DescribeParameter(name = "scaley", description = "Scale parameter for the Y direction", min = 0) Double scaleY,
            @DescribeParameter(name = "shearx", description = "Shear parameter for the X direction", min = 0) Double shearX,
            @DescribeParameter(name = "sheary", description = "Shear parameter for the Y direction", min = 0) Double shearY,
            @DescribeParameter(name = "translatex", description = "Offset parameter for the X direction", min = 0) Double translateX,
            @DescribeParameter(name = "translatey", description = "Offset parameter for the Y direction", min = 0) Double translateY,
            @DescribeParameter(name = "nodata", description = "Output coverage nodata values", min = 0) double[] nodata,
            @DescribeParameter(name = "interpolation", description = "Interpolation function to use.  Values are NEAREST, BILINEAR, BICUBIC2, BICUBIC", min = 0) Interpolation interp);  }
@Test public void testNoInterp() { AffineProcess process = new AffineProcess(); GridCoverage2D result = process.execute(coverage, m00, m11, m01, m10, m02, m12, nodata, null); ensureCorrectTransformation(result, m00, m11, m02, m12); }
@Test public void testNoBackground() { AffineProcess process = new AffineProcess(); GridCoverage2D result = process.execute(coverage, m00, m11, m01, m10, m02, m12, null, nearest); ensureCorrectTransformation(result, m00, m11, m02, m12); }
@Test public void testIdentity() { AffineProcess process = new AffineProcess(); GridCoverage2D result = process.execute(coverage, null, null, null, null, null, null, nodata, nearest); ensureCorrectTransformation(result, 1, 1, 0, 0); }
@Test public void testNearestInterp() { AffineProcess process = new AffineProcess(); GridCoverage2D result = process.execute(coverage, m00, m11, m01, m10, m02, m12, nodata, nearest); ensureCorrectTransformation(result, m00, m11, m02, m12); }
@Test public void testBilinearInterp() { AffineProcess process = new AffineProcess(); GridCoverage2D result = process.execute(coverage, m00, m11, m01, m10, m02, m12, nodata, bilinear); ensureCorrectTransformation(result, m00, m11, m02, m12); }
@Test public void testBicubicInterp() { AffineProcess process = new AffineProcess(); GridCoverage2D result = process.execute(coverage, m00, m11, m01, m10, m02, m12, nodata, bicubic); ensureCorrectTransformation(result, m00, m11, m02, m12); }