public interface TiledRasterReader
Sample usage:
RasterReaderFactory readerFactory = ....
RasterDatasetInfo raserInfo = ...
ArcSDERasterReader reader = readerFactory.create(rasterInfo);
try{
Long nextRasterId;
while((nextRasterId = reader.nextRaster()) != null){
if(amIInterestedInThisRaster(nextRasterId)){
int pyramidLevel = ...
Rectangle tileRange = ...
RenderedImage raster = reader.read(pyramidLevel, tileRange);
}
}
}finally{
reader.dispose();
}
So one has to call nextRaster()
to get the id of the raster immediately available to
be read through #read()
. This is so because there might be more than one raster on a
raster dataset and the order they are fetched from the ArcSDE server is non deterministic, and
once you opened a stream to a raster you can't open another one and then read the former.
Modifier and Type | Method and Description |
---|---|
RenderedImage |
read(long rasterId,
int pyramidLevel,
GridEnvelope matchingTiles)
Reads the image subset determined by the given pyramid level and tile range for the currently
available raster attribute in the requested raster column for the given raster dataset.
|
RenderedImage read(long rasterId, int pyramidLevel, GridEnvelope matchingTiles) throws IOException
pyramidLevel
- the pyramid level to readmatchingTiles
- the range of tiles to read at the given pyramid level. The boundaries of
the tile range are inclusive and starts at 0,0
for the upper left most tile.IOException
- for any exception occurred while reading the imageCopyright © 1996–2019 Geotools. All rights reserved.