GeoTIFF Web Page Table of Contents Top of Section 2

2.7 Geocoding Raster Data

2.7.1 General Approach

A geocoded image is a georeferenced image as described in section 2.6, which also specifies a model space coordinate system (CS) between the model space M (to which the raster space has been tied) and the earth. The relationship can be diagrammed, including the associated TIFF tags, as follows:
        ModelPixelScaleTag 
        ModelTiepointTag                  GeoKeyDirectoryTag CS 
    R  -------- OR ---------------> M  --------- AND  -----------> Earth
        ModelTransformationTag            GeoDoubleParamsTag  
                                          GeoAsciiParamsTag  

The geocoding coordinate system is defined by the GeoKeyDirectoryTag, while the Georeferencing information (T) is defined by the ModelTiepointTag and the ModelPixelScale, or ModelTransformationTag. Since these two systems are independent of each other, the tags used to store the parameters are separated from each other in the GeoTIFF file to emphasize the orthogonality.

2.7.2 GeoTIFF GeoKeys for Geocoding

As mentioned above, all information regarding the Model Coordinate System used in the raster data is referenced from the GeoKeyDirectoryTag, which stores all of the GeoKey entries. In the Appendix, section 6.2 summarizes all of the GeoKeys defined for baseline GeoTIFF, and their corresponding codes are documented in section 6.3. Only the Keys themselves are documented here.

Common Features

Public and Private Key and Code Ranges

GeoTIFF GeoKey ID's may take any value between 0 and 65535. Following TIFF general approach, the GeoKey ID's from 32768 and above are available for private implementations. However, no registry will be established for these keys or codes, so developers are warned to use them at their own risk.

The Key ID's from 0 to 32767 are reserved for use by the official GeoTIFF spec, and are broken down into the following sub-domains:

   [    0,  1023]       Reserved
   [ 1024,  2047]       GeoTIFF Configuration Keys
   [ 2048,  3071]       Geographic/Geocentric CS Parameter Keys
   [ 3072,  4095]       Projected CS Parameter Keys
   [ 4096,  5119]       Vertical CS Parameter Keys
   [ 5120, 32767]       Reserved
   [32768, 65535]       Private use

GeoKey codes, like keys and tags, also range from 0 to 65535. Following the TIFF approach, all codes from 32768 and above are available for private user implementation. There will be no registry for these codes, however, and so developers must be sure that these tags will only be used internally. Use private codes at your own risk.

The codes from 0 to 32767 for all public GeoKeys are reserved by this GeoTIFF specification.

Common Public Code Values

For consistency, several key codes have the same meaning in all implemented GeoKeys possessing a SHORT numerical coding system:

          0 = undefined
      32767 = user-defined

The "undefined" code means that this parameter is intentionally omitted, for whatever reason. For example, the datum used for a given map may be unknown, or the accuracy of a aerial photo is so low that to specify a particular datum would imply a higher accuracy than is in the data.

The "user-defined" code means that a feature is not among the standard list, and is being explicitly defined. In cases where this is meaningful, Geokey parameters have been supplied for the user to define this feature.

"User-Defined" requirements: In each section below a specification of the additional GeoKeys required for the "user-defined" option is given. In all cases the corresponding "Citation" key is strongly recommended, as per the FGDC Metadata standard regarding "local" types.

GeoTIFF Configuration GeoKeys

These keys are to be used to establish the general configuration of this file's coordinate system, including the types of raster coordinate systems, model coordinate systems, and citations if any.

GTModelTypeGeoKey

Key ID = 1024
Type: SHORT (code)
Values:  Section 6.3.1.1 Codes

This GeoKey defines the general type of model Coordinate system used, and to which the raster space will be transformed:unknown, Geocentric (rarely used), Geographic, Projected Coordinate System, or user-defined. If the coordinate system is a PCS, then only the PCS code need be specified. If the coordinate system does not fit into one of the standard registered PCS'S, but it uses one of the standard projections and datums, then its should be documented as a PCS model with "user-defined" type, requiring the specification of projection parameters, etc.

