it.geosolutions.imageio.plugins.netcdf
Class BaseNetCDFImageReader

Object
  extended by ImageReader
      extended by BaseImageReader
          extended by BaseNetCDFImageReader

public final class BaseNetCDFImageReader
extends BaseImageReader

Base implementation for NetCDF based image flat reader. Each ImageIndex corresponds to a 2D-slice of NetCDF. BaseNetCDFImageReader is a ImageReader able to create RenderedImage from NetCDF-CF sources.

Author:
Alessio Fabiani, GeoSolutions, Simone Giannecchini, GeoSolutions

Field Summary
protected static Logger LOGGER
           
 
Fields inherited from class ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
 
Constructor Summary
BaseNetCDFImageReader(ImageReaderSpi originatingProvider)
          Explicit Constructor getting ImageReaderSpi originatingProvider as actual parameter.
 
Method Summary
 void dispose()
          Allows any resources held by this reader to be released.
 NetCDFUtilities.KeyValuePair getAttribute(int imageIndex, int attributeIndex)
           
 String getAttributeAsString(int imageIndex, String attributeName)
           
 String getAttributeAsString(int imageIndex, String attributeName, boolean isUnsigned)
           
 NetcdfDataset getDataset()
           
 NetCDFUtilities.KeyValuePair getGlobalAttribute(int attributeIndex)
           
 int getHeight(int imageIndex)
           
 IIOMetadata getImageMetadata(int imageIndex)
           
 Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
           
 Map<Range,?> getIndexMap()
           
 int getNumAttributes(int imageIndex)
           
 int getNumGlobalAttributes()
           
 IIOMetadata getStreamMetadata()
           
 String getVariableName(int imageIndex)
           
 BaseVariableWrapper getVariableWrapper(int imageIndex)
           
 int getWidth(int imageIndex)
           
protected  void initialize()
           
 BufferedImage read(int imageIndex, ImageReadParam param)
           
 void reset()
          Reset the status of this reader
 void setIndexMap(Map<Range,? extends BaseVariableWrapper> indexMap)
           
 void setInput(Object input)
          Sets the input source to use within this reader.
 void setInput(Object input, boolean seekForwardOnly)
          Sets the input source to use within this reader.
 void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)
          Sets the input source to use within this reader.
 void setNumGlobalAttributes(int numGlobalAttributes)
           
 
Methods inherited from class BaseImageReader
checkImageIndex, getNumImages, setNumImages
 
Methods inherited from class ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setLocale
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER
Constructor Detail

BaseNetCDFImageReader

public BaseNetCDFImageReader(ImageReaderSpi originatingProvider)
Explicit Constructor getting ImageReaderSpi originatingProvider as actual parameter.

Parameters:
originatingProvider - ImageReaderSpi
Method Detail

getIndexMap

public Map<Range,?> getIndexMap()

setIndexMap

public void setIndexMap(Map<Range,? extends BaseVariableWrapper> indexMap)

getDataset

public NetcdfDataset getDataset()

setNumGlobalAttributes

public void setNumGlobalAttributes(int numGlobalAttributes)

setInput

public void setInput(Object input,
                     boolean seekForwardOnly,
                     boolean ignoreMetadata)
Sets the input source to use within this reader. URIs, Files, Strings, URLs, ImageInputStreams are accepted input types.
Other parameters (seekForwardOnly and ignoreMetadata) are actually ignored.

Overrides:
setInput in class ImageReader
Parameters:
input - the Object to be set as input of this reader.
Throws:
exception - IllegalArgumentException in case the provided input Object cannot be properly parsed and used as input for the reader.

initialize

protected void initialize()

setInput

public void setInput(Object input,
                     boolean seekForwardOnly)
Sets the input source to use within this reader. URIs, Files (also representing a Directory), Strings (also representing the path of a Directory), URLs, ImageInputStreams are accepted input types.
The parameter (seekForwardOnly is actually ignored.

Overrides:
setInput in class ImageReader
Parameters:
input - the Object to be set as input of this reader.
Throws:
{@link - IllegalArgumentException} in case the provided input Object cannot be properly parsed and used as input for the reader.

setInput

public void setInput(Object input)
Sets the input source to use within this reader. URIs, Files (also representing a Directory), Strings (also representing the path of a Directory), URLs, ImageInputStreams are accepted input types.

Overrides:
setInput in class ImageReader
Parameters:
input - the Object to be set as input of this reader.
Throws:
{@link - IllegalArgumentException} in case the provided input Object cannot be properly parsed and used as input for the reader.

getHeight

public int getHeight(int imageIndex)
              throws IOException
Specified by:
getHeight in class ImageReader
Throws:
IOException
See Also:
ImageReader.getHeight(int)

getVariableWrapper

public BaseVariableWrapper getVariableWrapper(int imageIndex)

getImageTypes

public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
                                           throws IOException
Specified by:
getImageTypes in class ImageReader
Throws:
IOException

getWidth

public int getWidth(int imageIndex)
             throws IOException
Specified by:
getWidth in class ImageReader
Throws:
IOException

dispose

public void dispose()
Allows any resources held by this reader to be released.
TODO: To grant thread safety, we may prevent a user call of this method.

Overrides:
dispose in class BaseImageReader
Throws:
IOException

reset

public void reset()
Reset the status of this reader

Overrides:
reset in class ImageReader

getAttributeAsString

public String getAttributeAsString(int imageIndex,
                                   String attributeName)

getAttributeAsString

public String getAttributeAsString(int imageIndex,
                                   String attributeName,
                                   boolean isUnsigned)

getAttribute

public NetCDFUtilities.KeyValuePair getAttribute(int imageIndex,
                                                 int attributeIndex)
                                          throws IOException
Throws:
IOException

getVariableName

public String getVariableName(int imageIndex)

getNumGlobalAttributes

public int getNumGlobalAttributes()

getNumAttributes

public int getNumAttributes(int imageIndex)

getGlobalAttribute

public NetCDFUtilities.KeyValuePair getGlobalAttribute(int attributeIndex)
                                                throws IOException
Throws:
IOException

getImageMetadata

public IIOMetadata getImageMetadata(int imageIndex)
                             throws IOException
Specified by:
getImageMetadata in class ImageReader
Throws:
IOException

getStreamMetadata

public IIOMetadata getStreamMetadata()
                              throws IOException
Specified by:
getStreamMetadata in class ImageReader
Throws:
IOException

read

public BufferedImage read(int imageIndex,
                          ImageReadParam param)
Specified by:
read in class ImageReader


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.