Skip to content

Commit

Permalink
Georeferencer: a fix to support non-ASCII path
Browse files Browse the repository at this point in the history
  • Loading branch information
minorua committed Jun 22, 2013
1 parent f8d6e32 commit 0017807
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
14 changes: 3 additions & 11 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Expand Up @@ -358,7 +358,7 @@ void QgsGeorefPluginGui::generateGDALScript()
{
gdalwarpCommand = generateGDALwarpCommand( resamplingStr, mCompressionMethod, mUseZeroForTrans, order,
mUserResX, mUserResY );
showGDALScript( 2, translateCommand.toAscii().data(), gdalwarpCommand.toAscii().data() );
showGDALScript( QStringList() << translateCommand << gdalwarpCommand );
break;
}
}
Expand Down Expand Up @@ -1761,17 +1761,9 @@ void QgsGeorefPluginGui::updateTransformParamLabel()
}

// Gdal script
void QgsGeorefPluginGui::showGDALScript( int argNum... )
void QgsGeorefPluginGui::showGDALScript( const QStringList& commands )
{
QString script;
va_list vl;
va_start( vl, argNum );
while ( argNum-- )
{
script.append( va_arg( vl, char * ) );
script.append( "\n" );
}
va_end( vl );
QString script = commands.join( "\n" ) + "\n";

// create window to show gdal script
QDialogButtonBox *bbxGdalScript = new QDialogButtonBox( QDialogButtonBox::Cancel, Qt::Horizontal, this );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsgeorefplugingui.h
Expand Up @@ -161,7 +161,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas
void updateTransformParamLabel();

// gdal script
void showGDALScript( int argNum... );
void showGDALScript( const QStringList& commands );
QString generateGDALtranslateCommand( bool generateTFW = true );
/* Generate command-line for gdalwarp based on current GCPs and given parameters.
* For values in the range 1 to 3, the parameter "order" prescribes the degree of the interpolating polynomials to use,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsimagewarper.cpp
Expand Up @@ -86,7 +86,7 @@ bool QgsImageWarper::createDestinationDataset(
char **papszOptions = NULL;
papszOptions = CSLSetNameValue( papszOptions, "COMPRESS", compression.toAscii() );
hDstDS = GDALCreate( driver,
QFile::encodeName( outputName ).constData(), resX, resY,
TO8F( outputName ), resX, resY,
GDALGetRasterCount( hSrcDS ),
GDALGetRasterDataType( GDALGetRasterBand( hSrcDS, 1 ) ),
papszOptions );
Expand Down

0 comments on commit 0017807

Please sign in to comment.