Using GeoTools GeoTiffReader to read resolution other than the max

158 views Asked by At

I have a geotiff file. I can read the highest resolution level just fine using:

        GeoTiffReader reader = new GeoTiffReader(file, new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE));        
        String[] gridCoverageNames = reader.getGridCoverageNames();
        GridCoverage2D coverage = reader.read(gridCoverageNames[0], null);

        // now time to read a lower resolution  
        int numOverviews = reader.getNumOverviews();
        double[][] resolutionLevels = reader.getResolutionLevels();
        //now what??

The numOverviews returns a value of 6 and I can also use the getResolutionLevels to get the resolutions of the various levels.

It seems like what I want to do is call setLayout or setReadParams on the reader but these are protected.

How do I read the lower resolution images in the file?

0

There are 0 answers