Skip to content

Commit 2af331c

Browse files
author
mmassing
committed
Georeferencer: Fix a bug in GDAL script generation.
git-svn-id: http://svn.osgeo.org/qgis/trunk@12966 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b7a47ca commit 2af331c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/plugins/georeferencer/qgsgeorefplugingui.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,24 @@ void QgsGeorefPluginGui::generateGDALScript()
297297
if (QgsGeorefTransform::Linear != mTransformParam
298298
&& QgsGeorefTransform::Helmert != mTransformParam)
299299
{
300+
// CAVEAT: gdalwarpCommand*() rely on some member variables being set
301+
// by gdal_translateCommand(), so this method must be called before
302+
// gdalwarpCommand*()!
303+
QString translateCommand = gdal_translateCommand();
300304
QString gdalwarpCommand;
301305
QString resamplingStr = convertResamplingEnumToString(mResamplingMethod);
302306
if (QgsGeorefTransform::ThinPlateSpline == mTransformParam)
307+
{
303308
gdalwarpCommand = gdalwarpCommandTPS(resamplingStr, mCompressionMethod, mUseZeroForTrans,
304309
mUserResX, mUserResY);
310+
}
305311
else
312+
{
306313
gdalwarpCommand = gdalwarpCommandGCP(resamplingStr, mCompressionMethod, mUseZeroForTrans,
307314
polynomeOrder(mTransformParam),
308315
mUserResX, mUserResY);
309-
310-
showGDALScript(2, gdal_translateCommand().toAscii().data(), gdalwarpCommand.toAscii().data());
316+
}
317+
showGDALScript(2, translateCommand.toAscii().data(), gdalwarpCommand.toAscii().data());
311318
}
312319
else
313320
{

0 commit comments

Comments
 (0)