Class DimapProductWriter

    • Constructor Detail

      • DimapProductWriter

        public DimapProductWriter​(ProductWriterPlugIn writerPlugIn)
        Construct a new instance of a product writer for the given BEAM-DIMAP product writer plug-in.
        Parameters:
        writerPlugIn - the given BEAM-DIMAP product writer plug-in, must not be null
    • Method Detail

      • setUseCache

        public void setUseCache​(boolean useCache)
      • getOutputDir

        public File getOutputDir()
        Returns the output directory of the product beeing written.
      • getBandOutputStreams

        public Map<Band,​ImageOutputStream> getBandOutputStreams()
        Returns all band output streams opened so far.
      • initDirs

        public void initDirs​(File outputFile)
                      throws IOException
        Initializes all the internal file and directory elements from the given output file. This method only must be called if the product writer should write the given data to raw data files without calling of writeProductNodes. This may be at the time when a dimap product was opened and the data should be continuously changed in the same product file without an previous call to the saveProductNodes to this product writer.
        Parameters:
        outputFile - the dimap header file location.
        Throws:
        IOException - if an I/O error occurs
      • writeBandRasterData

        public void writeBandRasterData​(Band sourceBand,
                                        int sourceOffsetX,
                                        int sourceOffsetY,
                                        int sourceWidth,
                                        int sourceHeight,
                                        ProductData sourceBuffer,
                                        ProgressMonitor pm)
                                 throws IOException
        Writes raster data from the given in-memory source buffer into the data sink specified by the given source band and region.

        Source band

        The source band is used to identify the data sink in which this method transfers the sample values given in the source buffer. The method does not modify the pixel data of the given source band at all.

        Source buffer

        The first element of the source buffer corresponds to the given 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.
        The number of elements in the buffer must be exactly be 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.

        Source region

        The given destination region specified by the 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.
        Parameters:
        sourceBand - the source band which identifies the data sink to which to write the sample values
        sourceOffsetX - the X-offset in the band's raster co-ordinates
        sourceOffsetY - the Y-offset in the band's raster co-ordinates
        sourceWidth - the width of region to be written given in the band's raster co-ordinates
        sourceHeight - the height of region to be written given in the band's raster co-ordinates
        sourceBuffer - the source buffer which provides the sample values to be written
        pm - a monitor to inform the user about progress
        Throws:
        IOException - if an I/O error occurs
        See Also:
        AbstractBand.getRasterWidth(), AbstractBand.getRasterHeight()
      • deleteOutput

        public void deleteOutput()
                          throws IOException
        Deletes the physically representation of the product from the hard disk.
        Throws:
        IOException - if an I/O error occurs
      • flush

        public void flush()
                   throws IOException
        Writes all data in memory to disk. After a flush operation, the writer can be closed safely
        Throws:
        IOException - on failure
      • close

        public void close()
                   throws IOException
        Closes all output streams currently open.
        Throws:
        IOException - on failure
      • setIncrementalMode

        public void setIncrementalMode​(boolean enabled)
        Enables resp. disables incremental writing of this product writer. By default, a reader should enable progress listening.
        Specified by:
        setIncrementalMode in interface ProductWriter
        Overrides:
        setIncrementalMode in class AbstractProductWriter
        Parameters:
        enabled - enables or disables progress listening.