cat and size

What's the appropriate way to get a category
and its corresponding size of area from
a raster layer?

I know r.report will create a list. However,
I want to use the category name (it's a number
in my case) and the size to do a compuation.
It seems to me I have to program a function.

I appreciate any hint.

--Xin Zhuang
zhuang@access.digex.com

What's the appropriate way to get a category
and its corresponding size of area from
a raster layer?

r.clump input=cat.map output=clump.map
r.stats -c fs== in=clump.map | r.reclass in=clump.map out=area.map

This will give the area sizes in pixels.

r.cats could pick up the category label if want that.

If you want to examine this in an interactive way use r.what.rast with the
cat.map and the area.map

Lars

Lars Schylberg Email: larss@fmi.kth.se
Dept. of Geodesy and Photogrammetry
Royal Institute of Technology (KTH) Tel. +46 8 790 86 33
S-100 44 STOCKHOLM, SWEDEN Fax. +46 8 790 66 10