Class GeoTiffMetadata2CRSAdapter
- Object
-
- GeoTiffMetadata2CRSAdapter
-
public final class GeoTiffMetadata2CRSAdapter extends Object
TheGeoTiffMetadata2CRSAdapter
is responsible for interpreting the metadata provided by theGeoTiffIIOMetadataDecoder
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 theCoordinateSystemAuthorityFactory
specified by theGeoTiffFormat
instance which created the reader. The image specific metadata should then be set with the appropriate accessor methods. Finally, thecreateCoordinateSystem()
method is called to produce theCoordinateReferenceSystem
object specified by the metadata.- Author:
- Bryce Nordgren / USDA Forest Service, Simone Giannecchini, Daniele Romagnoli
-
-
Constructor Summary
Constructors Constructor Description GeoTiffMetadata2CRSAdapter(Hints hints)
Creates a new instance of GeoTiffMetadata2CRSAdapter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinateReferenceSystem
createCoordinateSystem(GeoTiffIIOMetadataDecoder metadata)
This 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 Detail
-
GeoTiffMetadata2CRSAdapter
public GeoTiffMetadata2CRSAdapter(Hints hints)
Creates a new instance of GeoTiffMetadata2CRSAdapter- Parameters:
hints
- a map of hints to locate the authority and object factories. (can be null)
-
-
Method Detail
-
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:
- this email post
-
getRasterType
public static PixelInCell getRasterType(GeoTiffIIOMetadataDecoder metadata)
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.
-
-