Skip to content
Permalink
Browse files

No extra conversion for qmap iteration

  • Loading branch information
m-kuhn committed Sep 10, 2020
1 parent 0048592 commit 8f7abb562f15a3971d276f78e3fef06fdf29fbef
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/analysis/processing/qgsalgorithmzonalstatisticsfeaturebased.cpp
@@ -164,9 +164,9 @@ QgsFeatureList QgsZonalStatisticsFeatureBasedAlgorithm::processFeature( const Qg
attributes.resize( mOutputFields.size() );

QMap<QgsZonalStatistics::Statistic, QVariant> results = QgsZonalStatistics::calculateStatistics( mRaster.get(), feature.geometry(), mPixelSizeX, mPixelSizeY, mBand, mStats );
for ( const auto &result : results.toStdMap() )
for ( auto result = results.constBegin(); result != results.constEnd(); ++result )
{
attributes.replace( mStatFieldsMapping.value( result.first ), result.second );
attributes.replace( mStatFieldsMapping.value( result.key() ), result.value() );
}

QgsFeature resultFeature = feature;

0 comments on commit 8f7abb5

Please sign in to comment.
You can’t perform that action at this time.