org.geotools.coverage.grid.io.imageio.geotiff
Class GeoTiffIIOMetadataEncoder

Object
  extended by GeoTiffIIOMetadataEncoder

public class GeoTiffIIOMetadataEncoder
extends Object

This class is responsible for encoding the geotiff tags into suitable metadata for the ImageIO library.

Basically it is and encoder/adapter that collects all the different tags, order it accordingly to the spec and then organize then into a dom tree ready to be used by the ImageIO metadata mechanism.

Since:
2.3
Author:
Simone Giannecchini, GeoSolutions

Nested Class Summary
static class GeoTiffIIOMetadataEncoder.TagSet
           
 
Field Summary
static String ASCII_SEPARATOR
          ASCII_SEPARATOR
 
Constructor Summary
GeoTiffIIOMetadataEncoder()
           
GeoTiffIIOMetadataEncoder(int geoTIFFVersion, int keyRevisionMajor, int keyRevisionMinor)
           
 
Method Summary
 void addGeoAscii(int keyID, String value)
           
 void addGeoDoubleParam(int keyID, double value)
           
 void addGeoDoubleParams(int keyID, double[] values)
           
 GeoKeyEntry addGeoShortParam(int keyID, int value)
           
 void addModelTiePoint(double i, double j, double x, double y)
           
 void addModelTiePoint(double i, double j, double k, double x, double y, double z)
           
 void assignTo(Element element)
           
 Element createRootTree()
           
protected static TIFFTag getAsciiTag(String set, int tagID)
           
 String getGeoAsciiParam(int keyID)
          Gives access to the GeoAscii tiff content for the specified GeoKey metatag.
protected static TIFFTag getGeoAsciiParamsTag()
           
 double getGeoDoubleParam(int keyID)
           
 double[] getGeoDoubleParams(int keyID)
           
 double[] getGeoDoubleParams(int keyID, double[] values)
           
protected static TIFFTag getGeoDoubleParamsTag()
           
protected static TIFFTag getGeoKeyDirectoryTag()
           
 GeoKeyEntry getGeoKeyEntry(int keyID)
           
 GeoKeyEntry getGeoKeyEntryAt(int index)
           
 int getGeoShortParam(int keyID)
           
 int getGeoTIFFVersion()
           
 int getKeyRevisionMajor()
           
 int getKeyRevisionMinor()
           
protected static TIFFTag getModelPixelScaleTag()
           
 double getModelPixelScaleX()
           
 double getModelPixelScaleY()
           
 double getModelPixelScaleZ()
           
 TiePoint getModelTiePoint()
           
 TiePoint getModelTiePointAt(int index)
           
protected static TIFFTag getModelTiePointTag()
           
protected static TIFFTag getModelTransformationTag()
           
 double getNoData()
           
protected static TIFFTag getNoDataTag()
           
 int getNumGeoKeyEntries()
           
 int getNumModelTiePoints()
           
 boolean hasGeoKeyEntry(int keyID)
           
static boolean isTiffUShort(int value)
           
 void setGeoTIFFVersion(int version)
           
 void setKeyRevision(int major, int minor)
           
 void setModelPixelScale(double x, double y)
           
 void setModelPixelScale(double x, double y, double z)
           
 void setModelTiePoint(double i, double j, double x, double y)
           
 void setModelTiePoint(double i, double j, double k, double x, double y, double z)
           
 void setModelTransformation(AffineTransform rasterToModel)
           
 void setNoData(double noData)
           
 void setTiffTagsMetadata(Map<String,String> metadata)
          Allows to setup metadata by leveraging on Ascii TIFF Tags.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASCII_SEPARATOR

public static final String ASCII_SEPARATOR
ASCII_SEPARATOR

See Also:
Constant Field Values
Constructor Detail

GeoTiffIIOMetadataEncoder

public GeoTiffIIOMetadataEncoder()

GeoTiffIIOMetadataEncoder

public GeoTiffIIOMetadataEncoder(int geoTIFFVersion,
                                 int keyRevisionMajor,
                                 int keyRevisionMinor)
Method Detail

