[QGIS Commit] r12966 - trunk/qgis/src/plugins/georeferencer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Feb 23 10:29:25 EST 2010


Author: mmassing
Date: 2010-02-23 10:29:24 -0500 (Tue, 23 Feb 2010)
New Revision: 12966

Modified:
   trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp
Log:
Georeferencer: Fix a bug in GDAL script generation.

Modified: trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp
===================================================================
--- trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp	2010-02-23 15:17:48 UTC (rev 12965)
+++ trunk/qgis/src/plugins/georeferencer/qgsgeorefplugingui.cpp	2010-02-23 15:29:24 UTC (rev 12966)
@@ -297,17 +297,24 @@
   if (QgsGeorefTransform::Linear != mTransformParam
       && QgsGeorefTransform::Helmert != mTransformParam)
   {
+    // CAVEAT: gdalwarpCommand*() rely on some member variables being set
+    // by gdal_translateCommand(), so this method must be called before
+    // gdalwarpCommand*()!
+    QString translateCommand = gdal_translateCommand();
     QString gdalwarpCommand;
     QString resamplingStr = convertResamplingEnumToString(mResamplingMethod);
     if (QgsGeorefTransform::ThinPlateSpline == mTransformParam)
+    {
       gdalwarpCommand = gdalwarpCommandTPS(resamplingStr, mCompressionMethod, mUseZeroForTrans, 
                                            mUserResX, mUserResY);
+    }
     else
+    {
       gdalwarpCommand = gdalwarpCommandGCP(resamplingStr, mCompressionMethod, mUseZeroForTrans,
                                            polynomeOrder(mTransformParam),
                                            mUserResX, mUserResY);
-
-    showGDALScript(2, gdal_translateCommand().toAscii().data(), gdalwarpCommand.toAscii().data());
+    }
+    showGDALScript(2, translateCommand.toAscii().data(), gdalwarpCommand.toAscii().data());
   }
   else
   {



More information about the QGIS-commit mailing list