Skip to content

Commit

Permalink
Use new QgsRasterCalculator ctor with transform context
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Apr 17, 2019
1 parent 8bdfc7c commit cd9fe8c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -5799,7 +5799,15 @@ void QgisApp::showRasterCalculator()
if ( d.exec() == QDialog::Accepted )
{
//invoke analysis library
QgsRasterCalculator rc( d.formulaString(), d.outputFile(), d.outputFormat(), d.outputRectangle(), d.outputCrs(), d.numberOfColumns(), d.numberOfRows(), QgsRasterCalculatorEntry::rasterEntries() );
QgsRasterCalculator rc( d.formulaString(),
d.outputFile(),
d.outputFormat(),
d.outputRectangle(),
d.outputCrs(),
d.numberOfColumns(),
d.numberOfRows(),
QgsRasterCalculatorEntry::rasterEntries(),
QgsProject::instance()->transformContext() );

QProgressDialog p( tr( "Calculating raster expression…" ), tr( "Abort" ), 0, 0 );
p.setWindowModality( Qt::WindowModal );
Expand Down Expand Up @@ -7546,7 +7554,7 @@ QString QgisApp::saveAsRasterFile( QgsRasterLayer *rasterLayer, const bool defau
if ( d.outputCrs() != rasterLayer->crs() )
{
QgsRasterProjector *projector = new QgsRasterProjector;
projector->setCrs( rasterLayer->crs(), d.outputCrs(), rasterLayer->dataProvider()->transformContext() );
projector->setCrs( rasterLayer->crs(), d.outputCrs(), QgsProject::instance()->transformContext() );
if ( !pipe->insert( 2, projector ) )
{
QgsDebugMsg( QStringLiteral( "Cannot set pipe projector" ) );
Expand Down

0 comments on commit cd9fe8c

Please sign in to comment.