[GRASSLIST:419] Re: a huge matrix ?
orkun
temiz at deprem.gov.tr
Wed Jun 18 03:51:07 EDT 2003
H Bowman wrote:
>>>The most straightforward approach (although not particularly
>>>efficient), would be to use an iterative approach, i.e.
>>>
>>> n=0
>>> last='null()'
>>> while read a1 a2 a3 a4 a5 a6 a7 a8 ; do
>>> result=pr2.pass$n
>>> r.mapcalc "$result = if (f28geo5==$a1 && f28slpcat==$a2 && f28concavity==$a3 && n_facing==$a4 && road_bas==$a5 &&str_buf==$a6 && f28f4==$a7, $a8, $last)"
>>> last=$result
>>> done < rules.txt
>>>
>>>where rules.txt looks like:
>>>
>>> 21 6 1 1 1 1 0 701.22
>>> 7 4 2 1 1 2 1 702.06
>>> ...
>>>
>>>
>>>
>>Firstly I intend to try your iterative way.
>>In that, doesn't n have any increament ?
>>something like n=n+1 in the loop.
>>If so,Doesn't it mean creating a new map - totally 10500 map- in every
>>iteration
>>
>>
>
>Not sure if this is what you are after, but as a general iterative bash scripting template:
>
>n=0
>r.mapcalc patchmap="null()"
>while read a1 a2 a3 a4 a5 a6 a7 a8 ; do
> echo "Pass $n .."
> r.mapcalc ...
> r.patch out=patchmap in=patchmap,pr2.pass$n (?? r.mapcalc sum=sum+new ..)
> g.remove rast=pr2.pass$n
> n=`expr $n + 1`
>done
>
>
>actually for that n isn't needed, but still a good idea.
>
>
>Hamish
>
>
>
>
thank you
adding maps then deleting maps created previously is very good idea to
maintain harddisk space.
kind regards
______________________________________
Scanned and protected by Inflex
http://pldaniels.com/inflex
______________________________________
The views and opinions expressed in this e-mail message are the sender's own
and do not necessarily represent the views and the opinions of Earthquake Research Dept.
of General Directorate of Disaster Affairs.
Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olarak T.C.
B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikte degildir.
More information about the grass-user
mailing list