measuring area
Joe Leone
Joe.Leone at per.dwe.csiro.au
Fri Oct 13 08:00:00 EDT 1995
Hi all,
I have a situation in which I am trying to extend (grow) the area of a
patch in a particular direction, depending on the ajacent cell. I want the patc
h to grow only untill it gets to a specified size ( say 20 Hectares). The troub
le I have is stopping the growth.
I have managed to get the patch to grow by identifying potential growth areas a
nd runing the script below
I would appreciate any suggestion.
Thanks Joe
raster map test.g has three categories
cat value cat label
0 potenial growth
5 non growth
999 patch value
#!/bin/csh -f
# r.mapcalc script to grow remnant aeras in suitable soil types.
@ i=1
@ num=10
echo $i
echo "this will run through "$num, "loops "
d.erase
g.copy rast=test.g,output
#echo " now using "output.$i--
while ($i <= $num)
r.mapcalc output.$i = 'if(output,output, eval(if(output[0,-1]==999|| output[0,1
]==999||output[-1,0]==999||output[1,0]==999,999)))'
g.copy rast=output.$i,output
@ i++
echo $i
end
More information about the grass-user
mailing list