org.geotools.arcsde.raster.io
Interface TiledRasterReader


public interface TiledRasterReader

An Iterator like interface to read ArcSDE rasters for a given ArcSDE raster dataset (whether it is a single raster or a raster catalog).

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.

Since:
2.5.7
Version:
$Id: TiledRasterReader.java 34355 2009-11-09 19:05:33Z groldan $
Author:
Gabriel Roldan

Method Summary
 java.awt.image.RenderedImage read(long rasterId, int pyramidLevel, java.awt.Rectangle tileRange)
          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.
 

Method Detail

read

java.awt.image.RenderedImage read(long rasterId,
                                  int pyramidLevel,
                                  java.awt.Rectangle tileRange)
                                  throws java.io.IOException
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.

Parameters:
pyramidLevel - the pyramid level to read
tileRange - 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.
Returns:
the rendered image determined by the requested pyramid level and tile range
Throws:
java.io.IOException - for any exception occurred while reading the image


Copyright © 1996-2010 Geotools. All Rights Reserved.