org.esa.beam.util.geotiff
Class GeoTIFF

java.lang.Object
  extended by org.esa.beam.util.geotiff.GeoTIFF

public class GeoTIFF
extends Object


Constructor Summary
GeoTIFF()
           
 
Method Summary
static IIOImage createIIOImage(ImageWriter writer, RenderedImage im, GeoTIFFMetadata geoTIFFMetadata)
          Creates IIO image instance given image and GeoTIFF metadata.
static IIOMetadata createIIOMetadata(ImageWriter writer, ImageTypeSpecifier type, GeoTIFFMetadata geoTIFFMetadata)
          Creates image metadata which complies to the GeoTIFF specification for the given image writer, image type and GeoTIFF metadata.
static ImageWriter getImageWriter(ImageTypeSpecifier imageType)
          Gets an image writer suitable to be used for GeoTIFF.
static ImageWriter getImageWriter(RenderedImage image)
          Gets an image writer suitable to be used for GeoTIFF.
static boolean writeImage(RenderedImage image, File outputFile, GeoTIFFMetadata geoTIFFMetadata)
          Writes an image using an arbitrary ImageWriter that supports the GeoTIFF format to a File.
static boolean writeImage(RenderedImage image, ImageOutputStream outputStream, GeoTIFFMetadata geoTIFFMetadata)
          Writes an image using an arbitrary ImageWriter that supports the GeoTIFF format to an ImageOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoTIFF

public GeoTIFF()
Method Detail

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


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.