Package org.esa.snap.core.util.geotiff
Class GeoTIFF
java.lang.Object
org.esa.snap.core.util.geotiff.GeoTIFF
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IIOImagecreateIIOImage(ImageWriter writer, RenderedImage im, GeoTIFFMetadata geoTIFFMetadata) Creates IIO image instance given image and GeoTIFF metadata.static IIOMetadatacreateIIOMetadata(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 IIOMetadatacreateIIOMetadata(ImageWriter writer, ImageTypeSpecifier type, GeoTIFFMetadata geoTIFFMetadata, String metadataFormatName, String classNameList) Creates image metadata which complies to the GeoTIFF specification for the given image writer, image type and GeoTIFF metadata.static ImageWritergetImageWriter(RenderedImage image) Gets an image writer suitable to be used for GeoTIFF.static ImageWritergetImageWriter(ImageTypeSpecifier imageType) Gets an image writer suitable to be used for GeoTIFF.static booleanwriteImage(RenderedImage image, File outputFile, GeoTIFFMetadata geoTIFFMetadata) Writes an image using an arbitraryImageWriterthat supports the GeoTIFF format to aFile.static booleanwriteImage(RenderedImage image, ImageOutputStream outputStream, GeoTIFFMetadata geoTIFFMetadata) Writes an image using an arbitraryImageWriterthat supports the GeoTIFF format to anImageOutputStream.
-
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 arbitraryImageWriterthat supports the GeoTIFF format to aFile. If there is already aFilepresent, its contents are discarded.- Parameters:
image- aRenderedImageto be written. name of the format.outputFile- aFileto be written to.geoTIFFMetadata- the GeoTIFF specific metadata- Returns:
falseif no appropriate image I/O writer was found.- Throws:
IllegalArgumentException- if any parameter isnull.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 arbitraryImageWriterthat supports the GeoTIFF format to anImageOutputStream. The image is written to theImageOutputStreamstarting at the current stream pointer, overwriting existing stream data from that point forward, if present.- Parameters:
image- aRenderedImageto be written.outputStream- anImageOutputStreamto be written to.geoTIFFMetadata- the GeoTIFF specific metadata- Returns:
falseif no appropriate writer is found.- Throws:
IllegalArgumentException- if any parameter isnull.IOException- if an error occurs during writing.
-
getImageWriter
Gets an image writer suitable to be used for GeoTIFF.- Parameters:
image- the image to be written later- Returns:
- a suitable image writer, or
nullif no writer is found
-
getImageWriter
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
nullif 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 nullim- the image, must not be nullgeoTIFFMetadata- 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 nulltype- the image type, must not be nullgeoTIFFMetadata- 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 nulltype- the image type, must not be nullgeoTIFFMetadata- the GeoTIFF metadata, must not be nullmetadataFormatName- the name of the Metadata Format specificationclassNameList- comma separated list of Metadata classes- Returns:
- the image metadata, never null
- Throws:
IIOException- if the metadata cannot be created
-