GeoKey requirements for User-Defined Model Type (not advisable):
     GTCitationGeoKey
     

GTRasterTypeGeoKey

Key ID = 1025  
Type =  Section 6.3.1.2 codes
This establishes the Raster Space coordinate system used; there are currently only two, namely RasterPixelIsPoint and RasterPixelIsArea. No user-defined raster spaces are currently supported. For variance in imaging display parameters, such as pixel aspect-ratios, use the standard TIFF 6.0 device-space tags instead.

GTCitationGeoKey

Key ID = 1026  
Type = ASCII
As with all the "Citation" GeoKeys, this is provided to give an ASCII reference to published documentation on the overall configuration of this GeoTIFF file.

Geographic CS Parameter GeoKeys


In general, the geographic coordinate system used will be implied by the projected coordinate system code. If however, this is a user-defined PCS, or the ModelType was chosen to be Geographic, then the system must be explicitly defined here, using the Horizontal datum code.

GeographicTypeGeoKey

Key ID = 2048  
Type = SHORT (code)
Values =  Section 6.3.2.1 Codes    
This key may be used to specify the code for the geographic coordinate system used to map lat-long to a specific ellipsoid over the earth.
GeoKey Requirements for User-Defined geographic CS:
 
       GeogCitationGeoKey
       GeogGeodeticDatumGeoKey
 	GeogAngularUnitsGeoKey (if not degrees)
	GeogPrimeMeridianGeoKey (if not Greenwich)

GeogCitationGeoKey

Key ID = 2049
Type = ASCII
Values = text
General citation and reference for all Geographic CS parameters.

GeogGeodeticDatumGeoKey

Key ID = 2050  
Type = SHORT (code)
Values =  Section 6.3.2.2 Codes    
This key may be used to specify the horizontal datum, defining the size, position and orientation of the reference ellipsoid used in user-defined geographic coordinate systems.
GeoKey Requirements for User-Defined Horizontal Datum: 
       GeogCitationGeoKey
       GeogEllipsoidGeoKey

GeogPrimeMeridianGeoKey

Key ID = 2051
Type = SHORT (code)
Units:  Section 6.3.2.4 code
Allows specification of the location of the Prime meridian for user-defined geographic coordinate systems. The default standard is Greenwich, England.

GeogPrimeMeridianLongGeoKey

Key ID = 2061  
Type = DOUBLE 
Units =  GeogAngularUnits
This key allows definition of user-defined Prime Meridians, the location of which is defined by its longitude relative to Greenwich.

GeogLinearUnitsGeoKey

Key ID = 2052
Type = SHORT
Values:  Section 6.3.1.3 Codes
Allows the definition of geocentric CS linear units for user-defined GCS.

GeogLinearUnitSizeGeoKey

Key ID = 2053
Type = DOUBLE
Units: meters
Allows the definition of user-defined linear geocentric units, as measured in meters.

GeogAngularUnitsGeoKey

Key ID = 2054  
Type = SHORT (code)
Values =   Section 6.3.1.4  Codes 
Allows the definition of geocentric CS Linear units for user-defined GCS and for ellipsoids.
GeoKey Requirements for "user-defined" units:
    GeogCitationGeoKey
    GeogAngularUnitSizeGeoKey 

GeogAngularUnitSizeGeoKey

Key ID = 2055
Type = DOUBLE
Units: radians
Allows the definition of user-defined angular geographic units, as measured in radians.

GeogEllipsoidGeoKey

Key ID = 2056
Type = SHORT (code)
Values =  Section 6.3.2.3 Codes 
   
This key may be used to specify the coded ellipsoid used in the geodetic datum of the Geographic Coordinate System.
GeoKey Requirements for User-Defined Ellipsoid: 
   GeogCitationGeoKey
   [GeogSemiMajorAxisGeoKey, 
           [GeogSemiMinorAxisGeoKey | GeogInvFlatteningGeoKey] ]

