[GRASS5] r.texture segfault

Glynn Clements glynn at gclements.plus.com
Sat Jul 9 17:00:51 EDT 2005


Markus Neteler 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.

Yes, however:

1. r.texture doesn't do this at present; someone needs to add code to
do it.

2. r.texture uses a neighbourhood window, so each null cell would
result in a patch of nulls the same size as the window.

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



More information about the grass-dev mailing list