Skip to content
Permalink
Browse files
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/qgis@5999 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Oct 23, 2006
1 parent 485ab82 commit c7950bcd5b4f77ff03abc5235fbaf6e4bfff8f44
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/raster/qgsrasterlayer.cpp
@@ -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
}

0 comments on commit c7950bc

Please sign in to comment.