GeogSemiMajorAxisGeoKey

Key ID = 2057
Type = DOUBLE
Units: Geocentric CS Linear Units
Allows the specification of user-defined Ellipsoid Semi-Major Axis (a).

GeogSemiMinorAxisGeoKey

Key ID = 2058
Type = DOUBLE
Units: Geocentric CS Linear Units
Allows the specification of user-defined Ellipsoid Semi-Minor Axis (b).

GeogInvFlatteningGeoKey

Key ID = 2059
Type = DOUBLE
Units: none.
Allows the specification of the inverse of user-defined Ellipsoid's flattening parameter (f). The eccentricity-squared e^2 of the ellipsoid is related to the non-inverted f by:
      e^2  = 2*f  - f^2
 
   Note: if the ellipsoid is spherical the inverse-flattening
   becomes infinite; use the GeogSemiMinorAxisGeoKey instead, and
   set it equal to the semi-major axis length.

GeogAzimuthUnitsGeoKey

Key ID = 2060  
Type = SHORT (code)
Values =   Section 6.3.1.4 Codes 
This key may be used to specify the angular units of measurement used to defining azimuths, in geographic coordinate systems. These may be used for defining azimuthal parameters for some projection algorithms, and may not necessarily be the same angular units used for lat-long.

Projected CS Parameter GeoKeys

The PCS range of GeoKeys includes the projection and coordinate transformation keys as well. The projection keys are included in this block since they can only be used to define projected coordinate systems.

ProjectedCSTypeGeoKey

Key ID = 3072
Type = SHORT (codes)
Values:  Section 6.3.3.1 codes

This code is provided to specify the projected coordinate system.

GeoKey requirements for "user-defined" PCS families:
   PCSCitationGeoKey
   ProjectionGeoKey
 

PCSCitationGeoKey

Key ID = 3073
Type = ASCII
As with all the "Citation" GeoKeys, this is provided to give an ASCII reference to published documentation on the Projected Coordinate System particularly if this is a "user-defined" PCS.

Projection Definition GeoKeys


With the exception of the first two keys, these are mostly projection-specific parameters, and only a few will be required for any particular projection type. Projected coordinate systems automatically imply a specific projection type, as well as specific parameters for that projection, and so the keys below will only be necessary for user-defined projected coordinate systems.

ProjectionGeoKey

Key ID = 3074
Type = SHORT (code)
Values:   Section 6.3.3.2 codes
Allows specification of the coordinate transformation method and projection zone parameters. Note : when associated with an appropriate Geographic Coordinate System, this forms a Projected Coordinate System.

GeoKeys Required for "user-defined" Projections:
   PCSCitationGeoKey
   ProjCoordTransGeoKey
   ProjLinearUnitsGeoKey
   (additional parameters depending on ProjCoordTransGeoKey).

ProjCoordTransGeoKey

Key ID = 3075
Type = SHORT (code)
Values:   Section 6.3.3.3 codes
Allows specification of the coordinate transformation method used. Note: this does not include the definition of the corresponding Geographic Coordinate System to which the projected CS is related; only the transformation method is defined here.
GeoKeys Required for "user-defined" Coordinate Transformations:
   PCSCitationGeoKey
   <additional parameter geokeys depending on the Coord. Trans. specified).

ProjLinearUnitsGeoKey

Key ID = 3076 
Type = SHORT (code)
Values:  Section 6.3.1.3 codes 
Defines linear units used by this projection.

ProjLinearUnitSizeGeoKey

Key ID = 3077 
Type = DOUBLE
Units: meters
Defines size of user-defined linear units in meters.

ProjStdParallel1GeoKey

Key ID = 3078 
Type = DOUBLE
Units: GeogAngularUnit 
Alias: ProjStdParallelGeoKey (from Rev 0.2)
Latitude of primary Standard Parallel.

ProjStdParallel2GeoKey

Key ID = 3079
Type = DOUBLE
Units: GeogAngularUnit 
Latitude of second Standard Parallel.

