public class DimapProductWriter extends AbstractProductWriter
The BEAM-DIMAP version history is provided in the API doc of the DimapProductWriterPlugIn
.
DimapProductWriterPlugIn
,
DimapProductReaderPlugIn
Modifier and Type | Class and Description |
---|---|
static class |
DimapProductWriter.WriterExtender |
Constructor and Description |
---|
DimapProductWriter(ProductWriterPlugIn writerPlugIn)
Construct a new instance of a product writer for the given BEAM-DIMAP product writer plug-in.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtender(DimapProductWriter.WriterExtender writerExtender) |
void |
close()
Closes all output streams currently open.
|
void |
deleteOutput()
Deletes the physically representation of the product from the hard disk.
|
void |
flush()
Writes all data in memory to disk.
|
Map<Band,ImageOutputStream> |
getBandOutputStreams()
Returns all band output streams opened so far.
|
File |
getOutputDir()
Returns the output directory of the product beeing written.
|
void |
initDirs(File outputFile)
Initializes all the internal file and directory elements from the given output file.
|
boolean |
isIncrementalMode()
Returns whether this product writer writes only modified product nodes.
|
void |
removeBand(Band band)
Overwrite this method to physicaly delete a
Band from the writer's output file. |
void |
setIncrementalMode(boolean enabled)
Enables resp. disables incremental writing of this product writer.
|
boolean |
shouldWrite(ProductNode node)
Returns wether the given product node is to be written.
|
void |
writeBandRasterData(Band sourceBand,
int sourceOffsetX,
int sourceOffsetY,
int sourceWidth,
int sourceHeight,
ProductData sourceBuffer,
ProgressMonitor pm)
Writes raster data from the given in-memory source buffer into the data sink specified by the given source band
and region.
|
protected void |
writeProductNodesImpl()
Writes the in-memory representation of a data product.
|
checkOutput, getOutput, getSourceProduct, getWriterPlugIn, isInstanceOfValidOutputType, setFormatName, writeProductNodes
public DimapProductWriter(ProductWriterPlugIn writerPlugIn)
writerPlugIn
- the given BEAM-DIMAP product writer plug-in, must not be null
public File getOutputDir()
public Map<Band,ImageOutputStream> getBandOutputStreams()
protected void writeProductNodesImpl() throws IOException
writeProductNodes(product,
output)
of the AbstractProductWriter.writeProductNodesImpl
in class AbstractProductWriter
IllegalArgumentException
- if output
type is not one of the supported output sources.IOException
- if an I/O error occurspublic void initDirs(File outputFile) throws IOException
outputFile
- the dimap header file location.IOException
- if an I/O error occurspublic void writeBandRasterData(Band sourceBand, int sourceOffsetX, int sourceOffsetY, int sourceWidth, int sourceHeight, ProductData sourceBuffer, ProgressMonitor pm) throws IOException
sourceOffsetX
and sourceOffsetY
of the source region. These parameters are an offset within the band's raster data
and not an offset within the source buffer.sourceWidth * sourceHeight
. The pixel values to be writte are considered to be stored in
line-by-line order, so the raster X co-ordinate varies faster than the Y.
sourceOffsetX
,
sourceOffsetY
, sourceWidth
and sourceHeight
parameters is given in the
source band's raster co-ordinates. These co-ordinates are identical with the destination raster co-ordinates
since product writers do not support spectral or spatial subsets.sourceBand
- the source band which identifies the data sink to which to write the sample valuessourceOffsetX
- the X-offset in the band's raster co-ordinatessourceOffsetY
- the Y-offset in the band's raster co-ordinatessourceWidth
- the width of region to be written given in the band's raster co-ordinatessourceHeight
- the height of region to be written given in the band's raster co-ordinatessourceBuffer
- the source buffer which provides the sample values to be writtenpm
- a monitor to inform the user about progressIOException
- if an I/O error occursAbstractBand.getRasterWidth()
,
AbstractBand.getRasterHeight()
public void deleteOutput() throws IOException
IOException
- if an I/O error occurspublic void flush() throws IOException
IOException
- on failurepublic void close() throws IOException
IOException
- on failurepublic boolean shouldWrite(ProductNode node)
AbstractProductWriter
shouldWrite
in interface ProductWriter
shouldWrite
in class AbstractProductWriter
node
- the product nodetrue
if sopublic void setIncrementalMode(boolean enabled)
setIncrementalMode
in interface ProductWriter
setIncrementalMode
in class AbstractProductWriter
enabled
- enables or disables progress listening.public boolean isIncrementalMode()
isIncrementalMode
in interface ProductWriter
isIncrementalMode
in class AbstractProductWriter
true
if sopublic void removeBand(Band band)
AbstractProductWriter
Band
from the writer's output file.removeBand
in interface ProductWriter
removeBand
in class AbstractProductWriter
band
- The band to delete.public void addExtender(DimapProductWriter.WriterExtender writerExtender)
Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.