Skip to content

Commit

Permalink
No extra conversion for qmap iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 10, 2020
1 parent 0048592 commit 8f7abb5
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -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;
Expand Down

0 comments on commit 8f7abb5

Please sign in to comment.