[gdal-dev] Polynomial warping ?

Maxim Dubinin sim at gis-lab.info
Mon Mar 10 13:07:29 EDT 2008


Nicolas,

I think the problem is the way you address Y-coords in your gcps and
output. Try a simple example with your grid, compare this (notice the
last point):
gdal_translate.exe -of GTiff -gcp 0 0 100 100 -gcp 642 0 200 100 -gcp 642 482 200 0 grid.jpg grid.tif
and this
gdal_translate.exe -of GTiff -gcp 0 0 100 100 -gcp 642 0 200 100 -gcp 642 -482 200 0 grid.jpg grid.tif

You'll see, that (as you can see in your gdalwarp.jpg), your file will be also
mirrored, which means, that it is not correct to address pixel the
same way as ArcGIS does.

As for the polynomial transformation, I modified your gcps, rounded a
little, multiplied your Y-in coord by -1 and added 480 to Y-out coord:

gdal_translate.exe  -of GTiff -gcp 0 0 0 480 -gcp 640 480 640 0 -gcp 0
480  0  0  -gcp  640 220 640 220 -gcp 0 220 0 220 -gcp 340 220 340 220
-gcp  340  480  340  0  -gcp 340 0 340 480 -gcp 640 0 640 700 grid.jpg
grid.tif

gdalwarp.exe -order 2 grid.tif grid-warp.tif

Seems like it did the trick, see attachement.

Maxim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grid-warp.gif
Type: image/gif
Size: 19394 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080310/cbb5c51d/grid-warp-0001.gif


More information about the gdal-dev mailing list