Skip to content
Permalink
Browse files

[FIX #7533] Field calculator is slow

Set the QgsDistanceArea only once and not for every loop cycle.
QgsCoordinateReferenceSystem::loadFromDb takes very long.
  • Loading branch information
m-kuhn committed Apr 8, 2013
1 parent 082c6ba commit a21fc5a73d9256e29aab41621e18c723d31bff07
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/app/qgsfieldcalculator.cpp
@@ -94,6 +94,7 @@ void QgsFieldCalculator::accept()

QString calcString = builder->expressionText();
QgsExpression exp( calcString );
exp.setGeomCalculator( myDa );

if ( !mVectorLayer || !mVectorLayer->isEditable() )
return;
@@ -173,8 +174,6 @@ void QgsFieldCalculator::accept()
}

exp.setCurrentRowNumber( rownum );
exp.setGeomCalculator( myDa );

QVariant value = exp.evaluate( &feature );
if ( exp.hasEvalError() )
{

0 comments on commit a21fc5a

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