ProjNatOriginLongGeoKey

Key ID = 3080
Type = DOUBLE
Units: GeogAngularUnit 
Alias: ProjOriginLongGeoKey
Longitude of map-projection Natural origin.

ProjNatOriginLatGeoKey

Key ID = 3081
Type = DOUBLE
Units: GeogAngularUnit
Alias: ProjOriginLatGeoKey
Latitude of map-projection Natural origin.

ProjFalseEastingGeoKey

Key ID = 3082
Type = DOUBLE
Units: ProjLinearUnit 

Gives the easting coordinate of the map projection Natural origin.

ProjFalseNorthingGeoKey

Key ID = 3083
Type = DOUBLE
Units: ProjLinearUnit 

Gives the northing coordinate of the map projection Natural origin.

ProjFalseOriginLongGeoKey

Key ID = 3084
Type = DOUBLE
Units: GeogAngularUnit 

Gives the longitude of the False origin.

ProjFalseOriginLatGeoKey

Key ID = 3085
Type = DOUBLE
Units: GeogAngularUnit 

Gives the latitude of the False origin.

ProjFalseOriginEastingGeoKey

Key ID = 3086
Type = DOUBLE
Units: ProjLinearUnit 

Gives the easting coordinate of the false origin. This is NOT the False Easting, which is the easting attached to the Natural origin.

ProjFalseOriginNorthingGeoKey

Key ID = 3087
Type = DOUBLE
Units: ProjLinearUnit 

Gives the northing coordinate of the False origin. This is NOT the False Northing, which is the northing attached to the Natural origin.

ProjCenterLongGeoKey

Key ID = 3088
Type = DOUBLE
Units: GeogAngularUnit 
Longitude of Center of Projection. Note that this is not necessarily the origin of the projection.

ProjCenterLatGeoKey

Key ID = 3089
Type = DOUBLE
Units: GeogAngularUnit
Latitude of Center of Projection. Note that this is not necessarily the origin of the projection.

ProjCenterEastingGeoKey

Key ID = 3090
Type = DOUBLE
Units: ProjLinearUnit 

Gives the easting coordinate of the center. This is NOT the False Easting.

ProjFalseOriginNorthingGeoKey

Key ID = 3091
Type = DOUBLE
Units: ProjLinearUnit 

Gives the northing coordinate of the center. This is NOT the False Northing.

ProjScaleAtNatOriginGeoKey

Key ID = 3092
Type = DOUBLE
Units: none
Alias: ProjScaleAtOriginGeoKey (Rev. 0.2)
Scale at Natural Origin. This is a ratio, so no units are required.

ProjScaleAtCenterGeoKey

Key ID = 3093 
Type = DOUBLE
Units: none
Scale at Center. This is a ratio, so no units are required.

ProjAzimuthAngleGeoKey

Key ID = 3094
Type = DOUBLE
Units: GeogAzimuthUnit
 
Azimuth angle east of true north of the central line passing through the projection center (for elliptical (Hotine) Oblique Mercator). Note that this is the standard method of measuring azimuth, but is opposite the usual mathematical convention of positive indicating counter-clockwise.

ProjStraightVertPoleLongGeoKey

Key ID = 3095 
Type = DOUBLE
Units: GeogAngularUnit 
Longitude at Straight Vertical Pole. For polar stereographic.

GeogAzimuthUnitsGeoKey

Key ID = 2060  
Type = SHORT (code)
Values =   Section 6.3.1.4 Codes 
This key is actually part of the "Geographic CS Parameter Keys" section, but is mentioned here as it is useful for defining units used in the azimuthal projection parameters.

Vertical CS Parameter Keys

Note: Vertical coordinate systems are not yet implemented. These sections are provided for future development, and any vertical coordinate systems in the current revision must be defined using the VerticalCitationGeoKey.

VerticalCSTypeGeoKey

Key ID = 4096  
Type = SHORT (code)
Values =   Section 6.3.4.1  Codes 
This key may be used to specify the vertical coordinate system.

