@Test public void testConvolveCircle() throws Exception { ConvolveCoverageProcess p = new ConvolveCoverageProcess(); GridCoverage2D result = p.execute(cov, null, 1, 0, 0); float[] grid = data(result); assertNotEquals(0d, grid[5], 0.1); assertNotEquals(covData[1][0], grid[5], 0.1); }
@DescribeResult(name = "result", description = "Convoluted raster") public GridCoverage2D execute( @DescribeParameter(name = "data", description = "Input raster") GridCoverage2D coverage, @DescribeParameter(name = "kernel", description = "Convolution kernel", min = 0) KernelJAI kernel, @DescribeParameter( name = "kernelRadius", description = "Radius for a circular kernel", min = 0 ) Integer kernelRadius, @DescribeParameter( name = "kernelWidth", description = "Width for rectangular kernel", min = 0 ) Integer kernelWidth, @DescribeParameter( name = "kernelHeight", description = "Height for rectangular kernel", min = 0 ) Integer kernelHeight) throws IOException { final ParameterValueGroup param = PROCESSOR.getOperation("Convolve").getParameters(); param.parameter("Source").setValue(coverage); if (kernel == null) { if (kernelRadius != null && kernelRadius > 0) { kernel = KernelFactory.createCircle(kernelRadius); } else if (kernelWidth != null) { if (kernelHeight == null) { kernelHeight = kernelWidth; } kernel = KernelFactory.createRectangle(kernelWidth, kernelHeight); } } if (kernel == null) { throw new ProcessException("No kernel argument specified"); } param.parameter("kernel").setValue(kernel); return (GridCoverage2D) PROCESSOR.doOperation(param); }
ConvolveCoverageProcess implements RasterProcess { @DescribeResult(name = "result", description = "Convoluted raster") public GridCoverage2D execute( @DescribeParameter(name = "data", description = "Input raster") GridCoverage2D coverage, @DescribeParameter(name = "kernel", description = "Convolution kernel", min = 0) KernelJAI kernel, @DescribeParameter( name = "kernelRadius", description = "Radius for a circular kernel", min = 0 ) Integer kernelRadius, @DescribeParameter( name = "kernelWidth", description = "Width for rectangular kernel", min = 0 ) Integer kernelWidth, @DescribeParameter( name = "kernelHeight", description = "Height for rectangular kernel", min = 0 ) Integer kernelHeight) throws IOException { final ParameterValueGroup param = PROCESSOR.getOperation("Convolve").getParameters(); param.parameter("Source").setValue(coverage); if (kernel == null) { if (kernelRadius != null && kernelRadius > 0) { kernel = KernelFactory.createCircle(kernelRadius); } else if (kernelWidth != null) { if (kernelHeight == null) { kernelHeight = kernelWidth; } kernel = KernelFactory.createRectangle(kernelWidth, kernelHeight); } } if (kernel == null) { throw new ProcessException("No kernel argument specified"); } param.parameter("kernel").setValue(kernel); return (GridCoverage2D) PROCESSOR.doOperation(param); } }
ConvolveCoverageProcess implements RasterProcess { @DescribeResult(name = "result", description = "Convoluted raster") public GridCoverage2D execute( @DescribeParameter(name = "data", description = "Input raster") GridCoverage2D coverage, @DescribeParameter(name = "kernel", description = "Convolution kernel", min = 0) KernelJAI kernel, @DescribeParameter( name = "kernelRadius", description = "Radius for a circular kernel", min = 0 ) Integer kernelRadius, @DescribeParameter( name = "kernelWidth", description = "Width for rectangular kernel", min = 0 ) Integer kernelWidth, @DescribeParameter( name = "kernelHeight", description = "Height for rectangular kernel", min = 0 ) Integer kernelHeight) throws IOException { final ParameterValueGroup param = PROCESSOR.getOperation("Convolve").getParameters(); param.parameter("Source").setValue(coverage); if (kernel == null) { if (kernelRadius != null && kernelRadius > 0) { kernel = KernelFactory.createCircle(kernelRadius); } else if (kernelWidth != null) { if (kernelHeight == null) { kernelHeight = kernelWidth; } kernel = KernelFactory.createRectangle(kernelWidth, kernelHeight); } } if (kernel == null) { throw new ProcessException("No kernel argument specified"); } param.parameter("kernel").setValue(kernel); return (GridCoverage2D) PROCESSOR.doOperation(param); }  }
ConvolveCoverageProcess implements RasterProcess { @DescribeResult(name = "result", description = "Convoluted raster") public GridCoverage2D execute( @DescribeParameter(name = "data", description = "Input raster") GridCoverage2D coverage, @DescribeParameter(name = "kernel", description = "Convolution kernel", min = 0) KernelJAI kernel, @DescribeParameter( name = "kernelRadius", description = "Radius for a circular kernel", min = 0 ) Integer kernelRadius, @DescribeParameter( name = "kernelWidth", description = "Width for rectangular kernel", min = 0 ) Integer kernelWidth, @DescribeParameter( name = "kernelHeight", description = "Height for rectangular kernel", min = 0 ) Integer kernelHeight) throws IOException { final ParameterValueGroup param = PROCESSOR.getOperation("Convolve").getParameters(); param.parameter("Source").setValue(coverage); if (kernel == null) { if (kernelRadius != null && kernelRadius > 0) { kernel = KernelFactory.createCircle(kernelRadius); } else if (kernelWidth != null) { if (kernelHeight == null) { kernelHeight = kernelWidth; } kernel = KernelFactory.createRectangle(kernelWidth, kernelHeight); } } if (kernel == null) { throw new ProcessException("No kernel argument specified"); } param.parameter("kernel").setValue(kernel); return (GridCoverage2D) PROCESSOR.doOperation(param); }  @DescribeResult(name = "result", description = "Convoluted raster") GridCoverage2D execute(
            @DescribeParameter(name = "data", description = "Input raster") GridCoverage2D coverage,
            @DescribeParameter(name = "kernel", description = "Convolution kernel", min = 0)
                    KernelJAI kernel,
            @DescribeParameter(
                        name = "kernelRadius",
                        description = "Radius for a circular kernel",
                        min = 0
                    )
                    Integer kernelRadius,
            @DescribeParameter(
                        name = "kernelWidth",
                        description = "Width for rectangular kernel",
                        min = 0
                    )
                    Integer kernelWidth,
            @DescribeParameter(
                        name = "kernelHeight",
                        description = "Height for rectangular kernel",
                        min = 0
                    )
                    Integer kernelHeight); }
