Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for zonal statistics: continue if attributes are already there
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15598 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 25, 2011
1 parent 19a18f9 commit 60d4ba6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/analysis/vector/qgszonalstatistics.cpp
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 60d4ba6

Please sign in to comment.