Skip to content

Commit 60d4ba6

Browse files
author
mhugent
committed
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
1 parent 19a18f9 commit 60d4ba6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/analysis/vector/qgszonalstatistics.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
115115
newFieldList.push_back( countField );
116116
newFieldList.push_back( sumField );
117117
newFieldList.push_back( meanField );
118-
if ( !vectorProvider->addAttributes( newFieldList ) )
119-
{
120-
return 7;
121-
}
118+
vectorProvider->addAttributes( newFieldList );
122119

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

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

0 commit comments

Comments
 (0)