Skip to content
Permalink
Browse files

Only pass progress to runalg if it's SilentProgress

Otherwise allow each algorithm to have its own progress
  • Loading branch information
ebrelsford authored and m-kuhn committed Aug 28, 2017
1 parent 3e587bc commit 18706d95ae8c0561fff7ff02ac61bcb136ee4533
Showing with 6 additions and 2 deletions.
  1. +6 −2 python/plugins/processing/algs/qgis/ConcaveHull.py
@@ -27,6 +27,7 @@

from qgis.core import QGis, QgsFeatureRequest, QgsFeature, QgsGeometry
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.SilentProgress import SilentProgress
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterNumber
from processing.core.parameters import ParameterBoolean
@@ -63,11 +64,14 @@ def processAlgorithm(self, progress):
alpha = self.getParameterValue(self.ALPHA)
holes = self.getParameterValue(self.HOLES)
no_multigeom = self.getParameterValue(self.NO_MULTIGEOMETRY)
runalg_kwargs = {}
if isinstance(progress, SilentProgress):
runalg_kwargs['progress'] = progress

# Delaunay triangulation from input point layer
progress.setText(self.tr('Creating Delaunay triangles...'))
delone_triangles = processing.runalg("qgis:delaunaytriangulation",
layer, None, progress=progress)['OUTPUT']
layer, None, **runalg_kwargs)['OUTPUT']
delaunay_layer = processing.getObject(delone_triangles)

# Get max edge length from Delaunay triangles
@@ -104,7 +108,7 @@ def processAlgorithm(self, progress):
# Dissolve all Delaunay triangles
progress.setText(self.tr('Dissolving Delaunay triangles...'))
dissolved = processing.runalg("qgis:dissolve", delaunay_layer,
True, None, None, progress=progress)['OUTPUT']
True, None, None, **runalg_kwargs)['OUTPUT']
dissolved_layer = processing.getObject(dissolved)

# Save result

0 comments on commit 18706d9

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