[GRASS-user] [GRASSLIST:9108] Re: Area size of a vector layer..

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Tue Mar 25 21:26:33 EDT 2008


On Tue, 2008-03-25 at 14:09 +0100, Nikos Alexandris wrote:
> On Tue, 2008-03-25 at 13:58 +0100, Moritz Lennert wrote:
> > Going through a huge backlog of GRASS mails, so sorry if this was 
> > already answered:
> > 
> > On 10/03/08 15:43, Nikos Alexandris wrote:
> > > On Mon, 2008-03-10 at 07:19 -0700, Nikos Alexandris wrote:
> > > [...]
> > >> I am replying in an old thread but I've been trying to grab area size per
> > >> class from a (CORINE land cover) vector map. Still no luck for a quick and
> > >> easy way.
> > > 
> > > I forgot:
> > > 
> > > My column with the various land cover classes is "a_code".
> > > 
> > > So thw question is actually how could I sum up area's based on "a_code"?
> > 
> > Have you tried (using sqlite or postresql as data backend):
> > 
> > v.to.db area
> > 
> > echo "select a_code, sum(area) from CorineTable group by a_code" | 
> > db.execute
> > 
> > Moritz

Moritz,

how can I thank you? That was it!

echo "select code, sum(area_ha) from corine group by code" | db.select 
code|sum(area_ha)
111|911.105978
112|18374.585516
121|1954.619447
122|2059.656018

[...]

332|1977.949223
333|18332.371247
334|3928.787784
411|1688.635732
421|1388.703288
422|90.084023
511|1405.040777
512|2387.296502
521|355.615927

It would be nice to have this in v.report.



More information about the grass-user mailing list