I have a a layer of Voronoi areas. I would like to know the area for every polygon. What I have done is the following, but the numbers seem strange (negative numbers are there).

So, I do the following:

  1. Right click on Voronoi layer
  2. Click "open attribute table"
  3. Click on "edit mode"
  4. Click on "open field calculator"
  5. Choose "decimal number"
  6. Choose "create new field", give name "surface"
  7. in the expression box type "$area"

But I'm not sure the process is right. Where does it get the polygons from? I don't see any geometry in that... which leads me to believe it's calculating something weird.

The attribute table only has the lat/long of the point that the Voronoi algo uses to calculate the polygon. But I don't know where the polygon itself is.

Is that what I'm getting wrong?

  • Can you provide a data sample? – underdark Nov 30 '16 at 19:16
  • 3
    If you're using shapefiles, you don't see the geometry column... but QGIS knows is there, and that's what the $area function is reading... Also: you state in the first sentence you have ' a layer of voronoi areas ' - are you using that layer to calculate the area? What do you see on your map? Post a screenshot of your data if you could... – DPSSpatial Nov 30 '16 at 19:17
  • Hi, @underdark: Of the polygon layer? There's only 2 columns, lat and lon, afaics – Dervin Thunk Nov 30 '16 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.