Skip to content

Commit

Permalink
[processing] evaluate dynamic parameters before processing feature
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Mar 2, 2018
1 parent 5daa8fd commit 669beac
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/analysis/processing/qgsalgorithmmultiringbuffer.cpp
Expand Up @@ -106,12 +106,20 @@ QgsFeatureList QgsMultiRingBufferAlgorithm::processFeature( const QgsFeature &fe
double currentDistance = 0;
QgsGeometry outputGeometry, previousGeometry;

int rings = mRingsNumber;
if ( mDynamicRingsNumber )
rings = mRingsNumberProperty.valueAsInt( context.expressionContext(), rings );

double distance = mDistance;
if ( mDynamicDistance )
distance = mDistanceProperty.valueAsDouble( context.expressionContext(), distance );

QgsFeatureList outputs;

for ( int i = 1; i <= mRingsNumber; ++i )
{
QgsFeature out;
currentDistance = i * mDistance;
currentDistance = i * distance;
outputGeometry = feature.geometry().buffer( currentDistance, 40 );
if ( !outputGeometry )
{
Expand Down

0 comments on commit 669beac

Please sign in to comment.