<br><br><span class="gmail_quote"><br></span>hy,<br>I would like to calculated the distances between points.<br><br>I am doing it with the following script which reads coordinates of the points form two files (produced with
v.report), uses v.net.path to create the shortest path and then v.patch to produce a table with all distances of al nodes.<br><br>---------------------------------------------------------------------------------------------------------
<br> cat coordTempFile1 | while read line1; do<br> ...<br> xcoor1=${line1 ...<br><br>ycoor1=${line1 ....<br><br> cat coordTempFile2 | while read line2; do<br><br>xcoor2=${line2 ... <br> ycoor2=${line2 ... <br>
<br> echo "$inputRoadLayer $xcoor1 $ycoor1 $xcoor2 $ycoor2" | v.net.path $input out=newpathTemp --o dmax=12000<br> g.copy vect=newpathTemp,newpath<br><br> echo "UPDATE newpath SET fcat = $nodeName1"|
db.execute<br> echo "UPDATE newpath SET tcat = $nodeName2"| db.execute<br><br> if [ $firsttime -eq 1 ]; <br> then g.copy vect=newpath,"$output" <br> g.remove vect=newpath
<br> echo "I have created a new path";<br> else <br> v.patch -a -e input=newpath out="$output" --o;<br> g.remove vect=newpath<br> echo "I have added path to collection";
<br><br> fi<br> done<br> firsttime=0 <br>done<br> -------------------------------------------------------------------------------------------------------------<br><br>the I would use v. report to get a text file with all distances.
<br>It works fine for a small number of nodes, for a larger number it stops after about 8000 calculations. <br>But anyway, maybe somebody can give me a hint of how to do that in a smarter way?<br><br>many thanks<br><span class="sg">
dziadgba<br><br><br><br><br><br><br><br><br><br><br><br></span>