@@ -1620,7 +1620,7 @@ void QgsRasterLayer::drawSingleBandPseudoColor(QPainter * theQPainter,
1620
1620
myQImage.setAlphaBuffer (true );
1621
1621
myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
1622
1622
1623
- // calculate the adjusted matrix stats - which come into affect if the user has chosen
1623
+ // calculate the adjusted matrix stats - which come into effect if the user has chosen
1624
1624
QgsRasterBandStats myAdjustedRasterBandStats = getRasterBandStats (theBandNoInt);
1625
1625
1626
1626
int myRedInt = 0 ;
@@ -2829,7 +2829,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
2829
2829
double myDouble = readValue ( myData, myDataType, iX + iY * myXBlockSize );
2830
2830
2831
2831
if ( fabs (myDouble - noDataValueDouble) < myPrecision ||
2832
- myDouble < GDALminimum )
2832
+ myDouble < GDALminimum || myDouble != myDouble )
2833
2833
{
2834
2834
continue ; // NULL
2835
2835
}
@@ -2854,7 +2854,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
2854
2854
myRasterBandStats.maxValDouble = myDouble;
2855
2855
}
2856
2856
// only increment the running total if it is not a nodata value
2857
- if (myDouble != noDataValueDouble)
2857
+ if (myDouble != noDataValueDouble || myDouble != myDouble )
2858
2858
{
2859
2859
myRasterBandStats.sumDouble += myDouble;
2860
2860
++myRasterBandStats.elementCountInt ;
@@ -2902,7 +2902,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
2902
2902
double myDouble = readValue ( myData, myDataType, iX + iY * myXBlockSize );
2903
2903
2904
2904
if ( fabs (myDouble - noDataValueDouble) < myPrecision ||
2905
- myDouble < GDALminimum )
2905
+ myDouble < GDALminimum || myDouble != myDouble )
2906
2906
{
2907
2907
continue ; // NULL
2908
2908
}
0 commit comments