[GRASS-user] r.statistics base=name cover=name method=count ?
Hermann Peifer
peifer at gmx.eu
Sat Sep 26 09:44:44 EDT 2009
Markus wrote:
> Maybe r.univar.zonal from grass-addons can help? It could give you the
> number of cells of the cover layer (count of cover layer values) per
> base layer (zoning map in r.univar.zonal) class. Not sure if this is
> what you are looking for.
>
This is actually what I am looking for, but I haven't yet managed to get the add-ons working... :-(
On the other hand, I see that someone must have had a similar thought, as there is this commented line in r.statistics/o_distrib.c
79 /*tot+=sum;
80 fprintf(stderr,"Area: %ld Tot: %ld totsum: %lf\n",area,total_count,tot); */
area and total_count are what I am looking for. Currently I'm getting total_count via an additional r.stats -c step. Then I calculate area backwards, using the percentages from r.statistics method=distribution output and the absolute counts from r.stats -c.
It might be an idea to make r.statistics method=distribution print a 4-column output: basecat, covercat, sum, area
?
Hermann
More information about the grass-user
mailing list