public GeoPackageReader(Object source, Hints hints) throws IOException { coverageFactory = CoverageFactoryFinder.getGridCoverageFactory(this.hints); sourceFile = GeoPackageFormat.getFileFromSource(source); file = new GeoPackage(sourceFile, null, null, true); for (TileEntry tile : file.tiles()) { tiles.put(tile.getTableName(), tile); } // have a sane default when hit with no name, useful in particular // when the geopackage only has one coverage coverageName = tiles.keySet().iterator().next(); // add the overview count and allocate the final List<TileMatrix> tileMatricies = tiles.get(coverageName).getTileMatricies(); this.numOverviews = tileMatricies.size() - 1; overViewResolutions = new double[numOverviews][2]; // first tile matrix is the one with the lowest resolution, last one is native for (int i = 0; i < tileMatricies.size() - 1; i++) { final TileMatrix matrix = tileMatricies.get(i); overViewResolutions[tileMatricies.size() - i - 2] = new double[] {matrix.getXPixelSize(), matrix.getYPixelSize()}; } }
public GeoPackageReader(Object source, Hints hints) throws IOException { coverageFactory = CoverageFactoryFinder.getGridCoverageFactory(this.hints); sourceFile = GeoPackageFormat.getFileFromSource(source); file = new GeoPackage(sourceFile, null, null, true); for (TileEntry tile : file.tiles()) { tiles.put(tile.getTableName(), tile); } // have a sane default when hit with no name, useful in particular // when the geopackage only has one coverage coverageName = tiles.keySet().iterator().next(); }