Use correct SRS when building graph

This commit is contained in:
Nyall Dawson 2017-09-15 17:26:49 +10:00
parent 6898342c08
commit 1d6e30324f
5 changed files with 8 additions and 7 deletions

View File

@ -209,7 +209,7 @@ class ServiceAreaFromLayer(QgisAlgorithm):
multiplier * 1000.0 / 3600.0) multiplier * 1000.0 / 3600.0)
director.addStrategy(strategy) director.addStrategy(strategy)
builder = QgsGraphBuilder(context.project().crs(), builder = QgsGraphBuilder(network.sourceCrs(),
True, True,
tolerance) tolerance)

View File

@ -200,7 +200,7 @@ class ServiceAreaFromPoint(QgisAlgorithm):
multiplier * 1000.0 / 3600.0) multiplier * 1000.0 / 3600.0)
director.addStrategy(strategy) director.addStrategy(strategy)
builder = QgsGraphBuilder(context.project().crs(), builder = QgsGraphBuilder(network.sourceCrs(),
True, True,
tolerance) tolerance)
feedback.pushInfo(self.tr('Building graph...')) feedback.pushInfo(self.tr('Building graph...'))

View File

@ -207,7 +207,7 @@ class ShortestPathLayerToPoint(QgisAlgorithm):
multiplier = 3600 multiplier = 3600
director.addStrategy(strategy) director.addStrategy(strategy)
builder = QgsGraphBuilder(context.project().crs(), builder = QgsGraphBuilder(network.sourceCrs(),
True, True,
tolerance) tolerance)
@ -237,7 +237,7 @@ class ShortestPathLayerToPoint(QgisAlgorithm):
nPoints = len(snappedPoints) nPoints = len(snappedPoints)
total = 100.0 / nPoints if nPoints else 1 total = 100.0 / nPoints if nPoints else 1
for i in range(1, count + 1): for i in range(1, nPoints + 1):
if feedback.isCanceled(): if feedback.isCanceled():
break break

View File

@ -36,6 +36,7 @@ from qgis.core import (QgsWkbTypes,
QgsFeature, QgsFeature,
QgsFeatureSink, QgsFeatureSink,
QgsGeometry, QgsGeometry,
QgsFeatureRequest,
QgsFields, QgsFields,
QgsField, QgsField,
QgsMessageLog, QgsMessageLog,
@ -206,7 +207,7 @@ class ShortestPathPointToLayer(QgisAlgorithm):
multiplier = 3600 multiplier = 3600
director.addStrategy(strategy) director.addStrategy(strategy)
builder = QgsGraphBuilder(context.project().crs(), builder = QgsGraphBuilder(network.sourceCrs(),
True, True,
tolerance) tolerance)
@ -237,7 +238,7 @@ class ShortestPathPointToLayer(QgisAlgorithm):
nPoints = len(snappedPoints) nPoints = len(snappedPoints)
total = 100.0 / nPoints if nPoints else 1 total = 100.0 / nPoints if nPoints else 1
for i in range(1, count + 1): for i in range(1, nPoints + 1):
if feedback.isCanceled(): if feedback.isCanceled():
break break

View File

@ -206,7 +206,7 @@ class ShortestPathPointToPoint(QgisAlgorithm):
multiplier = 3600 multiplier = 3600
director.addStrategy(strategy) director.addStrategy(strategy)
builder = QgsGraphBuilder(context.project().crs(), builder = QgsGraphBuilder(network.sourceCrs(),
True, True,
tolerance) tolerance)
feedback.pushInfo(self.tr('Building graph...')) feedback.pushInfo(self.tr('Building graph...'))