@Test public void testGeographicLargeAccurateResolutionFlags() throws Exception { String testLocation = "geographicLarge"; URL storeUrl = TestData.url(this, "geotiff/world.tiff"); File testData = new File(storeUrl.toURI()); File testDirectory = crsMosaicFolder.newFolder(testLocation); FileUtils.copyFileToDirectory(testData, testDirectory); ImageMosaicReader imReader = new ImageMosaicReader(testDirectory, null); ReferencedEnvelope mapExtent = new ReferencedEnvelope(-180, 180, -80, 80, DefaultGeographicCRS.WGS84); CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3857"); ReferencedEnvelope requestedEnvelope = mapExtent.transform(targetCRS, true); GridCoverageReaderHelper helper = new GridCoverageReaderHelper( reader, new Rectangle(90, 40), requestedEnvelope, Interpolation.getInstance(Interpolation.INTERP_NEAREST)); MathTransform originalG2W = imReader.getOriginalGridToWorld(PixelInCell.CELL_CENTER); AffineTransform at = (AffineTransform) originalG2W; final double originalResolution = 0.9d; assertEquals(Math.abs(at.getScaleX()), originalResolution, EPS); assertEquals(Math.abs(at.getScaleY()), originalResolution, EPS); ProjectionHandler handler = ProjectionHandlerFinder.getHandler( mapExtent, reader.getCoordinateReferenceSystem(), true); List<GridCoverage2D> coverages = helper.readCoverages(null, handler); at = (AffineTransform) coverages.get(0).getGridGeometry().getGridToCRS(); assertTrue(Math.abs(at.getScaleX()) <= originalResolution); assertTrue(Math.abs(at.getScaleY()) <= originalResolution); ParameterValue<Boolean> accurateResolution = ImageMosaicFormat.ACCURATE_RESOLUTION.createValue(); accurateResolution.setValue(false); coverages = helper.readCoverages(new GeneralParameterValue[] {accurateResolution}, handler); at = (AffineTransform) coverages.get(0).getGridGeometry().getGridToCRS(); assertTrue(Math.abs(at.getScaleX()) > (originalResolution * 3)); assertTrue(Math.abs(at.getScaleY()) > (originalResolution * 3)); }
public List<GridCoverage2D> readCoverages( final GeneralParameterValue[] readParams, ProjectionHandler handler) throws IOException, FactoryException, TransformException { return readCoverages(readParams, handler, new GridCoverageFactory()); }
GridCoverageReaderHelper { public List<GridCoverage2D> readCoverages( final GeneralParameterValue[] readParams, ProjectionHandler handler) throws IOException, FactoryException, TransformException { return readCoverages(readParams, handler, new GridCoverageFactory()); } }
GridCoverageReaderHelper { public List<GridCoverage2D> readCoverages( final GeneralParameterValue[] readParams, ProjectionHandler handler) throws IOException, FactoryException, TransformException { return readCoverages(readParams, handler, new GridCoverageFactory()); } GridCoverageReaderHelper(
            GridCoverage2DReader reader,
            Rectangle mapRasterArea,
            ReferencedEnvelope mapExtent,
            Interpolation interpolation);  GridCoverageReaderHelper(
            GridCoverage2DReader reader,
            Rectangle mapRasterArea,
            ReferencedEnvelope mapExtent,
            Interpolation interpolation,
            Hints hints); }
GridCoverageReaderHelper { public List<GridCoverage2D> readCoverages( final GeneralParameterValue[] readParams, ProjectionHandler handler) throws IOException, FactoryException, TransformException { return readCoverages(readParams, handler, new GridCoverageFactory()); } GridCoverageReaderHelper(
            GridCoverage2DReader reader,
            Rectangle mapRasterArea,
            ReferencedEnvelope mapExtent,
            Interpolation interpolation);  GridCoverageReaderHelper(
            GridCoverage2DReader reader,
            Rectangle mapRasterArea,
            ReferencedEnvelope mapExtent,
            Interpolation interpolation,
            Hints hints); static boolean isReprojectingReader(GridCoverage2DReader reader); ReferencedEnvelope getReadEnvelope(); GridCoverage2D readCoverage(final GeneralParameterValue[] params); List<GridCoverage2D> readCoverages(
            final GeneralParameterValue[] readParams, ProjectionHandler handler); List<GridCoverage2D> readCoverages(
            final GeneralParameterValue[] readParams,
            ProjectionHandler handler,
            GridCoverageFactory gridCoverageFactory); }
GridCoverageReaderHelper { public List<GridCoverage2D> readCoverages( final GeneralParameterValue[] readParams, ProjectionHandler handler) throws IOException, FactoryException, TransformException { return readCoverages(readParams, handler, new GridCoverageFactory()); } GridCoverageReaderHelper(
            GridCoverage2DReader reader,
            Rectangle mapRasterArea,
            ReferencedEnvelope mapExtent,
            Interpolation interpolation);  GridCoverageReaderHelper(
            GridCoverage2DReader reader,
            Rectangle mapRasterArea,
            ReferencedEnvelope mapExtent,
            Interpolation interpolation,
            Hints hints); static boolean isReprojectingReader(GridCoverage2DReader reader); ReferencedEnvelope getReadEnvelope(); GridCoverage2D readCoverage(final GeneralParameterValue[] params); List<GridCoverage2D> readCoverages(
            final GeneralParameterValue[] readParams, ProjectionHandler handler); List<GridCoverage2D> readCoverages(
            final GeneralParameterValue[] readParams,
            ProjectionHandler handler,
            GridCoverageFactory gridCoverageFactory);  }