Class GeoTiffIIOMetadataDecoder
All of the GeoKey values are included here as constants, and the portions of the GeoTIFFWritingUtilities specification pertaining to each have been copied for easy access.
The majority of the possible GeoKey values and their meanings are NOT reproduced here. Only the most important GeoKey code values have been copied, for others see the specification.
Convenience methods have been included to retrieve the various TIFFFields that are not part of the GeoKey directory, such as the Model Transformation and Model TiePoints. Retrieving a GeoKey from the GeoKey directory is a bit more specialized and requires knowledge of the correct key code.
Making use of the geographic metadata still requires some basic understanding of the GeoKey values that is not provided here.
For more information see the GeoTIFFWritingUtilities specification at http://www.remotesensing.org/geotiff/spec/geotiffhome.html
- Author:
- Mike Nidel, Simone Giannecchini, GeoSolutions
-
Constructor Summary
ConstructorsConstructorDescriptionGeoTiffIIOMetadataDecoder
(IIOMetadata imageMetadata) The constructor builds a metadata adapter for the image metadata root IIOMetadataNode. -
Method Summary
Modifier and TypeMethodDescriptiongetAsciiTIFFTag
(String tagID) Returns the value of an ASCII TIFFTag referred by tagID.Returns theGeoTiffGCSCodes.GeogCitationGeoKey
value, parsed into its components.getGeoKey
(int keyID) Gets a GeoKey value as a String.int
Gets the version of the GeoKey directory.int
Gets the minor revision number of the GeoKeys in this metadata.getGeoKeyRecord
(int keyID) Gets a record containing the four TIFFShort values for a geokey entry.int
Gets the revision number of the GeoKeys in this metadata.Return the GeoKeys.Gets the model pixel scales from the correct TIFFFieldTiePoint[]
Gets the model tie points from the appropriate TIFFFieldGets the model tie points from the appropriate TIFFFielddouble
Gets the noData from the related TIFFField.int
Gets the number of GeoKeys in the geokeys directory.boolean
Returntrue
if the geokey directory is present,false
otherwise.boolean
Tells me if the underlyingIIOMetadata
contains ModelTransformationTag tag forAffineTransform
that map from Raster Space to World Space.boolean
Tells me if the underlyingIIOMetadata
contains NoData Tag.boolean
Tells me if the underlyingIIOMetadata
contains ModelTiepointTag tag forTiePoint
.boolean
Tells me if the underlyingIIOMetadata
contains ModelTiepointTag tag forTiePoint
.
-
Constructor Details
-
GeoTiffIIOMetadataDecoder
The constructor builds a metadata adapter for the image metadata root IIOMetadataNode.- Parameters:
imageMetadata
- The image metadata
-
-
Method Details
-
getGeoKeyDirectoryVersion
public int getGeoKeyDirectoryVersion()Gets the version of the GeoKey directory. This is typically a value of 1 and can be used to check that the data is of a valid format. -
getGeoKeyRevision
public int getGeoKeyRevision()Gets the revision number of the GeoKeys in this metadata. -
getGeoKeyMinorRevision
public int getGeoKeyMinorRevision()Gets the minor revision number of the GeoKeys in this metadata. -
getNumGeoKeys
public int getNumGeoKeys()Gets the number of GeoKeys in the geokeys directory. -
getGeographicCitation
Returns theGeoTiffGCSCodes.GeogCitationGeoKey
value, parsed into its components.- Returns:
-
getGeoKey
Gets a GeoKey value as a String. This implementation should be "quiet" in the sense that it should not throw any exceptions but only return null in the event that the data organization is not as expected.- Parameters:
keyID
- The numeric ID of the GeoKey- Returns:
- A string representing the value, or null if the key was not found.
-
getGeoKeyRecord
Gets a record containing the four TIFFShort values for a geokey entry. For more information see the GeoTIFFWritingUtilities specification.- Returns:
- the record with the given keyID, or null if none is found
-
getGeoKeys
Return the GeoKeys. -
getModelPixelScales
Gets the model pixel scales from the correct TIFFField -
getModelTiePoints
Gets the model tie points from the appropriate TIFFField- Returns:
- the tie points, or null if not found
-
getNoData
public double getNoData()Gets the noData from the related TIFFField. Check metadata has noData usinghasNoData()
method before calling this method.- Returns:
- the noData value or
Double.NaN
in case of unable to get noData.
-
hasTiePoints
public boolean hasTiePoints()Tells me if the underlyingIIOMetadata
contains ModelTiepointTag tag forTiePoint
.- Returns:
- true if ModelTiepointTag is present, false otherwise.
-
hasPixelScales
public boolean hasPixelScales()Tells me if the underlyingIIOMetadata
contains ModelTiepointTag tag forTiePoint
.- Returns:
- true if ModelTiepointTag is present, false otherwise.
-
hasNoData
public boolean hasNoData()Tells me if the underlyingIIOMetadata
contains NoData Tag.- Returns:
- true if NoData Tag is present, false otherwise.
- See Also:
-
getModelTransformation
Gets the model tie points from the appropriate TIFFFieldAttention, for the moment we support only 2D baseline transformations.
- Returns:
- the transformation, or null if not found
-
hasModelTrasformation
public boolean hasModelTrasformation()Tells me if the underlyingIIOMetadata
contains ModelTransformationTag tag forAffineTransform
that map from Raster Space to World Space.- Returns:
- true if ModelTransformationTag is present, false otherwise.
-
getRootNode
-
hasGeoKey
public boolean hasGeoKey()Returntrue
if the geokey directory is present,false
otherwise. In case no geokey dir is present no CRS can be constructed from this set of metadata.A prj can be used otherwise.
- Returns:
true
if the geokey directory is present,false
otherwise.
-
getAsciiTIFFTag
Returns the value of an ASCII TIFFTag referred by tagID.- Returns:
- the tag value as a String, null if not available.
-