[Qgis-developer] Area calculation issues

Neumann, Andreas a.neumann at carto.net
Wed Feb 1 01:55:33 PST 2017


Hi Nyall, 

Thanks for the explanations. I should have read the explanations of the
help text more closely. It explains it all. 

However, there still seem to be issues. Consider the following results
below. First column is the result of $area, second column is
area($geometry). 

Sometimes the results are very close, in other cases the difference is
massive. Like in the very first row. 32'087 vs 190'605'589 square
meters. This can't be explained with ellipsoidical vs. planimetric. In
this first row, the result of area($geometry) (planimetric) seems
correct, while the ellipsoidical result ($area) is massively wrong. 

How can this huge difference be explained? 

------------ 

Regarding the second issue - yes, it makes sense that OTF has no
influence and that always the project CRS is used. 

Thanks! 

Andreas 

On 2017-02-01 10:30, Nyall Dawson wrote:

> 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

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170201/36804683/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0b3e71da.png
Type: image/png
Size: 12473 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170201/36804683/attachment-0001.png>


More information about the Qgis-developer mailing list