GCPPolyTransform

Demonstrates how to apply a polynomial transformation on a set of coordinates using a set of known GCPs.

Remarks

This example transforms 3 points form long/lat coordinates to pixel/line coordinates.

Code

 local double StartGCPs[10], double EndGCPs[10], double Points[6]
 local int Success, i

 StartGCPs[1] = 430915.0
 StartGCPs[2] = 3731875.0
 StartGCPs[3] = 432995.0
 StartGCPs[4] = 3730885.0
 StartGCPs[5] = 440175.0
 StartGCPs[6] = 3730845.0
 StartGCPs[7] = 438175.0
 StartGCPs[8] = 3730915.0
 StartGCPs[9] = 431695.0
 StartGCPs[10] = 3728745.0

 EndGCPs[1] = 76.5     
 EndGCPs[2] = 90.5     
 EndGCPs[3] = 140.5    
 EndGCPs[4] = 117.5    
 EndGCPs[5] = 380.5    
 EndGCPs[6] = 118.5    
 EndGCPs[7] = 312.5    
 EndGCPs[8] = 116.5    
 EndGCPs[9] = 99.5       
 EndGCPs[10] = 187.5   

 Points[1] = 433130.0
 Points[2] = 3729810.0
 Points[3] = 437120.0
 Points[4] = 3724680.0
 Points[5] = 438740.0
 Points[6] = 3729450.0

 Success = GCPPolyTransform( 2, 5, StartGCPs, EndGCPs, 3, Points )

 if( Success = 1) then
       for i = 1 to 5
          if ( MOD(i, 2) = 1 ) then
               print points[i], " ", Points[i+1]
          endif
       endfor
 else
       print "FAILED!"   
 endif

Output

146.720879 153.1149262
275.0515772 312.059838
331.196389 162.207721

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