Class GeoTiffMetadata2CRSAdapter
- Object
-
- GeoTiffMetadata2CRSAdapter
-
public final class GeoTiffMetadata2CRSAdapter extends Object
TheGeoTiffMetadata2CRSAdapteris responsible for interpreting the metadata provided by theGeoTiffIIOMetadataDecoderfor 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
GeoTiffReadershould create an instance with theCoordinateSystemAuthorityFactoryspecified by theGeoTiffFormatinstance which created the reader. The image specific metadata should then be set with the appropriate accessor methods. Finally, thecreateCoordinateSystem()method is called to produce theCoordinateReferenceSystemobject 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 CoordinateReferenceSystemcreateCoordinateSystem(GeoTiffIIOMetadataDecoder metadata)This method creates aCoordinateReferenceSystemobject from the metadata which has been set earlier.static MathTransformgetRasterToModel(GeoTiffIIOMetadataDecoder metadata)Create the grid to world (or raster to model) transformation for this source respecting ALWAYS the OGCPixelInCell.CELL_CENTERconvention for theImageDatumof the underlyingImageCRS.static PixelInCellgetRasterType(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 aCoordinateReferenceSystemobject 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
CoordinateReferenceSystemobject representing the file data - Throws:
IOException- if there is unexpected data in the GeoKey tags.NullPointerException- if thecsAuthorityFactory,datumFactory,crsFactoryormetadataare 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_CENTERconvention for theImageDatumof the underlyingImageCRS.- Parameters:
metadata- containing the information to build theMathTransformfor 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
PixelInCellenum that capture the raster type.
-
-