Skip to content

Commit 085d0ad

Browse files
committedApr 20, 2015
Fix zonal stats not saving values to spatialite layers (fix #11849)
1 parent 5e41c43 commit 085d0ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/analysis/vector/qgszonalstatistics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
246246
FeatureStats featureStats( statsStoreValues, statsStoreValueCount );
247247
int featureCounter = 0;
248248

249+
QgsChangedAttributesMap changeMap;
249250
while ( fi.nextFeature( f ) )
250251
{
251252
if ( p )
@@ -300,7 +301,6 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
300301
}
301302

302303
//write the statistics value to the vector data provider
303-
QgsChangedAttributesMap changeMap;
304304
QgsAttributeMap changeAttributeMap;
305305
if ( mStatistics & QgsZonalStatistics::Count )
306306
changeAttributeMap.insert( countIndex, QVariant( featureStats.count ) );
@@ -364,11 +364,11 @@ int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
364364
}
365365

366366
changeMap.insert( f.id(), changeAttributeMap );
367-
vectorProvider->changeAttributeValues( changeMap );
368-
369367
++featureCounter;
370368
}
371369

370+
vectorProvider->changeAttributeValues( changeMap );
371+
372372
if ( p )
373373
{
374374
p->setValue( featureCount );

0 commit comments

Comments
 (0)
Please sign in to comment.