10

I measure the area of a polygon with the QGIS Calculator: The cartesian area($ geometry) calculation function gives the same result for QGIS versions 2.16 and 3.4.5, but it is different with the $area function as shown in the image:

enter image description here

I don't understand why because the EPSG code and the ellipsoid are identical.

Could someone explain to me?

3

1 Answer 1

13

QGIS Field Calculator explains why outputs of area($ geometry) and $area are different:

area returns the area of a geometry polygon object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned area will match the units for the SRS. This differs from the calculations performed by the $area function, which will perform ellipsoidal calculations based on the project's ellipsoid and area unit settings.

EDIT: But I've noticed later that $area function returns different results for QGIS 2 and 3. I didn't understand that you asked that. Because the question was not clear. I tried to figure out what was the reason, and dead end. I think that it's a bug as @Stu state. I've reported this issue: #34597

EDIT 2: @ndawson's answer to the bug report:

Trust the QGIS 3 results. They are much more accurate and reliable vs QGIS 2 which had some known bugs in area calculation.

3
  • 2
    I made myself poorly understood : v2.16 area/10^6 : 44.1616749713555 area($geometry)/10^6 44.18969 v3.4.5 area/10^6 : 44.123126786646495 area($geometry)/10^6 44.18969
    – fcka
    Feb 20, 2020 at 22:15
  • 3
    Perhaps this should be reported as a bug.
    – Stu Smith
    Feb 21, 2020 at 5:35
  • 2
    @StuSmith I think it is a bug, I ve reported the issue. Feb 21, 2020 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.