Skip to content

Commit

Permalink
skip NaN values when calculating zonal statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Aug 7, 2013
1 parent 66b184a commit 39f2898
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/analysis/vector/qgszonalstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ void QgsZonalStatistics::statisticsFromMiddlePointTest( void* band, QgsGeometry*
{
if ( GEOSPreparedContains( polyGeosPrepared, currentCellCenter ) )
{
sum += scanLine[j];
if ( !qIsNaN( scanLine[j] ) )
{
sum += scanLine[j];
}
++count;
}
}
Expand Down

0 comments on commit 39f2898

Please sign in to comment.