[Qgis-developer] Area calculation issues

Nyall Dawson nyall.dawson at gmail.com
Wed Feb 1 01:30:39 PST 2017


On 1 February 2017 at 18:55, Neumann, Andreas <a.neumann at carto.net> wrote:
> Hi,
>
> Regarding field calculator:
>
> I wonder what the difference between $area and area($geometry) is?

$area respects project settings like ellipsoid choice and area units.

area(geometry) is just a plain cartesian calculator.

> They deliver different results - sometimes quite close, but sometimes with a
> hug difference.
>

The results will vary (sometimes by a huge amount) depending on the
geometry's crs and ellipsoid choice. Eg area($geometry) for geometries
in geographic coordinates in mostly meaningless, and the same for
projections like web mercator.


> I have to add, that the data contains circular arcs.

Should not affect anything.

> Another user reported me that area calculation results are different
> depending on OTF is on or off (I have to ask which QGIS version, he did not
> tell).

Yes - switching off OTF will reset the ellipsoid to none. Switching it
on resets the ellipsoid choice back to the ellipsoid matching the
project CRS.

This was very confusing behaviour. The good news is that I changed
this a week or so ago in qgis 3. Now OTF has no impact on area or
length calculations, and that *only* depends on the project ellipsoid
choice.

(There was talk at the time that we should totally remove the OTF off
option. I'm in favour of this and will probably tackle it soon).

Nyall


More information about the Qgis-developer mailing list