[GIS] Black image using gdalwarp

gdalgdal-translategdalwarp

I am trying to georeference a tif image with the QGIS GUI, and then I load and save the Gdal script. With the QGIS GUI, I managed to get a decent picture, then I exports it in Geotif.

I would like to use the gdal executable store in the qgis file (bin file) for the same operation.
So, I try to do the same operation with a DOS command with gdal_translate and gdalwarp. But it doesn't work. The operation with the DOS command gives me a black image. With the same gdal script, under QGIS, the image is correct. I only make a copy paste under the DOS command. The first part, the gdal_translate seems to work, and I think it is the gdalwarp the problem.

These are my command lines :

gdal_translate -of GTiff -gcp 18.4111 34.3009 *(... a lot of GCP ...)* "S:/image/geotiff/TrueMarble.tif" "C:/Users/userme/AppData/Local/Temp/TrueMarble.tif"
gdalwarp -r cubicspline -order 3 -co COMPRESS=NONE -dstalpha "C:/Users/userme/AppData/Local/Temp/TrueMarble.tif"
 "S:/image/geotiff/Poly3"

Best Answer

Usually I specify -s_srs and -t_srs (source and destination projection system) you can either reference a proj4 name or provide the path to a .prf file, or specify manually your projection parameters.

I suspect this might be the cause of your problem since it doesn't seem you ever defined the reference system of your gcp. The GUI might be doing this for you on the fly.

Also you didn't specify the output resolution with -tr, and while you are at it you could also specify the data type with -ot

Related Question