Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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!

share|improve this question
    
Can you share a sample of the problematic data? –  underdark Nov 8 '13 at 15:56
    
I can share a sample - in which format/how would it be best? I have mapped the same shapefile in ArcGIS and the field calculator there gives me correct results - not sure if it's something about the data or a bug in QGIS. –  Kristina Nov 8 '13 at 20:31
    
A zipped Shapefile would do. Do you have Dropbox or similar to share? –  underdark Nov 8 '13 at 21:40
    
Can you share the extent values from your original data from Properties, Metadata tab of the layer? Area calculation in World Mercator will give wrong results if 90° North or South is included. –  Andre Joost Nov 9 '13 at 5:59
add comment

3 Answers

If you are getting negative values in area, I will recommend you to first clean your shapefile. Reproject your shapefile in equal area projection and then use calculator $area function to get area. Hope it helps.

share|improve this answer
    
Please see my comment below, I have tried this several times with different reprojections... no change. –  Kristina Sep 4 '13 at 16:11
    
+1 for the equal area projection –  geogeek Nov 8 '13 at 15:57
add comment

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.

share|improve this answer
2  
Your experience is interesting: didn't cleaning the dataset (as suggested in the earlier answer by @Deep) fix up those "odd nodes"? –  whuber Nov 18 '13 at 21:50
add comment

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.

share|improve this answer
    
The polygons are big, but not that big. Where can I find the setting for square kilometers? I was wondering anyway which unit the calculated area is in, looked more like cm2... Thanks underdark, you're becoming my personal mentor for qgis. –  Kristina Aug 31 '13 at 14:21
    
Thanks for the explanation how to get km2... I have tried this now, however, the values are still wrong and far too big. I have compared the values with a file where the area is given and have created an identical polygon in my shapefile, but it's just not working. Maybe it's something with the projection? If I save the file under WGS84/World Mercator and then reopen it in qgis with the map set to the same CRS and then open another shapefile which should depict the same area, the two won't match... I'm not familiar with setting different CRSs and am totally puzzled... –  Kristina Aug 31 '13 at 15:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.