[GRASS5] region growing - r.mapcalc bug?

Paul Kelly paul-grass at stjohnspoint.co.uk
Wed Mar 2 05:06:47 EST 2005


On Wed, 2 Mar 2005, Jachym Cepicky wrote:

> sorry, I need
> if(seed[-1,-1] && (raster[-1,-1]> raster[1,1]),seed[-1,-1]+1,\
>     if(seed[-1,0]  && (raster[-1,0] > raster[1,0]),seed[-1,-1]+1,\
>     if(seed[-1,1]  && (raster[-1,1] > raster[1,-1]),seed[-1,1]+1,\
>     if(seed[0,-1]  && (raster[0,-1] > raster[0,1]),seed[0,-1]+1,\
>     if(seed[0,1]   && (raster[0,1]  > raster[0,-1]),seed[0,1]+1,\
>     if(seed[1,-1]  && (raster[1,-1] > raster[-1,1]),seed[1,-1]+1,\
>     if(seed[1,0]   && (raster[1,0]  > raster[-1,0]),seed[1,0]+1,\
>     if(seed[1,1]   && (raster[1,1]  > raster[-1,-1]),seed[1,1]+1,null()))))))))

Have you tried the isnull() function in r.mapcalc? That old tutorial you 
linked to was written for GRASS 4 where there was no null cell concept.

Paul





More information about the grass-dev mailing list