[gdal-dev] convert .tif/.tfwx/.aux.xml to a geotiff?

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Sat Jun 16 13:05:20 PDT 2012


Martin Ouellet <geomartino <at> gmail.com> writes:

> 
> 
> Thanks Florent,
> 
> Can you provide me a simple example on how to set coordinates of an image with
gdal_translate?

This is setting 4 ground control points to corner pixels of a 10000 by 10000
pixel image. If you want to be accurate, remember that the anchor point is in
the upper left corner of the pixel

gdal_translate t202112.jp2 t202112_gcp.tif 
-gcp 0 0285113.632 6713217.584 
-gcp 9999 0 284658.101 6703227.690
-gcp 0 9999 295103.322 6712761.873 
-gcp 9999 9999 294647.828 6702772.378

Then you can warp the intermediate image with gdalwarp. The following has some
parameters tuned for orthophotos (cubic resampling) and for controlling the
output pixel size to exactly one metre.

gdalwarp -rc -dstnodata "0 0 0" -s_srs EPSG:3067 -t_srs EPSG:3067
-tr 1.0 1.0 t202112_gcp.tif t202112_TM35FIN.tif

The intermediate file containing ground control points can also be a .vrt file.
QGis georeferencer plugin gives a GUI for this procedure.

-Jukka Rahkonen-



More information about the gdal-dev mailing list