Friday, 3 March 2017

Generating a GDAL script through the QGIS Georeferencer


For several months, I have been georeferencing files manually using the Georeferencer plugin within QGIS. I am now attempting to automate this process using GDAL. The Georeferencer provides a "Generate GDAL script" option, which creates the following commands:


gdal_translate -of GTiff -gcp 774.73 -338 -88.52 34.37 -gcp 1012.17 -215.136 -81.22 27.48 -gcp 972.709 -486.055 -77.76 36.67 asciiMAE20121001.asc testoutput1
gdalwarp -r near -order 1 -co COMPRESS=NONE testoutput1 testoutput2


When I run this script, however, the georeferenced raster is placed about 40 degrees further west than where it should be, and 7 degrees further south. Manually using the Georeferencer plugin continues to georeference the raster correctly. I think the problem is with the gdalwarp, because the raster is just shifted too far from where it should be. The placement of the values within it appears to be correct, so it looks like the gdal_translate worked correctly.


Does anyone know why the GDAL script produced by the Georeferencer would produce a raster displaced from the raster produced manually by the plugin?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...