[GRASS-user] Re: Command to summarize the frequency distribution table

SGW00412 at nifty.com SGW00412 at nifty.com
Sun Dec 21 07:10:48 EST 2008


Dear Moritz and all

Thank you useful and kind advice.
Sorry, please give advice to me a little more.

I tried the re-classification by using r.reclass method in the raster map of the 
probability distribution.

An initial probability distribution is as follows: 

|MAP: (untitled) (maxent_v2 in PERMANENT)                                     |
|-----------------------------------------------------|
|                   Category Information            |  cell|  square     |
|                #|description                          | count|kilometers|
|------------------------------------------------------|
|         0-0.003801|from  to . . . . . . . . .. . . . . . . | 25890| 52,649.00|
|0.003801-0.007602|from  to . . . . . . . . . .. . . . . . |  4738|   9625.82|
.......
.......
|0.954007-0.957808|from  to . . . . . . . . . . . . . . . . |     1|      1.97|
| 0.965409-0.96921|from  to . . . . . . . . . . . . . . . . |     1|      1.94 |
|                *|no data. . . . . . . . . . . . .. . . . . |134527|272,251.90|


I want to classify it at 0.1 intervals. So I wrote text files as follows:
-----------
0.0 thru 0.1=0 A
0.1 thru 0.2=2 B
0.3 thru 0.4=3 C
0.4 thru 0.5=4 D
 ....
0.9 thru 1.0=10 J
end
-----------

then, I saved as probability_class.txt

r.reclass input=old_rast_map output=new_rast_map < probability_class.txt

then,  following massage printed out on display:
-----
0.500000 rounded up to 0
0.600000 rounded up to 0
..........
1.400000 rounded up to 1
1.500000 rounded up to 1
-----

|-----------------------------------------------------------------------------|
|MAP: Reclass of maxent_v2 in PERMANENT (re_maxent in PERMANENT)              |
|-----------------------------------------------------------------------------|
|                   Category Information                    |  cell|  square  |
| #|description                                             | count|kilometers|
|-----------------------------------------------------------------------------|
| 5| . . . . . . . . . . . . . . . . . . . . . . . . . . . .| 39215| 79,669.75|
|10| . . . . . . . . . . . . . . . . . . . . . . . . . . . .|   698|   1397.98|
| *|no data. . . . . . . . . . . . . . . . . . . . . . . . .|134527|272,251.90|


Why ? What's happened ? 
I do not understand the cause not appropriately classified. 



Best regard:

Yasuo shimada



Moritz Lennert <mlennert at club.worldonline.be>‚³‚ñF
> On 16/12/08 14:40, SGW00412 at nifty.com wrote:
> > Dear Moritz:
> > 
> > I wish to express my gratitude for your valuable advice. Thank you. 
> > It succeeded when having tried as follows:
> > 
> > 0 thru 100=1 0-100m
> > 100 thru 200=2 100-200m
> > 200 thru 300=3 200-300m
> > 300 thru 400=4 300-400m
> > ....
> > end
> > 
> > save as alt_class.txt
> > 
> > r.reclass input=old_rast_map output=new_rast_map < alt_class.txt
> > 
> > r.stats new_rast_map -c
> 
> 
> Note that you could have also done something similar with
> 
> r.report map=old_rast_map units=k nsteps=
> 
> playing around with nsteps to get the same ranges. But r.reclass + 
> r.stats/r.report gives you more precise control of your classes.
> 
> Moritz


More information about the grass-user mailing list