org.geotools.gce.grassraster.core
Class CompressesRasterWriter

Object
  extended by CompressesRasterWriter

public class CompressesRasterWriter
extends Object

Write compressed JGrass rasters to disk

Since:
1.1.0
Author:
Andrea Antonello (www.hydrologis.com)

Constructor Summary
CompressesRasterWriter(int _outputToDiskType, double _novalue, boolean _jump, double[] _range, long _pointerInFilePosition, long[] _rowaddresses, JGrassRegion _dataWindow, ProgressListener monitor, String mapName)
          Preparing the environment for compressing and writing the map to disk
 
Method Summary
 void compressAndWrite(ImageOutputStream theCreatedFile, ImageOutputStream theCreatedNullFile, RenderedImage renderedImage)
          Compress and write data from a map iterator.
 JGrassRegion getDataWindow()
           
 double getNovalue()
           
 int getOutputToDiskType()
           
 long getPointerInFilePosition()
           
 double[] getRange()
           
 long[] getRowaddresses()
           
 boolean isJump()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompressesRasterWriter

public CompressesRasterWriter(int _outputToDiskType,
                              double _novalue,
                              boolean _jump,
                              double[] _range,
                              long _pointerInFilePosition,
                              long[] _rowaddresses,
                              JGrassRegion _dataWindow,
                              ProgressListener monitor,
                              String mapName)
Preparing the environment for compressing and writing the map to disk

Parameters:
_outputToDiskType -
_novalue -
_jump -
_range -
_pointerInFilePosition -
_rowaddresses -
_dataWindow -
monitor -
Method Detail

compressAndWrite

public void compressAndWrite(ImageOutputStream theCreatedFile,
                             ImageOutputStream theCreatedNullFile,
                             RenderedImage renderedImage)
                      throws IOException
Compress and write data from a map iterator.

This method converts every single row of the buffer of values to bytes, as needed by the deflater. Then the byterows are compressed and then written to file. Every rows first byte carries the information about compression (0 = not compressed, 1 = compressed). At the begin the place for the header is written to file, in the end the header is re-written with the right rowaddresses (at the begin we do not know how much compression will influence).

Parameters:
theCreatedFile - - handler for the main map file
theCreatedNullFile - - handler for the file of the null map (in cell_misc)
renderedImage -
Throws:
IOException

getDataWindow

public JGrassRegion getDataWindow()

isJump

public boolean isJump()

getNovalue

public double getNovalue()

getOutputToDiskType

public int getOutputToDiskType()

getPointerInFilePosition

public long getPointerInFilePosition()

getRange

public double[] getRange()

getRowaddresses

public long[] getRowaddresses()


Copyright © 1996-2014 Geotools. All Rights Reserved.