[GRASS5] r.profile

Hamish hamish_nospam at yahoo.com
Tue Sep 13 21:21:51 EDT 2005


> is there a way to feed profile-coordinates into r.profile through a
> file instead of stating them on the command line ?
> 
> cat mycoordinates.txt |r.profile input=foo output=bat profile=-
> 
> and similar approaches do not seem to work.


use a shell script:

for coord in `cat mycoord.txt` ; do 
   east1=`echo $coord  | cut -f1 -d'|'`
   north1=`echo $coord | cut -f2 -d'|'`
   east2=`echo $coord  | cut -f3 -d'|'`
   north2=`echo $coord | cut -f4 -d'|'`
   echo  >> output.txt
   echo "LINE: [$east1, $north1 ; $east2, $north2]" >> output.txt
   r.profile input=foo output=- \
      profile=$east1,$north1,$east2,$north2 >> output.txt
done


that assumes format of mycoord.txt is "east1|north1|east2|north2"


Hamish




More information about the grass-dev mailing list