I have a tiff image and I would like to georeference it, and so create a Geotiff. To do that, I have to use GDAL. I use in particular, the executable store in the QGIS file (gdalwarp.exe, gdaltranslate.exe…).
For now, I use this code in a DOS command (command line), and this doesn't seem to work.
gdal_translate -of GTiff -gcp 33.9983 669.668 -833589 -692.339 -gcp 124.661 1377.97 -833520 -1379.2 -gcp 6788.34 -10.2993 -826876 6.06375 -gcp 6839.33 748.997 -826813 -755.83 -gcp 3014.52 363.682 -830651 -363.339 -gcp 3892.81 1032.32 -829762 -1021.34 "D:/Users/(...)/Desktop/image_projetee_UTM.tiff" "C:/Users/(...)/AppData/Local/Temp/image_projetee_UTM.tiff"
gdalwarp -r near -order 1 -co COMPRESS=NONE -dstalpha "C:/Users/(...)/AppData/Local/Temp/image_projetee_UTM.tiff" "D:/Users/(...)/Desktop/image_projetee_UTM_georef.tif"
1 – After run this code, the output image is not a GTiff but a Tiff like the input image.
2 – If I try to open the output image in Google Earth for example, it doesn't seems at all georeferenced
I think I missed something in the way to georeferenced a Tiff file…
Can anyone help me ?
Best Answer
So, I succeed to georeference a tif file with GDAL with the use of 4 gcps (ground control points). To do this reprojection, I use gdal in command line.
First, use gdal translate like this :
The ground control points are build like this : pixel coordinate in the image (x, y) and then geographical location (longitude, latitude).
I suggest to check with gdalinfo if the output file after gdaltranslate has been correctly fed with the gcps. With gdalinfo, you have to see in dos command something like that :
At this point, the image is not georeferenced yet. You have to use gdalwarp like this (there is several way to reproject, here I use "near" :