Skip to content

Commit

Permalink
[processing] Fix Hub Distance alg does not correctly use project elli…
Browse files Browse the repository at this point in the history
…psoid setting
  • Loading branch information
nyalldawson committed May 25, 2017
1 parent b0268ef commit 7e089a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/qgis/HubDistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
__revision__ = '$Format:%H$'

from qgis.PyQt.QtCore import QVariant
from qgis.core import QGis, QgsField, QgsGeometry, QgsDistanceArea, QgsFeature, QgsFeatureRequest
from qgis.core import QGis, QgsField, QgsGeometry, QgsDistanceArea, QgsFeature, QgsFeatureRequest, QgsProject
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterVector
Expand Down Expand Up @@ -111,6 +111,9 @@ def processAlgorithm(self, progress):
distance = QgsDistanceArea()
distance.setSourceCrs(layerPoints.crs().srsid())
distance.setEllipsoidalMode(True)
project_ellipsoid = QgsProject.instance().readEntry('Measure', '/Ellipsoid',
'NONE')[0]
distance.setEllipsoid(project_ellipsoid)

# Scan source points, find nearest hub, and write to output file
features = vector.features(layerPoints)
Expand Down

0 comments on commit 7e089a1

Please sign in to comment.