Skip to content
Permalink
Browse files
skip NaN values when calculating zonal statistics
  • Loading branch information
alexbruy committed Aug 7, 2013
1 parent 66b184a commit 39f289816ee532d8514a1bfdc26451d07d34da0a
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/analysis/vector/qgszonalstatistics.cpp
@@ -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;
}
}

0 comments on commit 39f2898

Please sign in to comment.