Skip to main content
1 of 3
Germán Carrillo
  • 37k
  • 5
  • 125
  • 180

You need to set the ellipsoidalMode to True:

distance.setEllipsoidalMode(True)

And then you might need to set the ellipsoid over which QGIS will perform calculations, e.g., WGS84:

distance.setEllipsoid('WGS84')

Now you can measure the distance once again:

m = distance.measureLine(point1, point2)

Which will give you ~322.475m.

Germán Carrillo
  • 37k
  • 5
  • 125
  • 180