<html><body bgcolor="#FFFFFF"><div>I highly recommend trying the r.in.xyz module. &nbsp; It has max value extraction options. &nbsp;It is quite remarkable. &nbsp;&nbsp;</div><div><br>Mark<div><br></div></div><div><br>On Aug 28, 2008, at 7:00 PM, "andrew haywood" &lt;<a href="mailto:ahaywood3@gmail.com">ahaywood3@gmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div><div>Hi Wesley,</div>
<div>&nbsp;</div>
<div>I have recently analysed some lidar data in GRASS and have used Hamish'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;<a href="mailto:tutey@o2.pl">tutey@o2.pl</a>> 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's an example in<br>db.execute manual.<br><br>You can also use "v.univar -g" - 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 > temp_file<br>&nbsp;a=`sed -n '5p' temp_file | awk '{print $2}'<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 'max' 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"><a href="http://www.sieczka.org">www.sieczka.org</a></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"><a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a></a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank"><a href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a></a><br></span></div></blockquote></div>
<br>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>grass-user mailing list</span><br><span><a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a></span><br><span><a href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a></span><br></div></blockquote></body></html>