Skip to content
Permalink
Browse files

[raster] skip non finite values when computing band min/max statistics

  • Loading branch information
nirvn committed Mar 16, 2018
1 parent 975117a commit 10044fb1ddef990a1f4f7f4dddb20762077525ae
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/raster/qgsrasterinterface.cpp
@@ -188,10 +188,11 @@ QgsRasterBandStats QgsRasterInterface::bandStatistics( int bandNo,
if ( blk->isNoData( i ) ) continue; // NULL

double myValue = blk->value( i );

myRasterBandStats.sum += myValue;
myRasterBandStats.elementCount++;

if ( !std::isfinite( myValue ) ) continue; // inf

if ( myFirstIterationFlag )
{
myFirstIterationFlag = false;

0 comments on commit 10044fb

Please sign in to comment.
You can’t perform that action at this time.