VECWriteGeoInfo() and VECReadGeoInfo

Demonstrate how to access georeferenced information for a vector layer.

Remarks

This example illustrates how to read and write georeferencing information.

Code

 local int tfid, int layer
 local GeoInfo gi, GeoInfo giout
 local string temp_file

 try
    layer = 28
    temp_file = "./my.pix"
    delete temp_file noerror
    call CopyFile( GetPCIHOME() + "/demo/irvine.pix", \
                 temp_file)

    tfid = DBOpen(temp_file, "r+")
    call VECReadGeoInfo(tfid, layer, gi)

    gi.Units = "PIXEL"

    call VECWriteGeoInfo(tfid, layer, gi)
    call VECReadGeoInfo(tfid, layer, giout)

    print "Map Units:", giout.Units
    print "Upper Left:", giout.ULX, " ", giout.ULY
    print "Lower Right:", giout.LRX, " ", giout.LRY

    call DBClose(tfid)
 onerror
   print "Error: ", GetLastErrorMessage()
 endonerror

Output

Map Units:PIXEL
Upper Left:0 0
Lower Right:1 1

Output

Layer no. 28
Map Units: UTM    11 S E000
Upper Left: 0.0 0.0
Lowe Right: 1.0 1.0
Map Units: PIXEL           
Upper Left: 0.0 0.0
Lowe Right: 1.0 1.0

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.