9

I have a question regarding the area() and $area function in QGIS and St_Area in PostGIS.

I am trying to calculate the exact area of Polygons stored in a Shapefile in UTM 25832 and do not know which functions are the correct ones to use. I know that the difference between area() and $area in QGIS 3.10 is that the first is calculated planar and the second with ellipsoid.

I have also tried to calculate the area with ST_Area in PostGIS and get the same result as in QGIS with the area function or with ArcMap.

When my data is projected as UTM 32N (EPSG:25832) isn’t it already planar and can be calculated with the simple area() function instead of $area? Or do I have to use the $area function even if it is in UTM32?

3
  • 1
    The $area expression will return the ellipsoidal area, no matter what system the layer is in. If you want the planimetric area in your projected CRS, use area($geometry). Both areas may be considered as exact, they are just different areas. That said, I can't understand your question. Jan 25, 2020 at 3:34
  • I try to express myself more understandably. A projected coordinate system has constant lengths, angles, and areas across the two dimensions. A projected coordinate system is always based on a geographic coordinate system that is based on a sphere or spheroid. My question is, if I have projected data in UTM it should be already planar, calculated and based on a spheroid and I do not understand why I should use the ellipsoidal $area function then. Or do I completely misunderstand something? Thank you very much for your help.
    – Omegon
    Jan 28, 2020 at 14:17
  • I added an answer about QGIS. The ST_Area function in PostGIS, applied to a geometry, is like the area($geometry) function in QGIS. Applied to a geography, I think that it is like convert the geography to a UTM geometry and perform the planimetric area, but I'm not sure. About ArcMap, I don't know how the areas are calculated. Jan 30, 2020 at 4:45

1 Answer 1

16

The curved surface of the spheroid is unfailingly deformed when taken to the plane. The planimetric area is not equal to the ellipsoidal area.
The differences, moreover, are not constant in a projection that is not equivalent, such as UTM.


You can calculate both, ellipsoidal or planar, areas.

If you want to know the planimetric area of a geometry defined in a projected CRS, you can do it with the area($geometry) expression. The returned value corresponds to the area enclosed by that geometry in that projection plane.

If you want to know the ellipsoidal area of a geometry, you can do it with the $area expression. The return value corresponds to the area enclosed by that geometry [1] in the ellipsoid [2] surface.

Which of them do you should calculate, or which of them do you have to calculate, depends of which of them do you want to know its value.


[1] When the geometry is defined in a projected CRS, the vertices of the geometry will be reprojected inverse towards the ellipsoid, and the resulting ellipsoidal geometry on which the area will be calculated will be the one enclosed by the union of those vertices with geodesic lines.

[2] The ellipsoid defined in the Project Properties, Measurement section.

3
  • Thank you very much for this detailed answer, it helped me a lot!
    – Omegon
    Feb 4, 2020 at 14:16
  • Hi, when you use CSR 30:35, what is the unit given by the function $area?
    – Robagb
    Apr 4, 2022 at 14:29
  • @Robagb, I don't know the CRS 30:35, haven't it a standard name? $area function always measure in the units of Project Properties, Measurement section. Apr 4, 2022 at 15:41

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.