I have an input jpg image (sat thumbnail) and I know a number of gcps for this image. I want to reproject the jpg to have a north up image. This is what I do:
./gdal_translate -of GTiff -a_srs EPSG:4326 -gcp pixel line lon lat -gcp pixel line lon lat ... etc... myinputfile.jpg temp.gtif
./gdalwarp -t_srs EPSG:4326 -r near temp.gtif myoutputfile.tif
The result is "almost" correct, although I do get some strangest behaviours sometime, eg the image folds on itself, etc... very artistic but not good for a GIS application! If anybody can see anything wrong with the way I proceed or has a better idea, please advise!
Edit
Alright, it is working now. I believe the "weird" results were down to the fact I used a temporary file that was not deleted between gdal calls. As soon as I had the temp file removed (rm temp.gtif) between calls the results were fully normal.
gdalwarp
page says: Mosaicing into an existing output file is supported if the output file already exists. The spatial extent of the existing file will not be modified to accomodate new data, so you may have to remove it in that case, or use the -overwrite option.