[GRASS-dev] adding a flag to discard NULL values in mapalgebra aggregation functions

G. Allegri giohappy at gmail.com
Wed Jun 20 03:17:58 PDT 2012


Following a thread I've opened on the grass-users list, I would like to
suggest a proposal to add a flag, to the r.mapcalc command, to discrd
NULL values when evaluating aggregation functions like max(), min(),
mode(), etc.
Looking into the code of, for example., the max() function [1], it seems
that if a NULL value is in the set of the arguments, the result is set to
NULL (if I understand it correctly).
With the proposed flag, I would like to ask r.mapcalc to do not consider
the NULLs, and to the calculations only on the not-NULL subset of values.
This would let us do filtering (with row/columns offsets) as it is done in
r.neighbors, where the NULL values are directly discarded.

giovanni

[1] http://trac.osgeo.org/grass/browser/grass/trunk/raster/r.mapcalc/xmax.c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20120620/d9f52efc/attachment-0001.html>


More information about the grass-dev mailing list