[GRASS-user] odd r.stats output, after r.resample.stats

Markus Metz markus.metz.giswork at googlemail.com
Wed Oct 19 02:55:47 EDT 2011


On Tue, Oct 18, 2011 at 9:31 PM, Kirk Wythers <kirk.wythers at gmail.com> wrote:
> I am trying to aggregate resample a 250 meter resolution raster to 1000m resolution as the most frequently occurring value in the 250m map. I am using:
>
> GRASS 6.4.1 (northcentralus_albersequalarea):~ > r.resamp.stats -w input=mnwimifnfftgk7wt175v3_250m output=mnwimifnfftgk7wt175v3_1000m method=mode --verbose 100%
>
> This all appears to work properly. If I export the raster to MATLAB and simply view the cell values they are all whole number like 500, 600, 700, etc....
>
> However, when I run r.stats on each map, I get:
>
> GRASS 6.4.1 (northcentralus_albersequalarea):~ > r.stats -cl input=mnwimifnfftgk7wt175v3_250m 100%
> 0  893025
> 100  18419
> 120  34024
> 170  125
> 260  18
> 380  527
> 400  4269
> 500  36610
> 600  163
> 700  12479
> 800  51090
> 900  53455
> 990  5
> 999  527
> * no data 874
>
> GRASS 6.4.1 (northcentralus_albersequalarea):~ > r.stats -cl input=mnwimifnfftgk7wt175v3_1000m
> 100%
> 0-3.917647 from  to  929109
> 97.941176-101.858824 from  to  11467
> 117.529412-121.447059 from  to  32643
> 168.458824-172.376471 from  to  1
> 258.564706-262.482353 from  to  1
> 376.094118-380.011765 from  to  30
> 399.6-403.517647 from  to  383
> 497.541176-501.458824 from  to  24231
> 599.4-603.317647 from  to  12
> 697.341176-701.258824 from  to  2184
> 799.2-803.117647 from  to  50355
> 897.141176-901.058824 from  to  55190
> 995.082353-999 from  to  4
>
> The output to r.stats from the 250 meter resolution map look fine... but doesn't make sense to me that the 1000 meter resolution map would have it's count and cell values binned into groups like 0-3.9, and 97.9-101.9???

That looks like mnwimifnfftgk7wt175v3_250m is of type CELL and
mnwimifnfftgk7wt175v3_1000m is of type FCELL or DCELL. Try reading
mnwimifnfftgk7wt175v3_1000m as CELL (integer) with

r.stats -cli input=mnwimifnfftgk7wt175v3_1000m

HTH,

Markus M


More information about the grass-user mailing list