[GRASS5] r.mapcalc and NULL question

Markus Neteler neteler at geog.uni-hannover.de
Tue Jan 16 04:32:56 EST 2001


On Tue, Jan 16, 2001 at 03:44:39PM +0700, Justin Hickey wrote:
> Hi Markus
> 
> Markus Neteler wrote:
> > Generally I consider this as a bug because you can't always know if
> > a map contains NULLs. If only a few pixels would be nulls you may
> > use option 2 and don't realize that the result is not want you want.
> > I feel this behaviour is somewhat dangerous. The isnull() is useful,
> > but if you have to apply it on default in if-clauses, it's a bit 
> > annoying.
> > 
> > Other comments?
> 
> I agree with the others, it is not a bug. Perhaps r.mapcalc should print
> a warning if it tries to perform arithmetic on null values. At least
> then, the user will be notified of the problem.

O.k. I am convinced :-) The current behaviour will be the best.
But printing a "WARNING: Map %s contains NULLs" might be helpful.

Then we can add a comment to html/html/r.mapcalc.html that arithmetics
on NULL cells lead to NULL cells unless isnull() is used.

Meanwhile I found such a workaround for my script...

Markus

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list