Class CompressesRasterWriter
- Object
-
- CompressesRasterWriter
-
public class CompressesRasterWriter extends Object
Write compressed JGrass rasters to disk- Since:
- 1.1.0
- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compressAndWrite(ImageOutputStream theCreatedFile, ImageOutputStream theCreatedNullFile, RenderedImage renderedImage)
Compress and write data from amap iterator
.JGrassRegion
getDataWindow()
double
getNovalue()
int
getOutputToDiskType()
long
getPointerInFilePosition()
double[]
getRange()
long[]
getRowaddresses()
boolean
isJump()
-
-
-
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
-
-
Method Detail
-
compressAndWrite
public void compressAndWrite(ImageOutputStream theCreatedFile, ImageOutputStream theCreatedNullFile, RenderedImage renderedImage) throws IOException
Compress and write data from amap 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 filetheCreatedNullFile
- - handler for the file of the null map (in cell_misc)- 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()
-
-