Skip to content

Commit

Permalink
Merge pull request #581 from minorua/georef_nonascii
Browse files Browse the repository at this point in the history
Georeferencer: a fix to support non-ASCII path
  • Loading branch information
jef-n committed Jul 12, 2013
2 parents 2df4bdc + 0017807 commit a87f4d1
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 a87f4d1

Please sign in to comment.