Skip to content
Permalink
Browse files
Fix for zonal statistics: continue if attributes are already there
git-svn-id: http://svn.osgeo.org/qgis/trunk@15598 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 25, 2011
1 parent e5722a9 commit 096d0f9f1360a3b4e04b68eaf08a3a92b1770f09
Showing with 1 addition and 5 deletions.
  1. +1 −5 src/analysis/vector/qgszonalstatistics.cpp
@@ -115,10 +115,7 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
newFieldList.push_back( countField );
newFieldList.push_back( sumField );
newFieldList.push_back( meanField );
if ( !vectorProvider->addAttributes( newFieldList ) )
{
return 7;
}
vectorProvider->addAttributes( newFieldList );

//index of the new fields
int countIndex = vectorProvider->fieldNameIndex( mAttributePrefix + "count" );
@@ -140,7 +137,6 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )

//iterate over each polygon
vectorProvider->select( QgsAttributeList(), QgsRectangle(), true, false );
vectorProvider->rewind();
QgsFeature f;
double count = 0;
double sum = 0;

0 comments on commit 096d0f9

Please sign in to comment.