[GRASS-user] sum of areas of certain attributes

Moritz Lennert mlennert at club.worldonline.be
Thu Nov 15 06:12:51 EST 2007


[please always cc the list to let everyone profit of the discussion]

On 15/11/07 11:10, Dr. Manuel Seeger wrote:
> Thanks Moritz,
> 
> but I think I did not explain clear enough.
> v.to.db calculates the values for each category (here this is each 
> polygon), but I need the sum of values for different classes, which are 
> composed by a changing number of polygons. I want to know the area of 
> each class.

After running v.to.db, you can run a select on the classification 
column. Something like:

echo "select sum(area) from TABLE group by ClassificationColumn" | db.select


If your classification information is in integer form, you can also use 
v.reclass:

v.reclass in=OrigMap out=ReclassMap Column=ClassificationColumn

and then v.to.db on ReclassMap.

Moritz

> 
> how?
> Thank you!
> 
> Manuel
> 
> Moritz Lennert schrieb:
>> On 15/11/07 08:27, Dr. Manuel Seeger wrote:
>>> Hello list,
>>>
>>> I have a polygon map with a huge table, in which some columns give 
>>> the information about a classification of the single polygons (these 
>>> are represnted by single categories). I would like to calculate e.g. 
>>> the sum of areas belonging to each class. How can I do this
>>> I tried a way by extracting the class needed indiviadually, 
>>> generating a new tabel and so on, but it seems to be quite 
>>> complicated. Is there a more simple way to get the results?
>>
>> v.to.db with option=area ?
>>
>> Moritz
>>
>>
> 
> 



More information about the grass-user mailing list