Package noaa.coastwatch.io
Class GeoTIFFDataWriter
java.lang.Object
noaa.coastwatch.io.EarthDataWriter
noaa.coastwatch.io.GeoTIFFDataWriter
The GeoTIFFDataWriter
encodes a set of data variables
as an 8-, 16-, or 32-bit multiband TIFF file with GeoTIFF georeferencing
tags. The resulting image file is not suitable for display, but can be
imported into GIS systems.
- Since:
- 3.5.1
- Author:
- Peter Hollemans
-
Field Summary
Fields inherited from class noaa.coastwatch.io.EarthDataWriter
info, isCanceled, variables, writeProgress, writeVariableName, writeVariables
-
Constructor Summary
ConstructorDescriptionGeoTIFFDataWriter
(EarthDataInfo info, String filename, int compress) Creates a new writer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the writer and frees any resources.void
flush()
Flushes all unwritten data to the destination.void
setBufferType
(int bufferType) Sets the output TIFF image buffer type.void
setMissing
(float missing) Sets the missing value.Methods inherited from class noaa.coastwatch.io.EarthDataWriter
addVariable, cancel, finalize, getDestination, getProgress, getProgressLength, getProgressVariable
-
Constructor Details
-
GeoTIFFDataWriter
Creates a new writer.- Parameters:
info
- the info object to use for earth transform and other attributes.filename
- the new GeoTIFF file name.compress
- the TIFF compression type, either GeoTIFFWriter.COMP_NONE, GeoTIFFWriter.COMP_DEFLATE, GeoTIFFWriter.COMP_PACK, or GeoTIFFWriter.COMP_LZW.- Throws:
IOException
- if an error occurred the file.
-
-
Method Details
-
setMissing
public void setMissing(float missing) Sets the missing value.- Parameters:
missing
- the missing value. The missing value is used to represent missing or out of range data. By default, Float.NaN is used as the missing value.
-
setBufferType
public void setBufferType(int bufferType) Sets the output TIFF image buffer type. This is the data type that will ultimately be used to write the TIFF data values. If the buffer type is integer, data values will be rounded to this type before writing and if the missing value is Float.NaN, zeroes will be written as missing data.- Parameters:
bufferType
- the TIFF image buffer type. Supported types are GeoTIFFWriter.TYPE_FLOAT, GeoTIFFWriter.TYPE_BYTE (8-bit unsigned byte), and GeoTIFFWriter.TYPE_USHORT (16-bit unsigned short). By default, GeoTIFFWriter.TYPE_FLOAT is used.- Since:
- 3.8.1
- See Also:
-
flush
Description copied from class:EarthDataWriter
Flushes all unwritten data to the destination.- Specified by:
flush
in classEarthDataWriter
- Throws:
IOException
- if the data destination had I/O errors.
-
close
Description copied from class:EarthDataWriter
Closes the writer and frees any resources. Theflush
method is called prior to closing.- Specified by:
close
in classEarthDataWriter
- Throws:
IOException
- if the data destination had I/O errors.
-