Skip to content

Commit

Permalink
Small optimisation for zstats so that we dont do more expensive geoem…
Browse files Browse the repository at this point in the history
…try operation when we know that cell value is null already.
  • Loading branch information
timlinux committed Jul 26, 2013
1 parent 3c5980c commit 282ef29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/analysis/vector/qgszonalstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 282ef29

Please sign in to comment.