[GRASS-dev] No 'count' method for r.statistics

Markus Metz markus.metz.giswork at gmail.com
Wed Aug 1 11:33:33 PDT 2018


On Wed, Aug 1, 2018 at 11:59 AM, Nikos Alexandris <nik at nikosalexandris.net>
wrote:
>
> `r.statistics` which was/is meant for categorical raster maps, does not
> provide for a 'count' method.
>
> `r.stats.zonal`, on the other hand, which is meant for floating point
> raster maps, does so.
>
> This is rather unexpected. 'Count'ing pixels should rather derive 'CELL'
> maps and not 'FCELL'.
>
> At the moment, I require an extra mapcalc using the int() function.
>
> Any comments?

Counting pixels can produce a result that is too large for CELL (32 bit
integer), therefore storing the count as DCELL is a bit safer because it
can exactly store integers larger than the 32 bit maximum.

In short, use r.stats.zonal rather than r.statistics.

Markus M

>
> Nikos
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180801/bd7ee076/attachment.html>


More information about the grass-dev mailing list