[QGIS-Developer] Inconsistent results using length(), perimeter() and area() expression functions and Identify Features map tool

Andrea Giudiceandrea andreaerdna at libero.it
Sat Oct 16 15:26:45 PDT 2021


Hi Devs,
I noticed that the expression functions length(), perimeter() and area() 
use the QgsGeometry length() and area() functions to calculate the 
Cartesian length of lines and perimeter and area of polygons.

The Identify Features map tool uses instead the QgsAbstractGeometry 
class length() and perimeter() functions for the Cartesian length of 
lines and the perimeter of polygons and the QgsGeometry area() function 
for the Cartesian area.

This leads to inconsistent results when the geometries contain 
CircularStrings or CurvePolygons.
In this case the QgsAbstractGeometry class functions are more accurate 
then the QgsGeometry ones.

Is there any reason or contraindication why not to use the 
QgsAbstractGeometry class functions also for the expression functions 
length(), perimeter() and area() and for the Identify Features map tool 
measurement of polygons area?

Best regards.

Andrea Giudiceandrea


More information about the QGIS-Developer mailing list