Bug report #16376
Calculations errors on WGS84 with Ellipsoid set to None/Planimetric
|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|
QGIS, by default, in Project -> Project Properties -> General has:
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:
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:
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.