Class GeoTiffIIOMetadataEncoder
- Object
-
- 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
Nested Classes Modifier and Type Class Description static classGeoTiffIIOMetadataEncoder.TagSet
-
Field Summary
Fields Modifier and Type Field Description static StringASCII_SEPARATORASCII_SEPARATOR
-
Constructor Summary
Constructors Constructor Description GeoTiffIIOMetadataEncoder()GeoTiffIIOMetadataEncoder(int geoTIFFVersion, int keyRevisionMajor, int keyRevisionMinor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGeoAscii(int keyID, String value)voidaddGeoDoubleParam(int keyID, double value)voidaddGeoDoubleParams(int keyID, double[] values)GeoKeyEntryaddGeoShortParam(int keyID, int value)voidaddModelTiePoint(double i, double j, double x, double y)voidaddModelTiePoint(double i, double j, double k, double x, double y, double z)voidassignTo(Element element)ElementcreateRootTree()protected static TIFFTaggetAsciiTag(String set, int tagID)StringgetGeoAsciiParam(int keyID)Gives access to the GeoAscii tiff content for the specified GeoKey metatag.protected static TIFFTaggetGeoAsciiParamsTag()doublegetGeoDoubleParam(int keyID)double[]getGeoDoubleParams(int keyID)double[]getGeoDoubleParams(int keyID, double[] values)protected static TIFFTaggetGeoDoubleParamsTag()protected static TIFFTaggetGeoKeyDirectoryTag()GeoKeyEntrygetGeoKeyEntry(int keyID)GeoKeyEntrygetGeoKeyEntryAt(int index)intgetGeoShortParam(int keyID)intgetGeoTIFFVersion()intgetKeyRevisionMajor()intgetKeyRevisionMinor()protected static TIFFTaggetModelPixelScaleTag()doublegetModelPixelScaleX()doublegetModelPixelScaleY()doublegetModelPixelScaleZ()TiePointgetModelTiePoint()TiePointgetModelTiePointAt(int index)protected static TIFFTaggetModelTiePointTag()protected static TIFFTaggetModelTransformationTag()doublegetNoData()protected static TIFFTaggetNoDataTag()intgetNumGeoKeyEntries()intgetNumModelTiePoints()booleanhasGeoKeyEntry(int keyID)static booleanisTiffUShort(int value)voidsetGeoTIFFVersion(int version)voidsetKeyRevision(int major, int minor)voidsetModelPixelScale(double x, double y)voidsetModelPixelScale(double x, double y, double z)voidsetModelTiePoint(double i, double j, double x, double y)voidsetModelTiePoint(double i, double j, double k, double x, double y, double z)voidsetModelTransformation(AffineTransform rasterToModel)voidsetNoData(double noData)voidsetTiffTagsMetadata(Map<String,String> metadata)Allows to setup metadata by leveraging on Ascii TIFF Tags.
-
-
-
Field Detail
-
ASCII_SEPARATOR
public static final String ASCII_SEPARATOR
ASCII_SEPARATOR- See Also:
- Constant Field Values
-
-
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
nullin case the ascii params is not present.- Parameters:
keyID- the MetaTag to look for.- Returns:
nullin 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)
-
-