Package org.geotools.gce.geotiff
Class GeoTiffWriter
- Object
-
- AbstractGridCoverageWriter
-
- GeoTiffWriter
-
- All Implemented Interfaces:
GridCoverageWriter
public class GeoTiffWriter extends AbstractGridCoverageWriter implements GridCoverageWriter
AbstractGridCoverageWriterimplementation for the geotiff format.- Author:
- Simone Giannecchini, GeoSolutions SAS
-
-
Field Summary
-
Fields inherited from class AbstractGridCoverageWriter
destination, hints, outStream
-
-
Constructor Summary
Constructors Constructor Description GeoTiffWriter(Object destination)Constructor for aGeoTiffWriter.GeoTiffWriter(Object destination, Hints hints)Constructor for aGeoTiffWriter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IIOMetadatacreateGeoTiffIIOMetadata(ImageWriter writer, ImageTypeSpecifier type, GeoTiffIIOMetadataEncoder geoTIFFMetadata, ImageWriteParam params)Creates image metadata which complies to the GeoTIFFWritingUtilities specification for the given image writer, image type and GeoTIFFWritingUtilities metadata.voiddispose()Releases resources held by thisAbstractGridCoverageWriter.FormatgetFormat()Returns the format handled by thisGridCoverageWriter.voidsetMetadataValue(String name, String value)Allows to setup metadata by leveraging on Ascii TIFF Tags.voidwrite(GridCoverage gc, GeneralParameterValue[] params)Writes the specified grid coverage.-
Methods inherited from class AbstractGridCoverageWriter
finalize, getDestination, getMetadataNames, setCurrentSubname
-
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface GridCoverageWriter
getDestination, getMetadataNames, setCurrentSubname
-
-
-
-
Constructor Detail
-
GeoTiffWriter
public GeoTiffWriter(Object destination) throws IOException
Constructor for aGeoTiffWriter.- Throws:
IOException
-
GeoTiffWriter
public GeoTiffWriter(Object destination, Hints hints) throws IOException
Constructor for aGeoTiffWriter.- Throws:
IOException
-
-
Method Detail
-
setMetadataValue
public void setMetadataValue(String name, String value) throws IOException
Allows to setup metadata by leveraging on Ascii TIFF Tags.- Specified by:
setMetadataValuein interfaceGridCoverageWriter- Overrides:
setMetadataValuein classAbstractGridCoverageWriter- Parameters:
name- is the Ascii TIFF Tag identifier. It can be a String representing: 1) a simple Integer (referring to a tag ID) (in that case it will refer to the BaselineTIFFTagSet 2) OR an identifier in the form: TIFFTagSet:TIFFTagID. As an instance: "BaselineTIFFTagSet:305" in order to add the Copyright info.value- is the value to be assigned to that tag.- Throws:
IOException- if an error occurs during writing.- See Also:
GeoTiffIIOMetadataEncoder.TagSet
-
getFormat
public Format getFormat()
Description copied from interface:GridCoverageWriterReturns the format handled by thisGridCoverageWriter.- Specified by:
getFormatin interfaceGridCoverageWriter
-
write
public void write(GridCoverage gc, GeneralParameterValue[] params) throws IllegalArgumentException, IOException, IndexOutOfBoundsException
Description copied from interface:GridCoverageWriterWrites the specified grid coverage.- Specified by:
writein interfaceGridCoverageWriter- Parameters:
gc- The grid coverage to write.params- An optional set of parameters. Should be any or all of the parameters returned byFormat.getWriteParameters().- Throws:
InvalidParameterNameException- if a parameter inparametersdoesn't have a recognized name.InvalidParameterValueException- if a parameter inparametersdoesn't have a valid value.ParameterNotFoundException- if a parameter was required for the operation but was not provided in theparameterslist.IOException- if the export failed for some other input/output reason, includingIIOExceptionif an error was thrown by the underlying image library.IllegalArgumentExceptionIndexOutOfBoundsException
-
createGeoTiffIIOMetadata
public static final IIOMetadata createGeoTiffIIOMetadata(ImageWriter writer, ImageTypeSpecifier type, GeoTiffIIOMetadataEncoder geoTIFFMetadata, ImageWriteParam params) throws IIOException
Creates image metadata which complies to the GeoTIFFWritingUtilities specification for the given image writer, image type and GeoTIFFWritingUtilities metadata.- Parameters:
writer- the image writer, must not be nulltype- the image type, must not be nullgeoTIFFMetadata- the GeoTIFFWritingUtilities metadata, must not be null- Returns:
- the image metadata, never null
- Throws:
IIOException- if the metadata cannot be created
-
dispose
public void dispose()
Description copied from class:AbstractGridCoverageWriterReleases resources held by thisAbstractGridCoverageWriter.- Specified by:
disposein interfaceGridCoverageWriter- Overrides:
disposein classAbstractGridCoverageWriter
-
-