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!
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.
- Load the orginal file in WGS84, don't change anything
- Save as ... with a target CRS in meters (e.g. UTM depending on your area of interest)
- Load the new file and then calculate the area:
$area / 1000000
$area / 10000
On-the-fly reprojection is not needed for this task.
A suggestion: I too have had GPS'd polygons return negative area values before. I finally figured out why. When I zoomed in really close to a cluster of odd dangles, I found that a few vertices were overlapping themselves, creating the negative value. If you delete the odd nodes, then it becomes a whole polygon and should have a positive value for the area calculation.
I have this problem when I'm using topological editing on a shapefile or spatialite layer and on the fly (OTF) reprojection is enabled. The 'avoid intersections' function does not work consistently and some polygons' nodes are unselectable (though the polygon can still be selected and deleted). This also affects the 'Save As...' function: some polygons are not exported. These problem polygons are not necessarily identified with the 'Check Geometry Validity..." tool.
Disabling OTF and recalculating the area solves the problem on my machine. Please try that with both of your reprojection and get back to us.
-QGIS 2.10.1 on Debian 8.1.