QGIS – Solving Area Calculations Returning Negative Values Issue

coordinate systemfield-calculatorqgis

I have created a shapefile with some polygons and am now trying to calculate the area of these polygons. The original CRS was WGS84, I have reprojected it to WGS 84 / World Mercator so unit is metres. On-the-fly projection is on. If I'm now using the field calculator to calculate the area of the polygons using $area, I first get some really weird values in my output column (far too high) and if I click 'save' or end the toggle mode, the values change to negative values which are the same for all polygons.
Switching to another CRS and reprojecting the file again e.g. to GDA94/MGA55 EPSG:28355 and calculating the area creates again funny values, some of them negative.
I can't figure out where the problem is and am grateful for any help! Thanks a lot!

Best Answer

If the values are first very big and then negative, you are most likely running into an integer overflow problem. Are the polygons very big in reality? Maybe you shouldn't calculate square meters but at least kilometers.

  1. Load the orginal file in WGS84, don't change anything
  2. Save as ... with a target CRS in meters (e.g. UTM depending on your area of interest)
  3. Load the new file and then calculate the area:

for kmĀ²: $area / 1000000

for ha: $area / 10000

On-the-fly reprojection is not needed for this task.

Related Question