Skip to content

Commit 1d6e303

Browse files
committed
Use correct SRS when building graph
1 parent 6898342 commit 1d6e303

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

python/plugins/processing/algs/qgis/ServiceAreaFromLayer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def processAlgorithm(self, parameters, context, feedback):
209209
multiplier * 1000.0 / 3600.0)
210210

211211
director.addStrategy(strategy)
212-
builder = QgsGraphBuilder(context.project().crs(),
212+
builder = QgsGraphBuilder(network.sourceCrs(),
213213
True,
214214
tolerance)
215215

python/plugins/processing/algs/qgis/ServiceAreaFromPoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def processAlgorithm(self, parameters, context, feedback):
200200
multiplier * 1000.0 / 3600.0)
201201

202202
director.addStrategy(strategy)
203-
builder = QgsGraphBuilder(context.project().crs(),
203+
builder = QgsGraphBuilder(network.sourceCrs(),
204204
True,
205205
tolerance)
206206
feedback.pushInfo(self.tr('Building graph...'))

python/plugins/processing/algs/qgis/ShortestPathLayerToPoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def processAlgorithm(self, parameters, context, feedback):
207207
multiplier = 3600
208208

209209
director.addStrategy(strategy)
210-
builder = QgsGraphBuilder(context.project().crs(),
210+
builder = QgsGraphBuilder(network.sourceCrs(),
211211
True,
212212
tolerance)
213213

@@ -237,7 +237,7 @@ def processAlgorithm(self, parameters, context, feedback):
237237

238238
nPoints = len(snappedPoints)
239239
total = 100.0 / nPoints if nPoints else 1
240-
for i in range(1, count + 1):
240+
for i in range(1, nPoints + 1):
241241
if feedback.isCanceled():
242242
break
243243

python/plugins/processing/algs/qgis/ShortestPathPointToLayer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
QgsFeature,
3737
QgsFeatureSink,
3838
QgsGeometry,
39+
QgsFeatureRequest,
3940
QgsFields,
4041
QgsField,
4142
QgsMessageLog,
@@ -206,7 +207,7 @@ def processAlgorithm(self, parameters, context, feedback):
206207
multiplier = 3600
207208

208209
director.addStrategy(strategy)
209-
builder = QgsGraphBuilder(context.project().crs(),
210+
builder = QgsGraphBuilder(network.sourceCrs(),
210211
True,
211212
tolerance)
212213

@@ -237,7 +238,7 @@ def processAlgorithm(self, parameters, context, feedback):
237238

238239
nPoints = len(snappedPoints)
239240
total = 100.0 / nPoints if nPoints else 1
240-
for i in range(1, count + 1):
241+
for i in range(1, nPoints + 1):
241242
if feedback.isCanceled():
242243
break
243244

python/plugins/processing/algs/qgis/ShortestPathPointToPoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def processAlgorithm(self, parameters, context, feedback):
206206
multiplier = 3600
207207

208208
director.addStrategy(strategy)
209-
builder = QgsGraphBuilder(context.project().crs(),
209+
builder = QgsGraphBuilder(network.sourceCrs(),
210210
True,
211211
tolerance)
212212
feedback.pushInfo(self.tr('Building graph...'))

0 commit comments

Comments
 (0)