Class GeoTIFF

java.lang.Object
org.esa.snap.core.util.geotiff.GeoTIFF

public class GeoTIFF extends Object
  • Constructor Details

    • GeoTIFF

      public GeoTIFF()
  • Method Details

    • writeImage

      public static boolean writeImage(RenderedImage image, File outputFile, GeoTIFFMetadata geoTIFFMetadata) throws IOException
      Writes an image using an arbitrary ImageWriter that supports the GeoTIFF format to a File. If there is already a File present, its contents are discarded.
      Parameters:
      image - a RenderedImage to be written. name of the format.
      outputFile - a File to be written to.
      geoTIFFMetadata - the GeoTIFF specific metadata
      Returns:
      false if no appropriate image I/O writer was found.
      Throws:
      IllegalArgumentException - if any parameter is null.
      IOException - if an error occurs during writing.
    • writeImage

      public static boolean writeImage(RenderedImage image, ImageOutputStream outputStream, GeoTIFFMetadata geoTIFFMetadata) throws IOException
      Writes an image using an arbitrary ImageWriter that supports the GeoTIFF format to an ImageOutputStream. The image is written to the ImageOutputStream starting at the current stream pointer, overwriting existing stream data from that point forward, if present.
      Parameters:
      image - a RenderedImage to be written.
      outputStream - an ImageOutputStream to be written to.
      geoTIFFMetadata - the GeoTIFF specific metadata
      Returns:
      false if no appropriate writer is found.
      Throws:
      IllegalArgumentException - if any parameter is null.
      IOException - if an error occurs during writing.
    • getImageWriter

      public static ImageWriter getImageWriter(RenderedImage image)
      Gets an image writer suitable to be used for GeoTIFF.
      Parameters:
      image - the image to be written later
      Returns:
      a suitable image writer, or null if no writer is found
    • getImageWriter

      public static ImageWriter getImageWriter(ImageTypeSpecifier imageType)
      Gets an image writer suitable to be used for GeoTIFF.
      Parameters:
      imageType - the type of the image to be written later
      Returns:
      a suitable image writer, or null if no writer is found
    • createIIOImage

      public static IIOImage createIIOImage(ImageWriter writer, RenderedImage im, GeoTIFFMetadata geoTIFFMetadata) throws IIOException
      Creates IIO image instance given image and GeoTIFF metadata.
      Parameters:
      writer - the image writer, must not be null
      im - the image, must not be null
      geoTIFFMetadata - the GeoTIFF metadata, must not be null
      Returns:
      the IIO image, never null
      Throws:
      IIOException - if the metadata cannot be created
    • createIIOMetadata

      public static IIOMetadata createIIOMetadata(ImageWriter writer, ImageTypeSpecifier type, GeoTIFFMetadata geoTIFFMetadata) throws IIOException
      Creates image metadata which complies to the GeoTIFF specification for the given image writer, image type and GeoTIFF metadata.
      Parameters:
      writer - the image writer, must not be null
      type - the image type, must not be null
      geoTIFFMetadata - the GeoTIFF metadata, must not be null
      Returns:
      the image metadata, never null
      Throws:
      IIOException - if the metadata cannot be created
    • createIIOMetadata

      public static IIOMetadata createIIOMetadata(ImageWriter writer, ImageTypeSpecifier type, GeoTIFFMetadata geoTIFFMetadata, String metadataFormatName, String classNameList) throws IIOException
      Creates image metadata which complies to the GeoTIFF specification for the given image writer, image type and GeoTIFF metadata.
      Parameters:
      writer - the image writer, must not be null
      type - the image type, must not be null
      geoTIFFMetadata - the GeoTIFF metadata, must not be null
      metadataFormatName - the name of the Metadata Format specification
      classNameList - comma separated list of Metadata classes
      Returns:
      the image metadata, never null
      Throws:
      IIOException - if the metadata cannot be created