Skip to content

Commit

Permalink
Fix for zonal statistics: continue if attributes are already there
Browse files Browse the repository at this point in the history
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 096d0f9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/analysis/vector/qgszonalstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand All @@ -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;
Expand Down

0 comments on commit 096d0f9

Please sign in to comment.