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, numImages
Fields inherited from class ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a file to the file set managervoid
dispose()
protected void
finalize()
protected static void
flipVertically
(ImageReadParam param, int srcHeight, Rectangle srcRegion) protected VariableAdapter
getCoverageDescriptor
(int imageIndex) Return theVariableWrapper
related to that imageIndexgetCoverageDescriptor
(Name name) Return the name of coverages made available by this providerint
The number of coverages made available by this provider.int
getHeight
(int imageIndex) getImageMetadata
(int imageIndex) getImageTypes
(int imageIndex) getIndexSchema
(Name coverageName, CoordinateSystem cs) getIndexSchema
(Name coverageName, CoordinateSystem coordinateSystem, boolean isShared) getSlice2DIndex
(int imageIndex) Return theSlice2DIndex
associated to the specified imageIndexVariable
getVariableByName
(String varName) Get aVariable
by name.int
getWidth
(int imageIndex) protected int
Index Initialization. store indexing information.list()
Return the list of all the files currently added to the managerprotected IIOException
Wraps a generic exception into aIIOException
.void
purge()
Remove all the files from the manager (An implementation may also physically remove all the files)read
(int imageIndex, ImageReadParam param) void
removeFile
(String filePath) Remove a file from the manager (An implementation may also physically remove the file)void
reset()
Reset the status of this readervoid
protected void
setNumImages
(int numImages) void
setRasterLayerRequest
(RasterLayerRequest request) Methods inherited from class GeoSpatialImageReader
checkImageIndex, getAuxiliaryDatastorePath, getAuxiliaryFilesPath, getCatalog, getImageIndex, getNumImages, getStreamMetadata, init, initCatalog, setAuxiliaryDatastorePath, setAuxiliaryFilesPath, setCatalog, setRepository
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, setInput, setInput, setLocale
-
Constructor Details
-
NetCDFImageReader
-
-
Method Details
-
setRasterLayerRequest
-
getImageMosaicRequest
-
getCoveragesNames
Description copied from class:GeoSpatialImageReader
Return the name of coverages made available by this provider- Specified by:
getCoveragesNames
in classGeoSpatialImageReader
-
getCoveragesNumber
public int getCoveragesNumber()Description copied from class:GeoSpatialImageReader
The number of coverages made available by this provider.- Specified by:
getCoveragesNumber
in classGeoSpatialImageReader
-
setNumImages
protected void setNumImages(int numImages) -
getHeight
- Specified by:
getHeight
in classImageReader
- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypes
in classImageReader
- Throws:
IOException
-
getWidth
- Specified by:
getWidth
in classImageReader
- Throws:
IOException
-
getVariableByName
Get aVariable
by name.- Parameters:
varName
- the name of theVariable
to pick.- Returns:
- the variable or
null
.
-
reset
public void reset()Reset the status of this reader- Overrides:
reset
in classImageReader
-
setInput
- Overrides:
setInput
in classImageReader
-
initIndex
Index Initialization. store indexing information.- Throws:
InvalidRangeException
IOException
-
dispose
public void dispose()- Overrides:
dispose
in classGeoSpatialImageReader
-
finalize
- Overrides:
finalize
in classGeoSpatialImageReader
- Throws:
Throwable
-
netcdfFailure
Wraps a generic exception into aIIOException
.- Throws:
IOException
-
getSlice2DIndex
Return theSlice2DIndex
associated to the specified imageIndex- Throws:
IOException
-
getCoverageDescriptor
Return theVariableWrapper
related to that imageIndex -
getCoverageDescriptor
- Specified by:
getCoverageDescriptor
in classGeoSpatialImageReader
-
read
- Specified by:
read
in 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:FileSetManager
Add a file to the file set manager- Specified by:
addFile
in interfaceFileSetManager
-
list
Description copied from interface:FileSetManager
Return the list of all the files currently added to the manager- Specified by:
list
in interfaceFileSetManager
-
removeFile
Description copied from interface:FileSetManager
Remove a file from the manager (An implementation may also physically remove the file)- Specified by:
removeFile
in interfaceFileSetManager
-
purge
public void purge()Description copied from interface:FileSetManager
Remove all the files from the manager (An implementation may also physically remove all the files)- Specified by:
purge
in interfaceFileSetManager
-
getImageMetadata
- Overrides:
getImageMetadata
in classGeoSpatialImageReader
- Throws:
IOException
-