|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.coverage.raster.io.grid.GridReader
public abstract class GridReader
The GridReader
class TODO add class documentation here.
Field Summary | |
---|---|
protected GridMetaInfoFile |
infoFile
Holds information on the grid. |
protected int |
sampleSize
The size of one sample |
Constructor Summary | |
---|---|
GridReader()
|
Method Summary | |
---|---|
protected ByteBuffer |
allocateTileBuffer(boolean direct,
boolean forCache)
Allocate a buffer which can hold a tile. |
boolean |
canReadTiles()
should return true if the given reader can easily read tiles,without consuming much more memory than needed. |
long |
getBytesPerTile()
|
Envelope |
getEnvelope()
|
RasterGeoReference |
getGeoReference()
|
int |
getHeight()
|
protected int[] |
getIntersectingTiles(RasterRect rect)
Returns the min column, row and max column row of the given rect. |
int |
getNumberOfTiles()
|
RasterDataInfo |
getRasterDataInfo()
|
AbstractRaster |
getTile(int columnId,
int rowId)
Read a raster from the grid file at location (row,column). |
int |
getTileColumns()
|
ByteBuffer |
getTileData(int column,
int row,
ByteBuffer buffer)
|
protected Envelope |
getTileEnvelope(int column,
int row)
Calculates the envelope for a tile at a given position in the grid. |
protected int |
getTileId(int columnId,
int rowId)
Calculates the id for a tile at a given position in the grid. |
int |
getTileRasterHeight()
|
int |
getTileRasterWidth()
|
int |
getTileRows()
|
int |
getTilesPerBlob()
|
int |
getWidth()
|
protected void |
instantiate(GridMetaInfoFile infoFile)
Instantiates this grid reader with the given information. |
AbstractRaster |
load(InputStream stream,
RasterIOOptions options)
Read the given input stream into an abstract raster. |
protected abstract void |
read(int columnId,
int rowId,
ByteBuffer buffer)
Reads the data from the grid. |
void |
setTilesPerBlob(int tilesPerBlob)
|
boolean |
shouldCreateCacheFile()
|
protected RasterRect |
snapToGrid(RasterRect original)
Get intersection of the requested rectangle with the rectangle of the grid file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.deegree.coverage.raster.io.RasterReader |
---|
canLoad, dispose, file, getDataLocationId, getSupportedFormats, load, read |
Field Detail |
---|
protected GridMetaInfoFile infoFile
protected int sampleSize
Constructor Detail |
---|
public GridReader()
Method Detail |
---|
protected void instantiate(GridMetaInfoFile infoFile)
infoFile
- protected RasterRect snapToGrid(RasterRect original)
original
-
protected int getTileId(int columnId, int rowId)
columnId
- column id, must be in the range [0 ... #columns - 1]rowId
- row id, must be in the range [0 ... #rows - 1]
protected Envelope getTileEnvelope(int column, int row)
column
- column id, must be in the range [0 ... #columns - 1]row
- row id, must be in the range [0 ... #rows - 1]
public AbstractRaster getTile(int columnId, int rowId) throws IOException
columnId
- rowId
-
IOException
protected abstract void read(int columnId, int rowId, ByteBuffer buffer) throws IOException
columnId
- rowId
- buffer
-
IOException
public AbstractRaster load(InputStream stream, RasterIOOptions options) throws IOException
RasterReader
load
in interface RasterReader
IOException
- may be thrown when there is a problem with reading the raster.public int getNumberOfTiles()
public long getBytesPerTile()
public RasterGeoReference getGeoReference()
getGeoReference
in interface RasterReader
public int getHeight()
getHeight
in interface RasterReader
public int getWidth()
getWidth
in interface RasterReader
public int getTileRasterWidth()
public int getTileRasterHeight()
public boolean canReadTiles()
RasterReader
canReadTiles
in interface RasterReader
protected int[] getIntersectingTiles(RasterRect rect)
null
will be returned.
rect
-
null
if the given rect does not intersect the
data.public boolean shouldCreateCacheFile()
shouldCreateCacheFile
in interface RasterReader
public ByteBuffer getTileData(int column, int row, ByteBuffer buffer) throws IOException
column
- row
- buffer
-
null
IOException
protected ByteBuffer allocateTileBuffer(boolean direct, boolean forCache)
direct
- if the buffer should be directforCache
- if the buffer is used for caching mechanisms.
public int getTileRows()
public int getTileColumns()
public int getTilesPerBlob()
public void setTilesPerBlob(int tilesPerBlob)
tilesPerBlob
- public RasterDataInfo getRasterDataInfo()
getRasterDataInfo
in interface RasterReader
public final Envelope getEnvelope()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |