[Qgis-user] Can we make QGIS stop lying?

Redoute redoute at tortenboxer.de
Thu May 25 13:39:05 PDT 2017


Am 25.05.2017 um 21:25 schrieb Tobias Wendorff:

>> It seems there is a bug in the algorithm python script.
> 
> Ah, it's a python script? Then I might fix it for myself.
> Thanks for the hint.

I found it in "C:\Program Files\QGIS
2.18\apps\qgis\python\plugins\processing\algs\qgis\HubDistance.py". The
script uses the QgsDistanceArea class and tries to set ellipsoidal mode,
but doesn't set the ellipsoid, see
<http://qgis.org/api/2.18/classQgsDistanceArea.html#a9877c70b2a9c90e89cf7211fb82176b1>

So I think this edit enables calculation on WGS84, but use with care:

  distance = QgsDistanceArea()
  distance.setSourceCrs(layerPoints.crs().srsid())
  distance.setEllipsoid(6378137, 6356752.3142)     ### <---- insert
  distance.setEllipsoidalMode(True)

Perhaps you can drop a bug report at the correct place.
-- 
Kai Borgolte, Bonn



More information about the Qgis-user mailing list