[GRASSLIST:5668] Re: A r.shrink ?

Gordon Keith gordon.keith at csiro.au
Tue Feb 25 19:12:39 EST 2003


On Wed, 26 Feb 2003 03:11, Soil & Water Lab. wrote:
> Hello,
> Is there any such thing as a "r.shrink" command, that would work
> reverse from "r.grow" ? ie, from a given cellclump, to find the cells
> that are immediately on the border, or at a given distance from the
> border ?
> I must admit that I can't find any simple script that would do this
> without much troubles (viz, without checking cells one by one...).
> Thanks a lot for any input/insight
> P.

how about:

r.mapcalc 'neg=if(isnull(map),1,null())'
r.grow in=neg out=neg2
r.mapcalc 'map2=if(isnull(neg2),map,null())'

I've never used r.grow, so I'm not sure if I understand what its 
supposed to do, but maybe the above is useful.

Hope this helps
Gordon

-- 

Gordon Keith
Programmer/Data Analyst
Marine Acoustics
CSIRO Marine Research
http://www.marine.csiro.au

Now the message we have heard from his Son and announce is this:
God is light, and there is no darkness at all in him."
  -- 1 John 1:5




More information about the grass-user mailing list