Class DimapProductReader
- All Implemented Interfaces:
ProductReader
DimapProductReader class is an implementation of the ProductReader interface
exclusively for data products having the BEAM-DIMAP product format.- Version:
- $Revision$ $Date$
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.esa.snap.core.dataio.AbstractProductReader
input -
Constructor Summary
ConstructorsConstructorDescriptionDimapProductReader(ProductReaderPlugIn readerPlugIn) Construct a new instance of a product reader for the given BEAM-DIMAP product reader plug-in. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtender(DimapProductReader.ReaderExtender extender) voidbindProduct(Object input, Product existingProduct) voidclose()Closes the access to all currently opened resources such as file input streams and all resources of this children directly owned by this reader.booleanReturns if the reader fully supports the reading of subsets.protected ProductprocessProduct(Product existingProduct) protected voidreadBandRasterDataImpl(int sourceOffsetX, int sourceOffsetY, int sourceWidth, int sourceHeight, int sourceStepX, int sourceStepY, Band destBand, int destOffsetX, int destOffsetY, int destWidth, int destHeight, ProductData destBuffer, ProgressMonitor pm) The template method which is called by the } method after an optional spatial subset has been applied to the input parameters.protected ProductProvides an implementation of thereadProductNodesinterface method.voidreadTiePointGridRasterData(TiePointGrid tpg, int destOffsetX, int destOffsetY, int destWidth, int destHeight, ProductData destBuffer, ProgressMonitor pm) Methods inherited from class org.esa.snap.core.dataio.AbstractProductReader
buildTiePointGrid, buildTiePointGrid, configurePreferredTileSize, convertInputToPath, createTiePointGrid, getGridDiscontinutity, getInput, getProductComponents, getReaderPlugIn, getSubsetDef, isInstanceOfValidInputType, isMetadataIgnored, isNodeAccepted, readBandRasterData, readGeoCoding, readProductNodes, setInput, setSubsetDef, toString
-
Constructor Details
-
DimapProductReader
Construct a new instance of a product reader for the given BEAM-DIMAP product reader plug-in.- Parameters:
readerPlugIn- the given BEAM-DIMAP product writer plug-in, must not benull
-
-
Method Details
-
getProduct
-
getInputDir
-
getInputFile
-
readProductNodesImpl
Provides an implementation of thereadProductNodesinterface method. Clients implementing this method can be sure that the input object and eventually the subset information has already been set.This method is called as a last step in the
readProductNodes(input, subsetInfo)method.- Specified by:
readProductNodesImplin classAbstractProductReader- Returns:
- a new product instance
- Throws:
IOException- if an I/O error occursIllegalFileFormatException- if the input file in not decodeable
-
bindProduct
- Throws:
IOException
-
processProduct
- Throws:
IOException
-
readBandRasterDataImpl
protected void readBandRasterDataImpl(int sourceOffsetX, int sourceOffsetY, int sourceWidth, int sourceHeight, int sourceStepX, int sourceStepY, Band destBand, int destOffsetX, int destOffsetY, int destWidth, int destHeight, ProductData destBuffer, ProgressMonitor pm) throws IOException The template method which is called by the } method after an optional spatial subset has been applied to the input parameters.The destination band, buffer and region parameters are exactly the ones passed to the original call. Since the
destOffsetXanddestOffsetYparameters are already taken into acount in thesourceOffsetXandsourceOffsetYparameters, an implementor of this method is free to ignore them.- Specified by:
readBandRasterDataImplin classAbstractProductReader- Parameters:
sourceOffsetX- the absolute X-offset in source raster co-ordinatessourceOffsetY- the absolute Y-offset in source raster co-ordinatessourceWidth- the width of region providing samples to be read given in source raster co-ordinatessourceHeight- the height of region providing samples to be read given in source raster co-ordinatessourceStepX- the sub-sampling in X direction within the region providing samples to be readsourceStepY- the sub-sampling in Y direction within the region providing samples to be readdestBand- the destination band which identifies the data source from which to read the sample valuesdestOffsetX- the X-offset in the band's raster co-ordinatesdestOffsetY- the Y-offset in the band's raster co-ordinatesdestWidth- the width of region to be read given in the band's raster co-ordinatesdestHeight- the height of region to be read given in the band's raster co-ordinatesdestBuffer- the destination buffer which receives the sample values to be readpm- a monitor to inform the user about progress- Throws:
IOException- if an I/O error occurs- See Also:
-
readTiePointGridRasterData
public void readTiePointGridRasterData(TiePointGrid tpg, int destOffsetX, int destOffsetY, int destWidth, int destHeight, ProductData destBuffer, ProgressMonitor pm) throws IOException - Throws:
IOException
-
isSubsetReadingFullySupported
public boolean isSubsetReadingFullySupported()Description copied from class:AbstractProductReaderReturns if the reader fully supports the reading of subsets. Including sub-sampling in X- and Y-direction. This method is intended to be a hint to the SNAP framework. Depending on the return value the reading can be optimised.Implementations of this class should override this method in order to specify if subset reading is fully supported. The default implementation returns
false- Overrides:
isSubsetReadingFullySupportedin classAbstractProductReader- Returns:
falseortrue, depending if subset reading is fully supported or not.
-
close
Closes the access to all currently opened resources such as file input streams and all resources of this children directly owned by this reader. Its primary use is to allow the garbage collector to perform a vanilla job.This method should be called only if it is for sure that this object instance will never be used again. The results of referencing an instance of this class after a call to
close()are undefined.Overrides of this method should always call
super.close();after disposing this instance.- Specified by:
closein interfaceProductReader- Overrides:
closein classAbstractProductReader- Throws:
IOException- if an I/O error occurs
-
addExtender
-