mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[processing] add cancellation support where possible
This commit is contained in:
parent
5af177e963
commit
95de3a414a
@ -237,6 +237,9 @@ class ShortestPathLayerToPoint(QgisAlgorithm):
|
||||
|
||||
total = 100.0 / source.featureCount() if source.featureCount() else 1
|
||||
for i in range(1, count + 1):
|
||||
if feedback.isCanceled():
|
||||
break
|
||||
|
||||
idxStart = graph.findVertex(snappedPoints[i])
|
||||
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||
|
||||
|
@ -238,6 +238,9 @@ class ShortestPathPointToLayer(QgisAlgorithm):
|
||||
|
||||
total = 100.0 / source.featureCount() if source.featureCount() else 1
|
||||
for i in range(1, count + 1):
|
||||
if feedback.isCanceled():
|
||||
break
|
||||
|
||||
idxEnd = graph.findVertex(snappedPoints[i])
|
||||
|
||||
if tree[idxEnd] == -1:
|
||||
|
Loading…
x
Reference in New Issue
Block a user