/** * Instantiate an AbstractRaster with given envelope and raster envelope. * * @param envelope * The envelope of the raster. * @param rasterReference * The raster reference of the underlying raster. */ protected AbstractRaster( Envelope envelope, RasterGeoReference rasterReference ) { super( envelope ); this.rasterReference = rasterReference; SampleResolution res = new SampleResolution( new double[] { rasterReference.getResolutionX(), rasterReference.getResolutionY() } ); this.resolutionInfo = new ResolutionInfo( res ); }
/** * 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 ); }