SetGeoKey method (ILEADRasterIO)

Visual Basic example

Visual C++ 6.0 example

 

Syntax

short SetGeoKey(long uTag);

Overview

Refer to Implementing GeoKeys (GeoTIFF tags)

Remarks

Sets the GeoKey information to be saved in a file.

This method copies the data in the GeoKeyData property into an internal list of buffers maintained by RasterIO.

Any GeoTIFF file that you save will include the GeoKey information set until you clear the GeoKey information. To save this information to a file, save FILE_GEOTIFF files.

To clear a particular GeoKey, set the values of the GeoKeyType and GeoKeyCount properties to 0.

To clear all the GeoKeys, set the values of the GeoKeyType and GeoKeyCount properties to 0 and pass 0 to the uTag parameter of this method.

The information set will be saved in the files into three TIFF tags:

image\sqrblit.gif GeoKeyDirectoryTag: 34735 (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.

SetGeoKey will overwrite any values saved for these tags previously using the SetTag method.

You can get the last value set with SetGeoKey using the GetGeoKey method.

To write the GeoKey information directly to an existing file, call the WriteFileGeoKey method.

Note that LEADTOOLS does not verify the validity of the GeoKeys that you set. It is your responsibility to make sure you write correct values according to the GeoTIFF specification.

This method sets the GeoKeys using the values of the following properties:

GeoKeyType property

GeoKeyCount property

GeoKeyData property

To get the current values for the above properties, call the GetGeoKey method.

When setting the GeoKey information prior to calling the SetGeoKey method, set the GeoKeyCount property, to determine the number of items in the GeoKeyData property, then set the new information in the GeoKeyData property, and then call the SetGeoKey method.

See Also

Elements:

GetGeoKey method, GeoKeyType property, GeoKeyCount property, GeoKeyData property, WriteFileGeoKey method, ReadFileGeoKey method, EnumFileGeoKeys method, EnumGeoKeys event

Topics:

Raster Images: Working with Geo Keys

 

Implementing TIFF Tags