GetGeoKey Example for Visual Basic
Public RasterIO As LEADRasterIO
Private Sub TestGeoKey()
' This example gets the value set for the GTModelTypeGeoKey key.
' Note that the example can be simpler by not allocating memory because this particular GeoKey has only one SHORT item. But I want to demonstrate how you call L_GetGeoKey twice and get the required size in the first call
Dim nRet As Integer
nRet = RasterIO.GetGeoKey (1024)
If nRet <> 0 Then
MsgBox "The GeoKey was not set, or an error occurred!"
Else
Dim str As String
str = "GeoKey Type = " + CStr(RasterIO.GeoKeyType) + Chr(13) + _
"GeoKey Count = " + CStr(RasterIO.GeoKeyCount)
MsgBox str
End If
End Sub