Package org.esa.snap.core.dataio
Class ProductSubsetBuilder
java.lang.Object
org.esa.snap.core.dataio.AbstractProductReader
org.esa.snap.core.dataio.AbstractProductBuilder
org.esa.snap.core.dataio.ProductSubsetBuilder
- All Implemented Interfaces:
ProductReader
A special-purpose product reader used to build subsets of data products.
- Version:
- $Revision$ $Date$
-
Field Summary
Fields inherited from class org.esa.snap.core.dataio.AbstractProductBuilder
bandMap, newProductDesc, newProductName, sceneRasterHeight, sceneRasterWidth, sourceProduct, sourceProductOwnerFields inherited from class org.esa.snap.core.dataio.AbstractProductReader
input -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBandsToProduct(Product product) protected voidaddGeoCodingToProduct(Product product) protected voidaddTiePointGridsToProduct(Product product) static ProductcreateProductSubset(Product sourceProduct, boolean sourceProductOwner, ProductSubsetDef subsetDef, String name, String desc) static ProductcreateProductSubset(Product sourceProduct, ProductSubsetDef subsetDef, String name, String desc) 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 thereadBandRasterDataSubSamplingmethod after an optional spatial subset has been applied to the input parameters.protected ProductReads a data product and returns a in-memory representation of it.Methods inherited from class org.esa.snap.core.dataio.AbstractProductBuilder
addAttribString, addFlagCodingsToProduct, addIndexCodingsToProduct, addMetadataToProduct, cloneFlags, cloneIndexes, cloneMetadataAttributes, cloneMetadataElements, cloneMetadataElementsAndAttributes, close, disposeBandMap, getSceneRasterHeight, getSceneRasterWidth, getSourceProduct, isInstanceOfValidInputType, isSourceProductOwner, readProductNodes, setNewProductDesc, setNewProductNameMethods inherited from class org.esa.snap.core.dataio.AbstractProductReader
buildTiePointGrid, buildTiePointGrid, configurePreferredTileSize, convertInputToPath, createTiePointGrid, getGridDiscontinutity, getInput, getProductComponents, getReaderPlugIn, getSubsetDef, isMetadataIgnored, isNodeAccepted, isSubsetReadingFullySupported, readBandRasterData, readGeoCoding, readProductNodes, setInput, setSubsetDef, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.esa.snap.core.dataio.ProductReader
readTiePointGridRasterData
-
Constructor Details
-
ProductSubsetBuilder
public ProductSubsetBuilder() -
ProductSubsetBuilder
public ProductSubsetBuilder(boolean sourceProductOwner)
-
-
Method Details
-
createProductSubset
public static Product createProductSubset(Product sourceProduct, ProductSubsetDef subsetDef, String name, String desc) throws IOException - Throws:
IOException
-
createProductSubset
public static Product createProductSubset(Product sourceProduct, boolean sourceProductOwner, ProductSubsetDef subsetDef, String name, String desc) throws IOException - Throws:
IOException
-
readProductNodesImpl
Reads a data product and returns a in-memory representation of it. This method was called byreadProductNodes(input, subsetInfo)of the abstract superclass.- Specified by:
readProductNodesImplin classAbstractProductBuilder- Returns:
- a new product instance
- Throws:
IllegalArgumentException- ifinputtype is not one of the supported input sources.IOException- if an I/O error occurs
-
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 thereadBandRasterDataSubSamplingmethod 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
readBandRasterDataSubSamplingcall. Since thedestOffsetXanddestOffsetYparameters 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:
-
addBandsToProduct
-
addTiePointGridsToProduct
-
addGeoCodingToProduct
-