<div>Hi Wesley,</div>
<div>&nbsp;</div>
<div>I have recently analysed some lidar data in GRASS and have used Hamish&#39;s r.in.xyz module. Its a pretty useful tool to bin up lidar data.</div>
<div>cheers</div>
<div>&nbsp;</div>
<div>Andy<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 8/28/08, <b class="gmail_sendername">Maciej Sieczka</b> &lt;tutey@o2.pl&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Wesley Roberts pisze:<span class="q"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I have written a bash script to extract the maximum LiDAR height<br>value within a predefined sample site (Vector with 314 sample<br>
locations each 10m squared). The script is below. Essentially I use<br>v.extract to select one of my 314 sample sites (Flight_sample2). This<br>temporary vector is then used to select all LiDAR points falling<br>within its boundaries using v.select. Following this I use v.univar<br>
to calculate summary statistics of the points selected which is then<br>written to temp_file. sed and awk are then used to extract the<br>maximum height value which is then used to update (v.db.update) the<br>original flight sample file.<br>
</blockquote><br></span>Wesley,<br><br>Each db.execute call is expensive (v.db.update is a wrapper for db.execute).<br><br>Remove v.db.update from the loop. Replace it with a command that<br>will create corresponding SQL statements, and store them in a text file.<br>
<br>Outside the loop pipe the file into db.execute. This will do the whole<br>update in one run. Should save plenty of time. There&#39;s an example in<br>db.execute manual.<br><br>You can also use &quot;v.univar -g&quot; - shell script output style. It is easier<br>
to parse. Thus instead:<span class="q"><br><br>&nbsp;v.univar map=b_sam_$x type=point column=dbl_5 layer=1 &gt; temp_file<br>&nbsp;a=`sed -n &#39;5p&#39; temp_file | awk &#39;{print $2}&#39;<br><br></span>you can put:<br><br>&nbsp;eval `v.univar -g map=b_sam_$x type=point column=dbl_5 layer=1`<br>
<br>and then variable &#39;max&#39; automagically stores your maximum value.<br><br>Maciek<br><span class="sg"><br>-- <br>Maciej Sieczka<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.sieczka.org/" target="_blank">www.sieczka.org</a></span> 
<div><span class="e" id="q_11c08c324202a747_6"><br>_______________________________________________<br>grass-user mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></span></div></blockquote></div>
<br>