Skip to content

Commit

Permalink
Merge pull request #31898 from alexbruy/fix-31353
Browse files Browse the repository at this point in the history
[georeferencer] set target CRS when generating GDAL script (fix #31353)
  • Loading branch information
alexbruy committed Sep 20, 2019
2 parents 240bfb2 + 21a73ae commit e3a7982
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Expand Up @@ -1897,6 +1897,15 @@ QString QgsGeorefPluginGui::generateGDALwarpCommand( const QString &resampling,
gdalCommand << QStringLiteral( "-tr" ) << QString::number( targetResX, 'f' ) << QString::number( targetResY, 'f' );
}

if ( mProjection.authid().startsWith( QStringLiteral( "EPSG:" ), Qt::CaseInsensitive ) )
{
gdalCommand << QStringLiteral( "-t_srs %1" ).arg( mProjection.authid() );
}
else
{
gdalCommand << QStringLiteral( "-t_srs \"%1\"" ).arg( mProjection.toProj4().simplified() );
}

gdalCommand << QStringLiteral( "\"%1\"" ).arg( mTranslatedRasterFileName ) << QStringLiteral( "\"%1\"" ).arg( mModifiedRasterFileName );

return gdalCommand.join( QStringLiteral( " " ) );
Expand Down

0 comments on commit e3a7982

Please sign in to comment.