Reproject

Demonstrates how to translate one or more points between two projections defined via GeoInfo.

Remarks

This example shows how to fetch the projection and bounds of the input database, and transform it into Lat/Long. Note that the ellipse/datum code is carefully copied from the input projection to the constructed output projection. Because Reproject() does not use the bounds stored in the GeoInfo, we don't have to set anything meaningful in the ULX, ULY, LRX and LRY fields of geo_out.

Code

 local double plist[4]
 local GeoInfo geo_in
 local GeoInfo geo_out
 local integer tfid

 tfid = DBOpen( GetPCIHOME() + "/demo/irvine.pix", "r" )
 call DBReadGeoInfo( tfid, geo_in )
 call DBClose( tfid )

 geo_out.Units = "LONG " + f$extract(geo_in.Units, 12, 4 )

 plist[1] = geo_in.ULX
 plist[2] = geo_in.ULY
 plist[3] = geo_in.LRX
 plist[4] = geo_in.LRY

 if( Reproject(geo_in, geo_out, 2, plist ) != 1.0 )then
   print "Failed to reproject database points to lat/long."
 else
   print "Upper Left  = ", plist[1], ",", plist[2]
   print "Lower Right = ", plist[3], ",", plist[4]
 endif

Output

 Upper Left  = -117.769582129185, 33.7490136746495 
 Lower Right = -117.602787857898, 33.6114018901516

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