isTiffUShort

public static boolean isTiffUShort(int value)

getGeoTIFFVersion

public int getGeoTIFFVersion()

setGeoTIFFVersion

public void setGeoTIFFVersion(int version)

getKeyRevisionMajor

public int getKeyRevisionMajor()

getKeyRevisionMinor

public int getKeyRevisionMinor()

setKeyRevision

public void setKeyRevision(int major,
                           int minor)

getModelPixelScaleX

public double getModelPixelScaleX()

getModelPixelScaleY

public double getModelPixelScaleY()

getModelPixelScaleZ

public double getModelPixelScaleZ()

setModelPixelScale

public void setModelPixelScale(double x,
                               double y)

setModelPixelScale

public void setModelPixelScale(double x,
                               double y,
                               double z)

getNumModelTiePoints

public int getNumModelTiePoints()

getModelTiePoint

public TiePoint getModelTiePoint()

getModelTiePointAt

public TiePoint getModelTiePointAt(int index)

setModelTiePoint

public void setModelTiePoint(double i,
                             double j,
                             double x,
                             double y)

setModelTiePoint

public void setModelTiePoint(double i,
                             double j,
                             double k,
                             double x,
                             double y,
                             double z)

addModelTiePoint

public void addModelTiePoint(double i,
                             double j,
                             double x,
                             double y)

addModelTiePoint

public void addModelTiePoint(double i,
                             double j,
                             double k,
                             double x,
                             double y,
                             double z)

getNumGeoKeyEntries

public int getNumGeoKeyEntries()

getGeoKeyEntryAt

public GeoKeyEntry getGeoKeyEntryAt(int index)

getGeoKeyEntry

public GeoKeyEntry getGeoKeyEntry(int keyID)

hasGeoKeyEntry

public boolean hasGeoKeyEntry(int keyID)

getGeoShortParam

public int getGeoShortParam(int keyID)

getGeoDoubleParam

public double getGeoDoubleParam(int keyID)

getGeoDoubleParams

public double[] getGeoDoubleParams(int keyID)

getGeoDoubleParams

public double[] getGeoDoubleParams(int keyID,
                                   double[] values)

getGeoAsciiParam

public String getGeoAsciiParam(int keyID)
Gives access to the GeoAscii tiff content for the specified GeoKey metatag.

Returns null in case the ascii params is not present.

Parameters:
keyID - the MetaTag to look for.
Returns:
null in case the ascii params is not present, otherwise the metatag content.

addGeoShortParam

public GeoKeyEntry addGeoShortParam(int keyID,
                                    int value)

addGeoDoubleParam

public void addGeoDoubleParam(int keyID,
                              double value)

addGeoDoubleParams

public void addGeoDoubleParams(int keyID,
                               double[] values)

addGeoAscii

public void addGeoAscii(int keyID,
                        String value)

assignTo

public void assignTo(Element element)

createRootTree

public Element createRootTree()

getGeoKeyDirectoryTag

protected static TIFFTag getGeoKeyDirectoryTag()

getGeoDoubleParamsTag

protected static TIFFTag getGeoDoubleParamsTag()

getGeoAsciiParamsTag

protected static TIFFTag getGeoAsciiParamsTag()

getModelPixelScaleTag

protected static TIFFTag getModelPixelScaleTag()

getModelTiePointTag

protected static TIFFTag getModelTiePointTag()

getModelTransformationTag

protected static TIFFTag getModelTransformationTag()

getAsciiTag

protected static TIFFTag getAsciiTag(String set,
                                     int tagID)

getNoDataTag

protected static TIFFTag getNoDataTag()

setModelTransformation

public void setModelTransformation(AffineTransform rasterToModel)

getNoData

public double getNoData()

setNoData

public void setNoData(double noData)

setTiffTagsMetadata

public void setTiffTagsMetadata(Map<String,String> metadata)
Allows to setup metadata by leveraging on Ascii TIFF Tags.

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 metadata.
See Also:
GeoTiffIIOMetadataEncoder.TagSet


Copyright © 1996-2014 Geotools. All Rights Reserved.