mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -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
|
total = 100.0 / source.featureCount() if source.featureCount() else 1
|
||||||
for i in range(1, count + 1):
|
for i in range(1, count + 1):
|
||||||
|
if feedback.isCanceled():
|
||||||
|
break
|
||||||
|
|
||||||
idxStart = graph.findVertex(snappedPoints[i])
|
idxStart = graph.findVertex(snappedPoints[i])
|
||||||
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
|
||||||
|
|
||||||
|
@ -238,6 +238,9 @@ class ShortestPathPointToLayer(QgisAlgorithm):
|
|||||||
|
|
||||||
total = 100.0 / source.featureCount() if source.featureCount() else 1
|
total = 100.0 / source.featureCount() if source.featureCount() else 1
|
||||||
for i in range(1, count + 1):
|
for i in range(1, count + 1):
|
||||||
|
if feedback.isCanceled():
|
||||||
|
break
|
||||||
|
|
||||||
idxEnd = graph.findVertex(snappedPoints[i])
|
idxEnd = graph.findVertex(snappedPoints[i])
|
||||||
|
|
||||||
if tree[idxEnd] == -1:
|
if tree[idxEnd] == -1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user