[GRASS-user] bash scrip r.cost/r.drain

Micha Silver micha at arava.co.il
Mon Aug 30 10:32:52 EDT 2010


On Mon, 30 Aug 2010 20:38:40 +1000
Anders Gonçalves da Silva <andersgs at gmail.com> wrote:

> Hello all. 
> 
> I was wondering if anyone has a bash script that runs over all pairs
> of points in a vector file, using them each in turn as
> start_coordinate in r.cost, and as a final point in r.drain. Thank
> you. Or, something similar that I could easily modify to my purposes.
> 

You could probably start by throwing the points into a text file with
v.out.ascii, then loop thru that file with something like:

v.out.ascii <vector> out=ascii_vector_points.txt fs=space
while read X Y ;
	do <your r.cost command coord=$X,$Y>;
done < ascii_vector_points.txt


> Anders._______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> This mail was received via Mail-SeCure System.
> 
> 



More information about the grass-user mailing list