Bug report #16376

Calculations errors on WGS84 with Ellipsoid set to None/Planimetric

Added by Pedro Venâncio over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Nyall Dawson
Category:Field calculator
Affected QGIS version:2.18.4 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24286

Description

QGIS, by default, in Project -> Project Properties -> General has:

Ellipsoid: None/Planimetric
Units for distance measurement: Meters
Units for area measurement: Square meters

With a layer and the project in WGS84 (EPSG:4326), when calculating areas whith ($area), the result appears in square meters.

Please see this layer:
https://cld.pt/dl/download/1d64a61b-055e-4fe3-8812-3c07e1928945/Dados_Iniciais.zip

For example, the area of the first polygon, gives 320,734 sqm. I get the same result, regardless of the OTF be on or off, QGIS 2.18.4 on Linux (suffix _li on the attribute table), Windows (suffix _wi), and QGIS 3 (suffix _q3). Columns 'area' and 'area_2' represents the area in map units (square degrees).

When I convert the layer for a projected CRS - ETRS89/PT-TM06 (EPSG:3763) - $area gives completely different values. For instance, for the first polygon, the result is 244,444 sqm:
https://cld.pt/dl/download/22e1caf0-3279-46e8-983f-c96a11f73381/Dados_Iniciais_3763.zip

The correct area is actually around 244,444 sqm.

If I use Ellipsoid 'WGS84', instead of 'None/Planimetric', the result for the first polygon is 244,975 sqm, which should be a correct measure on ellipsoid. With 'None/Planimetric', the result is 320,734sqm.

With the layer in EPSG:3763, the result with Ellipsoid 'GRS80' is 244,950sqm; with Ellipsoid 'None/Planimetric' is 244,444sqm.

So it seems that there is a problem with calculations on WGS84, with Ellipsoid set to 'None/Planimetric'.

This occurs both on QGIS 2.18.4 and QGIS 3 (master).

A workaround could be always set Ellipsoid 'WGS84' on, when the layer/project is WGS84. But I didn't test with other geographic coordinate systems, to see if the problem occurs in all non projected CRS.

History

#1 Updated by Nyall Dawson over 7 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Also available in: Atom PDF