[GRASS5] r.texture segfault

Markus Neteler neteler at itc.it
Thu Jul 7 11:47:04 EDT 2005


On Thu, Jul 07, 2005 at 04:39:38PM +0100, Glynn Clements wrote:
> 
> Hamish wrote:
> 
> > >    if (grays[row][col] < 0 || grays[row][col] > PGM_MAXMAXVAL)
> > >       G_fatal_error ("Too many categories (found: %i, max: %i). Try to
> > >       rescale or reclassify the map", grays[row][col], PGM_MAXMAXVAL);
> > 
> > 
> > The check is good, but the -2147483648 problem is still that the module
> > doesn't understand NULLs?
> 
> Correct.
> 
> > This stops the Segfault but the module still
> > doesn't work right. Or does the texture algorithm forbid NULLs?
> 
> Correct.
> 
> If your data has nulls, you have to get rid of them, e.g. using
> r.fillnulls. Ditto for out-of-range values (<0 or >255).

Excuse me, I don't understand your comment. Most of the raster
modules do handle NULL data cells. Can't we propagate also
in r.texture a NULL hole to the output map? It's clear that we
cannot calculate texture on NULL data, but we could write out
NULL at that position and move on for the rest of the map.

?

BTW, why is -2147483648 < 0  not true in the if condition?

Markus




More information about the grass-dev mailing list