Skip to content

Commit

Permalink
[raster calculator] use feedback when reprojecting raster block
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 9, 2018
1 parent e27847d commit 5fa5b86
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/analysis/raster/qgsrastercalculator.cpp
Expand Up @@ -88,7 +88,16 @@ int QgsRasterCalculator::processCalculation( QgsFeedback *feedback )
proj.setInput( it->raster->dataProvider() ); proj.setInput( it->raster->dataProvider() );
proj.setPrecision( QgsRasterProjector::Exact ); proj.setPrecision( QgsRasterProjector::Exact );


block = proj.block( it->bandNumber, mOutputRectangle, mNumOutputColumns, mNumOutputRows ); QgsRasterBlockFeedback *rasterBlockFeedback = new QgsRasterBlockFeedback();
QObject::connect( feedback, &QgsFeedback::canceled, rasterBlockFeedback, &QgsRasterBlockFeedback::cancel );
block = proj.block( it->bandNumber, mOutputRectangle, mNumOutputColumns, mNumOutputRows, rasterBlockFeedback );
if ( rasterBlockFeedback->isCanceled() )
{
delete block;
delete calcNode;
qDeleteAll( inputBlocks );
return static_cast< int >( Canceled );
}
} }
else else
{ {
Expand Down

0 comments on commit 5fa5b86

Please sign in to comment.