ConvolveCoverageProcess implements RasterProcess { @DescribeResult(name = "result", description = "Convoluted raster") public GridCoverage2D execute( @DescribeParameter(name = "data", description = "Input raster") GridCoverage2D coverage, @DescribeParameter(name = "kernel", description = "Convolution kernel", min = 0) KernelJAI kernel, @DescribeParameter( name = "kernelRadius", description = "Radius for a circular kernel", min = 0 ) Integer kernelRadius, @DescribeParameter( name = "kernelWidth", description = "Width for rectangular kernel", min = 0 ) Integer kernelWidth, @DescribeParameter( name = "kernelHeight", description = "Height for rectangular kernel", min = 0 ) Integer kernelHeight) throws IOException { final ParameterValueGroup param = PROCESSOR.getOperation("Convolve").getParameters(); param.parameter("Source").setValue(coverage); if (kernel == null) { if (kernelRadius != null && kernelRadius > 0) { kernel = KernelFactory.createCircle(kernelRadius); } else if (kernelWidth != null) { if (kernelHeight == null) { kernelHeight = kernelWidth; } kernel = KernelFactory.createRectangle(kernelWidth, kernelHeight); } } if (kernel == null) { throw new ProcessException("No kernel argument specified"); } param.parameter("kernel").setValue(kernel); return (GridCoverage2D) PROCESSOR.doOperation(param); }  @DescribeResult(name = "result", description = "Convoluted raster") GridCoverage2D execute(
            @DescribeParameter(name = "data", description = "Input raster") GridCoverage2D coverage,
            @DescribeParameter(name = "kernel", description = "Convolution kernel", min = 0)
                    KernelJAI kernel,
            @DescribeParameter(
                        name = "kernelRadius",
                        description = "Radius for a circular kernel",
                        min = 0
                    )
                    Integer kernelRadius,
            @DescribeParameter(
                        name = "kernelWidth",
                        description = "Width for rectangular kernel",
                        min = 0
                    )
                    Integer kernelWidth,
            @DescribeParameter(
                        name = "kernelHeight",
                        description = "Height for rectangular kernel",
                        min = 0
                    )
                    Integer kernelHeight);  }