Skip to content

Commit

Permalink
Count and report progress based on expected total
Browse files Browse the repository at this point in the history
Algorithm appears to freeze without progress while `extent_engine.intersects(geom.constGet())` returns false. 

This keeps the progress bar continuous and smooth, even if the feature ends up not being added.

(noticed this because the algo hangs for 2 mins while processing a large dataset which I think is outside the extent somehow. None of the points going in. No apparent progress.)
  • Loading branch information
jfeldstein authored and nyalldawson committed Aug 15, 2018
1 parent 553090b commit 93ee062
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/plugins/processing/algs/qgis/RegularPoints.py
Expand Up @@ -155,8 +155,10 @@ def processAlgorithm(self, parameters, context, feedback):
f.setGeometry(geom)
sink.addFeature(f, QgsFeatureSink.FastInsert)
x += pSpacing
count += 1
feedback.setProgress(int(count * total))

count += 1
feedback.setProgress(int(count * total))

y = y - pSpacing

return {self.OUTPUT: dest_id}

0 comments on commit 93ee062

Please sign in to comment.