Package org.geotools.imageio.netcdf
Class NetCDFImageReader
Object
ImageReader
GeoSpatialImageReader
NetCDFImageReader
- All Implemented Interfaces:
InitializingReader,FileSetManager
Base implementation for NetCDF-CF image flat reader. Pixels are assumed organized according the COARDS convention (a
precursor of CF Metadata conventions), i.e. in
(t,z,y,x) order, where x varies faster. The image is created
from the two last dimensions (x,y).
Each ImageIndex corresponds to a 2D-slice of NetCDF.
NetCDFImageReader is a ImageReader able to create RenderedImage from NetCDF-CF sources.
- Author:
- Alessio Fabiani, GeoSolutions, Simone Giannecchini, GeoSolutions
-
Field Summary
Fields inherited from class GeoSpatialImageReader
file, numImagesFields inherited from class ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a file to the file set managervoiddispose()protected voidfinalize()protected static voidflipVertically(ImageReadParam param, int srcHeight, Rectangle srcRegion) protected VariableAdaptergetCoverageDescriptor(int imageIndex) Return theVariableWrapperrelated to that imageIndexgetCoverageDescriptor(Name name) Return the name of coverages made available by this providerintThe number of coverages made available by this provider.intgetHeight(int imageIndex) getImageMetadata(int imageIndex) getImageTypes(int imageIndex) getIndexSchema(Name coverageName, CoordinateSystem cs) getIndexSchema(Name coverageName, CoordinateSystem coordinateSystem, boolean isShared) getSlice2DIndex(int imageIndex) Return theSlice2DIndexassociated to the specified imageIndexVariablegetVariableByName(String varName) Get aVariableby name.intgetWidth(int imageIndex) protected intIndex Initialization. store indexing information.list()Return the list of all the files currently added to the managerprotected IIOExceptionWraps a generic exception into aIIOException.voidpurge()Remove all the files from the manager (An implementation may also physically remove all the files)read(int imageIndex, ImageReadParam param) voidremoveFile(String filePath) Remove a file from the manager (An implementation may also physically remove the file)voidreset()Reset the status of this readervoidprotected voidsetNumImages(int numImages) voidsetRasterLayerRequest(RasterLayerRequest request) Methods inherited from class GeoSpatialImageReader
checkImageIndex, getAuxiliaryDatastorePath, getAuxiliaryFilesPath, getCatalog, getImageIndex, getNumImages, getStreamMetadata, init, initCatalog, setAuxiliaryDatastorePath, setAuxiliaryFilesPath, setCatalog, setRepositoryMethods 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, setInput, setInput, setLocale
-
Constructor Details
-
NetCDFImageReader
-
-
Method Details
-
setRasterLayerRequest
-
getImageMosaicRequest
-
getCoveragesNames
Description copied from class:GeoSpatialImageReaderReturn the name of coverages made available by this provider- Specified by:
getCoveragesNamesin classGeoSpatialImageReader
-
getCoveragesNumber
public int getCoveragesNumber()Description copied from class:GeoSpatialImageReaderThe number of coverages made available by this provider.- Specified by:
getCoveragesNumberin classGeoSpatialImageReader
-
setNumImages
protected void setNumImages(int numImages) -
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getVariableByName
Get aVariableby name.- Parameters:
varName- the name of theVariableto pick.- Returns:
- the variable or
null.
-
reset
public void reset()Reset the status of this reader- Overrides:
resetin classImageReader
-
setInput
- Overrides:
setInputin classImageReader
-
initIndex
Index Initialization. store indexing information.- Throws:
InvalidRangeExceptionIOException
-
dispose
public void dispose()- Overrides:
disposein classGeoSpatialImageReader
-
finalize
- Overrides:
finalizein classGeoSpatialImageReader- Throws:
Throwable
-
netcdfFailure
Wraps a generic exception into aIIOException.- Throws:
IOException
-
getSlice2DIndex
Return theSlice2DIndexassociated to the specified imageIndex- Throws:
IOException
-
getCoverageDescriptor
Return theVariableWrapperrelated to that imageIndex -
getCoverageDescriptor
- Specified by:
getCoverageDescriptorin classGeoSpatialImageReader
-
read
- Specified by:
readin classImageReader- Throws:
IOException- See Also:
-
flipVertically
-
getIndexSchema
- Throws:
Exception
-
getIndexSchema
public SimpleFeatureType getIndexSchema(Name coverageName, CoordinateSystem coordinateSystem, boolean isShared) throws Exception - Throws:
Exception
-
addFile
Description copied from interface:FileSetManagerAdd a file to the file set manager- Specified by:
addFilein interfaceFileSetManager
-
list
Description copied from interface:FileSetManagerReturn the list of all the files currently added to the manager- Specified by:
listin interfaceFileSetManager
-
removeFile
Description copied from interface:FileSetManagerRemove a file from the manager (An implementation may also physically remove the file)- Specified by:
removeFilein interfaceFileSetManager
-
purge
public void purge()Description copied from interface:FileSetManagerRemove all the files from the manager (An implementation may also physically remove all the files)- Specified by:
purgein interfaceFileSetManager
-
getImageMetadata
- Overrides:
getImageMetadatain classGeoSpatialImageReader- Throws:
IOException
-