/** * Read a raster from the grid file at location (row,column). * * @param columnId * * @param rowId * * @return the read raster or null if it could not be read. * @throws IOException */ public AbstractRaster getTile( int columnId, int rowId ) throws IOException { Envelope tileEnvelope = getTileEnvelope( columnId, rowId ); RasterGeoReference tileRasterReference = RasterGeoReference.create( OriginLocation.OUTER, tileEnvelope, infoFile.getTileRasterWidth(), infoFile.getTileRasterHeight() ); RasterRect tileRect = getGeoReference().createRelocatedReference( OriginLocation.OUTER ).convertEnvelopeToRasterCRS( tileEnvelope ); TileOffsetReader tReader = new TileOffsetReader( this, tileRect ); ByteBufferRasterData tileData = RasterDataFactory.createRasterData( infoFile.getTileRasterWidth(), infoFile.getTileRasterHeight(), getRasterDataInfo(), tReader, false ); SimpleRaster tile = new SimpleRaster( tileData, tileEnvelope, tileRasterReference, null ); return tile; }