Implementing GeoKeys (GeoTIFF tags)

GeoTIFF files are TIFF files containing a few extra TIFF tags describing the image location, scale at which the picture was taken and many other information useful for topographic applications.

The GeoTIFF extra data is stored using 6 standard tags. The following 3 tags contain scaling information:

image\sqrblit.gif ModelTiepointTag = 33922 (0x8482)

image\sqrblit.gif ModelPixelScaleTag = 33550 (0x830E)

image\sqrblit.gif ModelTransformationTag = 33920 (0x8480)

The following 3 tags contain many extra values. We will refer to these values stored in these 3 tags as "GeoKeys":

image\sqrblit.gif GeoKeyDirectoryTag 34375 (0x87AF); This tag will store all the keys and the SHORT values.

image\sqrblit.gif GeoDoubleParamsTag 34736 (0x87B0); This tag will store the DOUBLE values.

image\sqrblit.gif GeoAsciiParamsTag 34737 (0x87B1); This tag will store the ASCII values.

There are 65536 possible GeoKeys values. The GeoTIFF specification recommends you use the following ranges (domains) for the GeoTIFF data:

0..1023

Do not use; reserved for future use

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 – use to store your own data

For more information on the GeoTIFF tags and for the complete list of the predefined GeoKeys values; refer to the GeoTIFF specifications found on http://home.earthlink.net/~ritter/geotiff/geotiff.html or http://www.remotesensing.org/geotiff/geotiff.html URLs.

GeoTIFF files also support standard TIFF comments and tags. For more information on standard TIFF tags and comments, refer to Implementing TIFF Comments and Tags.

The GeoKeys can be set in preparation for writing or saving files with L_SetGeoKey. These GeoKeys are maintained as a per-thread array of GeoKeys. You can obtain the list of GeoKeys that have been set using L_GetGeoKey.

The user can write the GeoKeys in two ways:

1.

When saving a new image as FILE_GEOTIFF with one of the save functions: L_SaveFile, L_SaveBitmap, etc.

2.

You can update an existing file, using L_WriteFileGeoKey or L_WriteFileMetaData.

You can enumerate the GeoKeys from an existing file using L_EnumFileGeoKeys. For each GeoKeys enumerated by L_EnumFileGeoKeys, an ENUMGEOKEYSCALLBACK function is called.

You can read a particular GeoKey from a file using L_ReadFileGeoKey.