/** * Creates a new {@link GriddedTileContainer} instances. * * @param infoFile * containing the relevant information. * */ protected GriddedTileContainer( GridMetaInfoFile infoFile ) { this.rdi = infoFile.getDataInfo(); this.envelope = infoFile.getEnvelope( OriginLocation.OUTER ); this.envelopeWidth = envelope.getMax().get0() - envelope.getMin().get0(); this.envelopeHeight = envelope.getMax().get1() - envelope.getMin().get1(); // this.envelopeWidth = envelope.getSpan0(); // this.envelopeHeight = envelope.getSpan1(); this.rows = infoFile.rows(); this.columns = infoFile.columns(); this.tileSamplesX = infoFile.getTileRasterWidth(); this.tileSamplesY = infoFile.getTileRasterHeight(); this.tileWidth = envelopeWidth / columns; this.tileHeight = envelopeHeight / rows; this.rasterReference = infoFile.getGeoReference(); LOG.debug( "envelope: " + envelope ); LOG.debug( "raster reference: " + rasterReference ); SampleResolution sr = new SampleResolution( new double[] { rasterReference.getResolutionX(), rasterReference.getResolutionY() } ); this.resolutionInfo = new ResolutionInfo( sr ); }
/** * Instantiates this grid reader with the given information. * * @param infoFile */ protected synchronized void instantiate( GridMetaInfoFile infoFile ) { this.infoFile = infoFile; this.envelope = infoFile.getEnvelope( OriginLocation.OUTER ); this.rasterRect = new RasterRect( 0, 0, infoFile.columns() * infoFile.getTileRasterWidth(), infoFile.rows() * infoFile.getTileRasterHeight() ); this.rasterDataInfo = infoFile.getDataInfo(); // this.envelopeWidth = envelope.getMax().get0() - envelope.getMin().get0(); // this.envelopeHeight = envelope.getMax().get1() - envelope.getMin().get1(); // this.envelopeWidth = envelope.getSpan0(); // this.envelopeHeight = envelope.getSpan1(); // this.rows = infoFile.rows(); // this.columns = infoFile.columns(); // this.tileSamplesX = infoFile.getTileSamplesX(); // this.tileSamplesY = infoFile.getTileSamplesY(); // this.tileWidth = envelope.getSpan0() / infoFile.columns(); // this.tileHeight = envelope.getSpan1() / infoFile.rows(); this.tilesPerBlob = infoFile.columns() * infoFile.rows(); this.sampleSize = ( rasterDataInfo.getDataType().getSize() * rasterDataInfo.bands() ); this.bytesPerTile = infoFile.getTileRasterWidth() * infoFile.getTileRasterHeight() * sampleSize; }