[QGIS Commit] r15598 - trunk/qgis/src/analysis/vector

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Mar 25 11:59:17 EDT 2011


Author: mhugent
Date: 2011-03-25 08:59:17 -0700 (Fri, 25 Mar 2011)
New Revision: 15598

Modified:
   trunk/qgis/src/analysis/vector/qgszonalstatistics.cpp
Log:
Fix for zonal statistics: continue if attributes are already there

Modified: trunk/qgis/src/analysis/vector/qgszonalstatistics.cpp
===================================================================
--- trunk/qgis/src/analysis/vector/qgszonalstatistics.cpp	2011-03-25 08:56:38 UTC (rev 15597)
+++ trunk/qgis/src/analysis/vector/qgszonalstatistics.cpp	2011-03-25 15:59:17 UTC (rev 15598)
@@ -115,10 +115,7 @@
   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 @@
 
   //iterate over each polygon
   vectorProvider->select( QgsAttributeList(), QgsRectangle(), true, false );
-  vectorProvider->rewind();
   QgsFeature f;
   double count = 0;
   double sum = 0;



More information about the QGIS-commit mailing list