[GRASS-user] Vector attribute 'algebra' - calculating difference between areas of polygons

James Duffy james.philip.duffy at gmail.com
Wed May 17 08:32:39 PDT 2017


Hello list,

I have two vectors (A and B), both of which are polygons of different
sizes. They overlap each other, but not fully. I wish to calculate the area
of each polygon (in meters) and perform the following:

(A - B) / A

Currently I think I can do this with the following:

1) Create a difference polygon with `v.overlay`.
2) Calculate the area of the difference polygon with `v.to.db`.
3) Calculate the area of polygon A with `v.to.db`.
4) Access attribute tables of both polygons to perform the calculation with
???

I have two questions:

1) Is there a more efficient way to do this? Is there some sort of vector
algebra available in GRASS.
2) Do the area values have to be stored in an attribute table? Can they be
written to a text file alongside an ID of the vector?

Any help would be much appreciated.

Thank you

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170517/d44f3f3f/attachment.html>


More information about the grass-user mailing list