private void readAllTiledRasters( final List<RasterQueryInfo> queries, final TiledRasterReader rasterReader, final LoggingHelper log) throws IOException { for (RasterQueryInfo queryInfo : queries) { final Long rasterId = queryInfo.getRasterId(); final RenderedImage rasterImage; try { final int pyramidLevel = queryInfo.getPyramidLevel(); final GridEnvelope matchingTiles = queryInfo.getMatchingTiles(); // final Point imageLocation = queryInfo.getTiledImageSize().getLocation(); rasterImage = rasterReader.read(rasterId, pyramidLevel, matchingTiles); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Fetching data for " + queryInfo.toString(), e); throw e; } queryInfo.setResultImage(rasterImage); { LOGGER.finer(queryInfo.toString()); log.appendLoggingGeometries(LoggingHelper.MOSAIC_EXPECTED, queryInfo.getMosaicLocation()); log.appendLoggingGeometries(LoggingHelper.MOSAIC_ENV, queryInfo.getResultEnvelope()); // final Rectangle tiledImageSize = queryInfo.getTiledImageSize(); // int width = rasterImage.getWidth(); // int height = rasterImage.getHeight(); // if (tiledImageSize.width != width || tiledImageSize.height != height) { // throw new IllegalStateException( // "Read image is not of the expected size. Image=" + width + "x" + height // + ", expected: " + tiledImageSize.width + "x" // + tiledImageSize.height); // } } } }