[GRASS-user] r.texture NULL value error

Hi list,

I’ve been trying to run a r.texture filter on a map but I constantly get the error:

ERROR: Negative or no data pixel found. This module is not yet able to
process no data holes in a map, please fill with r.fillnulls or
other algorithms

However, I ran r.null to set all NULL values to 0 and r.categories also showed no negative values afterwards.

What could be the cause of this error.

I also rescaled the categories between 0 and 100.

After all this the ERROR is still their.

Furthermore, If I run a 3x3 r.neighbourhood average moving window analysis on this map, r.texture runs fine on the result of r.neighbourhood.

I really don’t know what causes this inconsistent behaviour. Any ideas what causes this error?

Kind regards,
Koen

On Mon, Nov 24, 2008 at 2:39 PM, Hufkens Koen <koen.hufkens@ua.ac.be> wrote:

Hi list,

I've been trying to run a r.texture filter on a map but I constantly get the
error:

ERROR: Negative or no data pixel found. This module is not yet able to
       process no data holes in a map, please fill with r.fillnulls or
       other algorithms

I ran into this myself a few minutes ago :slight_smile:
The trick is that *all* pixels in the current region are need to be
set to non-NULL.
If NULL pixels are present, r.texture fails.

run
r.univar mapname
to see how many NULL cells are in the current region.

Solution:
- either zoom into area without NULL pixels (won't always make sense)
- or fill the NULL areas with some value (various options)
- (or fix r.texture if possible).

Markus

Markus:

The trick is that *all* pixels in the current region are
need to be set to non-NULL.
If NULL pixels are present, r.texture fails.

....

- (or fix r.texture if possible).

maybe something like this:

http://trac.osgeo.org/grass/changeset?new=grass%2Ftrunk%2Fraster%2Fr.los%2Fpts_elim.c%4025104&old=grass%2Ftrunk%2Fraster%2Fr.los%2Fpts_elim.c%4018934

?

(without looking at r.texture code at all)

Hamish

It seems that r.null missed some NULL values or some negative values are still there (one or both issues may be the cause).

Anyway I worked around it by adding a fixed amount with the map calculator and rescaling it to the wanted scale.

This workaround seems to be foolproof and confirms that there must be a NULL value or a negative value that is missed by the summary statistics and r.null causing r.texture to go into spasm.

So, it’s fixed and not fixed at the same time. Maybe I’ll look into the code later.

Cheers,
Koen

-----Oorspronkelijk bericht-----
Van: neteler.osgeo@gmail.com namens Markus Neteler
Verzonden: ma 24-11-2008 15:46
Aan: Hufkens Koen
CC: GRASS user list
Onderwerp: Re: [GRASS-user] r.texture NULL value error

On Mon, Nov 24, 2008 at 2:39 PM, Hufkens Koen koen.hufkens@ua.ac.be wrote:

Hi list,

I’ve been trying to run a r.texture filter on a map but I constantly get the
error:

ERROR: Negative or no data pixel found. This module is not yet able to
process no data holes in a map, please fill with r.fillnulls or
other algorithms

I ran into this myself a few minutes ago :slight_smile:
The trick is that all pixels in the current region are need to be
set to non-NULL.
If NULL pixels are present, r.texture fails.

run
r.univar mapname
to see how many NULL cells are in the current region.

Solution:

  • either zoom into area without NULL pixels (won’t always make sense)
  • or fill the NULL areas with some value (various options)
  • (or fix r.texture if possible).

Markus