Class GeoTIFFDataWriter

java.lang.Object
noaa.coastwatch.io.EarthDataWriter
noaa.coastwatch.io.GeoTIFFDataWriter

public class GeoTIFFDataWriter extends EarthDataWriter

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
  • Constructor Details

    • GeoTIFFDataWriter

      public GeoTIFFDataWriter(EarthDataInfo info, String filename, int compress) throws IOException
      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

      public void flush() throws IOException
      Description copied from class: EarthDataWriter
      Flushes all unwritten data to the destination.
      Specified by:
      flush in class EarthDataWriter
      Throws:
      IOException - if the data destination had I/O errors.
    • close

      public void close() throws IOException
      Description copied from class: EarthDataWriter
      Closes the writer and frees any resources. The flush method is called prior to closing.
      Specified by:
      close in class EarthDataWriter
      Throws:
      IOException - if the data destination had I/O errors.