Fix for ticket #303 (tiffs with nulls display incorrectly). Just a few

missing checkes for NaN's.


git-svn-id: http://svn.osgeo.org/qgis/trunk@5999 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
g_j_m 2006-10-23 08:29:21 +00:00
parent e260cc13c3
commit e81f632044

View File

@ -1620,7 +1620,7 @@ void QgsRasterLayer::drawSingleBandPseudoColor(QPainter * theQPainter,
myQImage.setAlphaBuffer(true);
myQImage.fill(qRgba(255,255,255,0 )); // fill transparent
//calculate the adjusted matrix stats - which come into affect if the user has chosen
//calculate the adjusted matrix stats - which come into effect if the user has chosen
QgsRasterBandStats myAdjustedRasterBandStats = getRasterBandStats(theBandNoInt);
int myRedInt = 0;
@ -2829,7 +2829,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
double myDouble = readValue ( myData, myDataType, iX + iY * myXBlockSize );
if ( fabs(myDouble - noDataValueDouble) < myPrecision ||
myDouble < GDALminimum )
myDouble < GDALminimum || myDouble != myDouble)
{
continue; // NULL
}
@ -2854,7 +2854,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
myRasterBandStats.maxValDouble = myDouble;
}
//only increment the running total if it is not a nodata value
if (myDouble != noDataValueDouble)
if (myDouble != noDataValueDouble || myDouble != myDouble)
{
myRasterBandStats.sumDouble += myDouble;
++myRasterBandStats.elementCountInt;
@ -2902,7 +2902,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
double myDouble = readValue ( myData, myDataType, iX + iY * myXBlockSize );
if ( fabs(myDouble - noDataValueDouble) < myPrecision ||
myDouble < GDALminimum )
myDouble < GDALminimum || myDouble != myDouble)
{
continue; // NULL
}