Skip to content
Permalink
Browse files
Small optimisation for zstats so that we dont do more expensive geoem…
…try operation when we know that cell value is null already.
  • Loading branch information
timlinux committed Jul 26, 2013
1 parent 3c5980c commit 282ef29741c93010de24fa7559636b14c8fc5c16
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/analysis/vector/qgszonalstatistics.cpp
@@ -306,9 +306,9 @@ void QgsZonalStatistics::statisticsFromMiddlePointTest( void* band, QgsGeometry*
GEOSCoordSeq_setY( cellCenterCoords, 0, cellCenterY );
currentCellCenter = GEOSGeom_createPoint( cellCenterCoords );

if ( GEOSPreparedContains( polyGeosPrepared, currentCellCenter ) )
if ( scanLine[j] != mInputNodataValue ) //don't consider nodata values
{
if ( scanLine[j] != mInputNodataValue ) //don't consider nodata values
if ( GEOSPreparedContains( polyGeosPrepared, currentCellCenter ) )
{
sum += scanLine[j];
++count;

0 comments on commit 282ef29

Please sign in to comment.