@Test public void testLargeScale() { float[][] grid = new float[2][2]; final GridCoverageFactory coverageFactory = CoverageFactoryFinder.getGridCoverageFactory(GeoTools.getDefaultHints()); final GridCoverage2D coverage = coverageFactory.create( "geohashGridAgg", grid, new ReferencedEnvelope(0, 1, 0, 1, null)); GridCoverage2D scaled = GridCoverageUtil.scale(coverage, 1501, 1499); final RenderedImage renderedImage = scaled.getRenderedImage(); assertEquals(1499, renderedImage.getWidth()); assertEquals(1501, renderedImage.getHeight()); }
public static GridCoverage2D scale(GridCoverage2D coverage, float width, float height) { final RenderedImage renderedImage = coverage.getRenderedImage(); final Raster renderedGrid = renderedImage.getData(); float yScale = width / renderedGrid.getWidth(); float xScale = height / renderedGrid.getHeight(); final Operations ops = new Operations(null); return (GridCoverage2D) ops.scale(coverage, xScale, yScale, 0, 0); }
GridCoverageUtil { public static GridCoverage2D scale(GridCoverage2D coverage, float width, float height) { final RenderedImage renderedImage = coverage.getRenderedImage(); final Raster renderedGrid = renderedImage.getData(); float yScale = width / renderedGrid.getWidth(); float xScale = height / renderedGrid.getHeight(); final Operations ops = new Operations(null); return (GridCoverage2D) ops.scale(coverage, xScale, yScale, 0, 0); } }
GridCoverageUtil { public static GridCoverage2D scale(GridCoverage2D coverage, float width, float height) { final RenderedImage renderedImage = coverage.getRenderedImage(); final Raster renderedGrid = renderedImage.getData(); float yScale = width / renderedGrid.getWidth(); float xScale = height / renderedGrid.getHeight(); final Operations ops = new Operations(null); return (GridCoverage2D) ops.scale(coverage, xScale, yScale, 0, 0); }  }
GridCoverageUtil { public static GridCoverage2D scale(GridCoverage2D coverage, float width, float height) { final RenderedImage renderedImage = coverage.getRenderedImage(); final Raster renderedGrid = renderedImage.getData(); float yScale = width / renderedGrid.getWidth(); float xScale = height / renderedGrid.getHeight(); final Operations ops = new Operations(null); return (GridCoverage2D) ops.scale(coverage, xScale, yScale, 0, 0); }  static GridCoverage2D scale(GridCoverage2D coverage, float width, float height); static GridCoverage2D crop(GridCoverage2D coverage, Envelope envelope); }
GridCoverageUtil { public static GridCoverage2D scale(GridCoverage2D coverage, float width, float height) { final RenderedImage renderedImage = coverage.getRenderedImage(); final Raster renderedGrid = renderedImage.getData(); float yScale = width / renderedGrid.getWidth(); float xScale = height / renderedGrid.getHeight(); final Operations ops = new Operations(null); return (GridCoverage2D) ops.scale(coverage, xScale, yScale, 0, 0); }  static GridCoverage2D scale(GridCoverage2D coverage, float width, float height); static GridCoverage2D crop(GridCoverage2D coverage, Envelope envelope);  }