org.deegree.coverage.raster.io.grid
Class SplittedBlobReader

java.lang.Object
  extended by org.deegree.coverage.raster.io.grid.GridReader
      extended by org.deegree.coverage.raster.io.grid.GridFileReader
          extended by org.deegree.coverage.raster.io.grid.SplittedBlobReader
All Implemented Interfaces:
RasterReader

public class SplittedBlobReader
extends GridFileReader

The SplittedBlobReader is a rasterreader for a grid file which is spread over multiple blobs. The blobs are organised as follows: Each blob will hold the so much rows until a given file size is reached, the next blob will hold the next tile in the same row and will then add rows etc. In other words the grid looks like this:

rows: 5 cols: 5 filesize: 7*tilesize.

the last file might be partially empty. Each tile will be saved flat row first (rb, please check this): pixel(0,0)(0,1)(0,2)(0,3)(0,4)(0,5)(0,6)(0,7)(1,0)(1,1)(1,2)(1,3)(1,4)(1,5)(1,6)(1,7)

Version:
$Revision: 31644 $, $Date: 2011-08-24 22:27:43 +0200 (Wed, 24 Aug 2011) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class org.deegree.coverage.raster.io.grid.GridReader
infoFile, sampleSize
 
Constructor Summary
SplittedBlobReader(File blobDir, String blobFilename, String blobFileext, GridMetaInfoFile infoFile)
          Creates a blob reader for a grid file which is spread over multiple blobs.
 
Method Summary
 boolean canLoad(File filename)
          Check if the raster reader is able to read the given raster file.
protected  void read(int columnId, int rowId, ByteBuffer buffer)
          Reads the data from the grid.
 BufferResult read(RasterRect rect, ByteBuffer resultBuffer)
           
 
Methods inherited from class org.deegree.coverage.raster.io.grid.GridFileReader
dispose, file, getDataLocationId, getSupportedFormats, instantiate, leaveStreamOpen, load, readValuesFromTile
 
Methods inherited from class org.deegree.coverage.raster.io.grid.GridReader
allocateTileBuffer, canReadTiles, getBytesPerTile, getEnvelope, getGeoReference, getHeight, getIntersectingTiles, getNumberOfTiles, getRasterDataInfo, getTile, getTileColumns, getTileData, getTileEnvelope, getTileId, getTileRasterHeight, getTileRasterWidth, getTileRows, getTilesPerBlob, getWidth, instantiate, load, setTilesPerBlob, shouldCreateCacheFile, snapToGrid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplittedBlobReader

public SplittedBlobReader(File blobDir,
                          String blobFilename,
                          String blobFileext,
                          GridMetaInfoFile infoFile)
Creates a blob reader for a grid file which is spread over multiple blobs.

Parameters:
blobDir -
blobFilename -
blobFileext -
infoFile -
Method Detail

read

protected void read(int columnId,
                    int rowId,
                    ByteBuffer buffer)
             throws IOException
Description copied from class: GridReader
Reads the data from the grid.

Overrides:
read in class GridFileReader
Throws:
IOException

canLoad

public boolean canLoad(File filename)
Description copied from interface: RasterReader
Check if the raster reader is able to read the given raster file.

Specified by:
canLoad in interface RasterReader
Overrides:
canLoad in class GridFileReader
Returns:
true if the class can read the raster

read

public BufferResult read(RasterRect rect,
                         ByteBuffer resultBuffer)
                  throws IOException
Specified by:
read in interface RasterReader
Overrides:
read in class GridFileReader
Parameters:
rect - to read.
resultBuffer - to store the result in
Returns:
the read buffer and its domain
Throws:
IOException


Copyright © 2011. All Rights Reserved.