You have the right idea in your answer, but let me expand. You're right, you need to use the gdal_translate tool to set ground control points (gcps) to snap the image. But the command line argument should look like this:
gdal_translate -of GTiff -a_srs EPSG:4326 -gcp [pixel line easting northing] -gcp [pixel line easting northing] -gcp [pixel line easting northing] sourcefile outpulfile
You do not need to output to VRT, VRT are useful if you want to execute other algorithms in your file, add more data sets to it, ultimately display them as KML - among others that you can read here ( http: //www.gdal .org / gdal_vrttut.html ). But for this, setting -of in GTiff is ideal.
-a_srs EPSG:4326
Further, in the spatial reference you are right, the WGS84 coordinate system used by Google Earth should refer to it, however we indicate it using EPSG:4326 - this is only the coding scheme agreed by the Committee on Geomatics to determine the coordinates of systems around the world ( http: / /www.epsg.org/ ).
-gcp [pixel line easting northing]
Ground control points are probably the most difficult part of the command line argument. The first 2 numbers represent the pixel and line coordinates of your actual image, for example (0,0) for the upper left corner of your image. The second set of numbers to follow is the corresponding lat / long coordinates that your image should reference. Now you only need 3 of these -gcps , because the fourth will be determined if your image is a square / rectangle.
sourcefile outpulfile
This part should be clear, just remember that they are both * .tif files.
Now, if you need the last thing you need to do to complete your task. You will need to project the image into the coordinate system to align it. This happens with the gdalwarp ( http://www.gdal.org/gdalwarp.html ).
gdalwarp -t_srs EPSG:4326 sourcefile outputfile
You need to specify -of (output fileformat) if it was intended for something other than GeoTiff, but the default format is GTiff, so you don't need to specify it.
Suvi vignarajah
source share