Cell count in category value

Justin Hickey jhickey at impact1.hpcc.nectec.or.th
Mon Feb 16 06:25:39 EST 1998


Hi Vangelis

On Feb 16,  1:08am, Filippidis Vangelis wrote:
> Subject: Cell count in category value
>
>   I used the r.slope.aspect command to get a slope map
> and i get with r.report the cell count for each category of
> slope.
> However, i want to use the cell count with r.mapcalc.
> Is there a way to assign the cell count for each category
> of slope, in the category value of the slope map (not by hand!!!)

I'm not sure if a grass command exists to do what you want, but one way to do
this is to save the results of r.report as a file. Then write a script to go
through the file and create a "rules" file mapping the slope values to the
appropriate cell count for the r.reclass command. Then run r.reclass with the
new "rules" file and you should have a raster map with the cell count values
for each category. You may have to run r.resample after the r.reclass command.
See the man pages of r.reclass for acceptable syntax for the "rules" file.

Hope this helps.

-- 
Sincerely,

Jazzman (a.k.a. Justin Hickey)  e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do.  ---Anonymous

Jazz and Trek Rule!!!
==================================================================



More information about the grass-user mailing list