Bug report #11861

$area calculation

Added by lorenzo pote almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Vectors
Affected QGIS version:2.6.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:20076

Description

Goodmorning,
in qgis 2.6 the $area calculation from field calculator returns errors for every record: it returns always -92.2337203685478 sq_mt. The layer was created with qgis 2.4 and i work in EPSG 32632.
In qgis 2.4 it was ok.
Arcgis calculates the right value.
If i use "vector/geometry tools/export_add geometry columns" it stops at 87% of elaboration.

Thank you

Lorenzo

BOSCHI__area_error.zip (762 KB) lorenzo pote, 2014-12-15 05:06 AM

BOSCHI__area_error.zip (762 KB) lorenzo pote, 2014-12-15 05:07 AM

History

#1 Updated by Giovanni Manghi almost 6 years ago

  • Assignee deleted (Giovanni Manghi)
  • Category changed from Attribute table to Vectors
  • Status changed from Open to Feedback

please attach the vector.

#2 Updated by lorenzo pote almost 6 years ago

here the shp file. I've the same error with all layer.

lorenzo potè

#3 Updated by lorenzo pote almost 6 years ago

here the shp file. I've the same error with all layer.

lorenzo potè

#4 Updated by Giovanni Manghi almost 6 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

The "AREA" field in the shape you attached is of type double with length 19 with 16 of those spaces for the decimal part. This means that in this column you can only accommodate numbers with 2 integer numbers. If you calculate the area in hectares ($area/10000) you will see that the values are ok because the numbers are small enough to be stored there. If compute the area in sq m then you see strange values: this behavior can be improved but it has an explanation.

If you compute the area in new columns (with the proper length) there are no problems.

Also available in: Atom PDF