[GRASS-dev] No 'count' method for r.statistics
Nikos Alexandris
nik at nikosalexandris.net
Fri Aug 3 01:20:04 PDT 2018
* Markus Metz <markus.metz.giswork at gmail.com> [2018-08-01 20:33:33 +0200]:
>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
I understand it now.
If integrating this extra "int()" conversion, in `r.stats.zonal`, is not
a smart/wanted thing to do, maybe we should add an explanation in the
`r.statistics` manual. Why 'count' is missing and why `r.stats.zonal` should
be used.
I can offer a patch for the manual if you agree.
My guess is that the development team has future plans regarding all r.stat*
modules, to merge and simplify as much as possible.
Thank you Markus!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180803/60fca6d8/attachment.sig>
More information about the grass-dev
mailing list