VerticalCitationGeoKey

Key ID = 4097
Type = ASCII
Values =  text 
This key may be used to document the vertical coordinate system used, and its parameters.

VerticalDatumGeoKey

Key ID = 4098   
Type = SHORT (code)
Values =   Section 6.3.4.2  codes
This key may be used to specify the vertical datum for the vertical coordinate system.

VerticalUnitsGeoKey

Key ID = 4099   
Type = SHORT (code)
Values =   Section 6.3.1.3  Codes 
This key may be used to specify the vertical units of measurement used in the geographic coordinate system, in cases where geographic CS's need to reference the vertical coordinate. This, together with the Citation key, comprise the only fully implemented keys in this section, at present.

2.7.3 Cookbook for Geocoding Data

Step 1: Determine the Coordinate system type of the raster data, based on
        the nature of the data: pixels derived from scanners or other 
        optical devices represent areas, and most commonly will use the
        RasterPixelIsArea coordinate system. Pixel data such as digital
        elevation models represent points, and will probably use 
        RasterPixelIsPoint coordinates.
           Store in: GTRasterTypeGeoKey
Step 2: Determine which class of model space coordinates are most natural
        for this dataset:Geographic, Geocentric, or Projected Coordinate 
        System. Usually this will be PCS.
        
           Store in: GTModelTypeGeoKey
           
Step 3: This step depends on the GTModelType:
      case PCS:  Determine the PCS projection system. Most of the
           PCS's used in standard State Plane and national grid systems
           are defined, so check this list first; the EPSG index in 
            section 6.4 may be useful for this purpose.
               
           Store in: ProjectedCSTypeGeoKey, ProjectedCSTypeGeoKey
           If coded, it will not be necessary to specify the Projection 
           datum, etc for this case, since all of those parameters
           are determined by the ProjectedCSTypeGeoKey code. Skip to
           step 4 from here.
               
           If none of the coded PCS's match your system, then this is a
           user-defined PCS. Use the Projection code list to check for
           standard projection systems.
           Store in: ProjectionGeoKey and skip to Geographic CS case.
           If none of the Projection codes match your system, then this
           is a user-defined projection. Use the ProjCoordTransGeoKey to
           specify the coordinate transformation method (e.g. Transverse
           Mercator), and all of the associated parameters of that method.
           Also define the linear units used in the planar coordinate
           system.
           
           Store in: ProjCoordTransGeoKey, ProjLinearUnitsGeoKey  
               <and other CT related parameter keys>
           Now continue on to define the Geographic CS, below.
      case GEOCENTRIC:
      case GEOGRAPHIC:  Check the list of standard GCS's and use the
           corresponding code. To use a code both the Datum, Prime
           Meridian, and angular units must match those of the code.
                
           Store in:  GeographicTypeGeoKey and skip to Step 4.
           If none of the coded GCS's match exactly, then this is a
           user-defined GCS. Check the list of standard datums,
           Prime Meridians, and angular units to define your system.
           Store in: GeogGeodeticDatumGeoKey, GeogAngularUnitsGeoKey,
              GeogPrimeMeridianGeoKey and skip to Step 4. 
  
           If none of the datums match your system, you have a 
           user-defined datum, which is an odd system, indeed. Use 
           the GeogEllipsoidGeoKey to select the appropriate ellipsoid
           or use the GeogSemiMajorAxisGeoKey, GeogInvFlatteningGeoKey to 
           define, and give a reference using the GeogCitationGeoKey.
           Store in: GeogEllipsoidGeoKey, etc. and go to Step 4.
        
Step 4: Install the GeoKeys/codes into the GeoKeyDirectoryTag, and the
      DOUBLE and ASCII key values into the corresponding value-tags.
      
Step 5: Having completely defined the Raster & Model coordinate system,
      go to Cookbook  section 2.6.2 and use the Georeferencing Tags
      to tie the raster image down onto the Model space.