Class GeoTiffMetadata2CRSAdapter
Object
GeoTiffMetadata2CRSAdapter
The
GeoTiffMetadata2CRSAdapter
is responsible for interpreting the metadata provided by the
GeoTiffIIOMetadataDecoder
for the purposes of constructing a CoordinateSystem object representative of the
information found in the tags.
This class implements the flow indicated by the following diagram:
To use this class, the GeoTiffReader
should create an instance with the
CoordinateSystemAuthorityFactory
specified by the GeoTiffFormat
instance which created the
reader. The image specific metadata should then be set with the appropriate accessor methods. Finally, the
createCoordinateSystem()
method is called to produce the CoordinateReferenceSystem
object
specified by the metadata.
- Author:
- Bryce Nordgren / USDA Forest Service, Simone Giannecchini, Daniele Romagnoli
-
Constructor Summary
ConstructorsConstructorDescriptionGeoTiffMetadata2CRSAdapter
(Hints hints) Creates a new instance of GeoTiffMetadata2CRSAdapter -
Method Summary
Modifier and TypeMethodDescriptionThis method creates aCoordinateReferenceSystem
object from the metadata which has been set earlier.static MathTransform
getRasterToModel
(GeoTiffIIOMetadataDecoder metadata) Create the grid to world (or raster to model) transformation for this source respecting ALWAYS the OGCPixelInCell.CELL_CENTER
convention for theImageDatum
of the underlyingImageCRS
.static PixelInCell
getRasterType
(GeoTiffIIOMetadataDecoder metadata) Maps the RasterType GeoKey for this geotiff thePixelInCell
-
Constructor Details
-
GeoTiffMetadata2CRSAdapter
Creates a new instance of GeoTiffMetadata2CRSAdapter- Parameters:
hints
- a map of hints to locate the authority and object factories. (can be null)
-
-
Method Details
-
createCoordinateSystem
public CoordinateReferenceSystem createCoordinateSystem(GeoTiffIIOMetadataDecoder metadata) throws Exception This method creates aCoordinateReferenceSystem
object from the metadata which has been set earlier. If it cannot create theCoordinateReferenceSystem
, then one of three exceptions is thrown to indicate the error.- Returns:
- the
CoordinateReferenceSystem
object representing the file data - Throws:
IOException
- if there is unexpected data in the GeoKey tags.NullPointerException
- if thecsAuthorityFactory
,datumFactory
,crsFactory
ormetadata
are uninitializedUnsupportedOperationException
- if the coordinate system specified by the GeoTiff file is not supported.Exception
-
getRasterToModel
public static MathTransform getRasterToModel(GeoTiffIIOMetadataDecoder metadata) throws GeoTiffException Create the grid to world (or raster to model) transformation for this source respecting ALWAYS the OGCPixelInCell.CELL_CENTER
convention for theImageDatum
of the underlyingImageCRS
.- Parameters:
metadata
- containing the information to build theMathTransform
for going from grid to world.- Throws:
GeoTiffException
- See Also:
-
getRasterType
Maps the RasterType GeoKey for this geotiff thePixelInCell
- Parameters:
metadata
- the metadata instance to extract the information from.- Returns:
- an instance of the
PixelInCell
enum that capture the raster type.
-