r.buffer
Bill Hargrove
hnw at mtqgrass.ESD.ORNL.GOV
Thu Dec 9 17:27:52 EST 1993
Bill Jackson writes:
>Can someone tell me why r.buffer is limited to 60 continuous zones?
I don't know, but we find it to be a real pain. So much so that we
have written a small shell script which helps alleviate this shortcoming:
---------------8<---cut here---------------------------------
source=channel
dist=tmp
res=10
incr=10
echo "" | nawk '{
printf "r.buffer input='"$source"' output='"$dist"'a distances="
for ( i='"$res"'; i<'"$res"'+('"$incr"'*60); i=i+'"$incr"' ) {printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'b distances="
for ( i='"$res"'+('"$incr"'*60); i<'"$res"'+('"$incr"'*120); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'c distances="
for ( i='"$res"'+('"$incr"'*120); i<'"$res"'+('"$incr"'*180); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'d distances="
for ( i='"$res"'+('"$incr"'*180); i<'"$res"'+('"$incr"'*240); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'e distances="
for ( i='"$res"'+('"$incr"'*240); i<'"$res"'+('"$incr"'*300); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'f distances="
for ( i='"$res"'+('"$incr"'*300); i<'"$res"'+('"$incr"'*360); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'g distances="
for ( i='"$res"'+('"$incr"'*360); i<'"$res"'+('"$incr"'*420); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'h distances="
for ( i='"$res"'+('"$incr"'*420); i<'"$res"'+('"$incr"'*480); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'i distances="
for ( i='"$res"'+('"$incr"'*480); i<'"$res"'+('"$incr"'*540); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'j distances="
for ( i='"$res"'+('"$incr"'*540); i<'"$res"'+('"$incr"'*600); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
printf "r.buffer input='"$source"' output='"$dist"'k distances="
for ( i='"$res"'+('"$incr"'*600); i<'"$res"'+('"$incr"'*660); i=i+'"$incr"' ) {
printf "%d,", i}
printf " units=meters\n"
#
}' > z.tmp
sh z.tmp > z.tmp.out
r.mapcalc << rend
finbuff=if(tmpa>0,tmpa,if(tmpb>1,tmpb+60,if(tmpc>1,tmpc+120,if(tmpd>1,tmpd+180,\
if(tmpe>0,tmpe+240,if(tmpf>1,tmpf+300,if(tmpg>1,tmpg+360,if(tmph>1,tmph+420,\
if(tmpi>0,tmpi+480,if(tmpj>1,tmpj+540,tmpk+600))))))))))
rend
--------------------------------------------------------------
____ Oak Ridge National Laboratory
/ ) / / / / Environmental Sciences Division
/--< o / / /--/ P.O. Box 2008, M.S. 6038
/___/__<__/__/_ / / _ Oak Ridge, TN 37830-6038
William W. Hargrove (615) 574-1902
hnw at mtqgrass.esd.ornl.gov (615) 576-8646 (fax)
--------------------------------------------------------------
More information about the grass-user
mailing list