Hi Wesley,<br>
<br>
as Hamish points out r.in.xyz is the way to go. I have been working
with large lidar data files over forest for a couple of months now and
find the intersection between the ground and the vegetation to create
the Digital Canopy Height Model - quite time consuming. Here is my
basic workflow<br>
<br>
# read in the ground using v.in.ascii with topology turned off<br>
v.in.ascii -tzbr input=grd.txt&nbsp; output=grd_pts x=2 y=3 z=4 fs=&quot; &quot;<br>
# create the ground surface using v.surf.rast (this is useful when you have irregularly spaced strikes under dense canopies)<br>
v.surf.rst grd_pts elev=grd_dtm npmin=120 segmax=25 layer=0<br>
<br>
# create a flat vegetation file with non-ground strikes intersecting the DTM (this can be quite time consuming)<br>
# I use awk to calculate the difference between the canopy elevation and ground elevation = canopy height<br>
cat AreaThreeNonGround.xyz&nbsp; | r.what in=grd_dtm | awk &#39;print $1, $2, $3, $4, $5, $3-$5)&#39; | veg.txt<br>
<br>
#I then use r.in.xyz to calculate statistics of binned data from the flat vegetation file<br>
g.region res=10<br>
#calculate the mean vegetation height greater than 0.5m for a 10m cell<br>
r.in.xyz input=veg.txt output=mean_10m method=mean type=FCELL fs=&#39;|&#39; x=1 y=2 z=6 zrange=0.5,200 percent=100<br>
#calculate the 90th vegetation height percentile<br>

r.in.xyz input=veg.txt output=mean_p90_10m method=percentile pth=90 type=FCELL fs=&#39;|&#39; x=1 y=2 z=6 zrange=0.5,200 percent=100<br>
...<br>
...<br>

<br>
## I think the r.in.xyz has most of the statistics that you would like to use.<br>
## reading in the point cloud into R can be quite memory intensive<br>
## but it is fun to do<br>
<br>
<br>
cheers<br>
<br>
Andy<br><br><div class="gmail_quote">On Thu, Jun 19, 2008 at 3:44 AM, Hamish &lt;<a href="mailto:hamish_b@yahoo.com">hamish_b@yahoo.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Wesley,<br>
<div class="Ih2E3d"><br>
&gt; I have some LiDAR data of a forested area and I am trying<br>
&gt; to calculate tree heights / canopy heights based first and<br>
&gt; second return points (pre-filtered ground and non-ground).<br>
&gt; I have two questions that I hope some of you may be able to<br>
&gt; help me with. Firstly I have windowed / clipped my data to a<br>
&gt; small &#39;test&#39; region with about 150 000 non-ground<br>
&gt; and 100 000 ground points.<br>
&gt;<br>
&gt; 1. I have interpolated the ground points using idw in grass<br>
&gt; and have taken that as my ground surface. I would now like<br>
&gt; to assign an extra column to my non-ground vector file and<br>
&gt; populate it with the raster values of the DSM to calculate<br>
&gt; actual point height above ground (points are currently in<br>
&gt; meters above sea-level). Traditionally, one would just<br>
&gt; create a digital surface model and a canopy model and<br>
&gt; subtract the two to get tree canopy height. I would like to<br>
&gt; do the subtraction in the database and then interpolate the<br>
&gt; result. I am trying to do this with v.rast.stats and it is<br>
&gt; taking a really long time. How can I speed this up? Reading<br>
&gt; the help page I also see that the vector data are rasterised<br>
&gt; and values are assigend based on categories. I dont want<br>
&gt; categories, I am just interested in the raster value<br>
&gt; directly below each point? Is v.rast.stats the correct<br>
&gt; application to use?<br>
<br>
</div>No, r.in.xyz is. ;) &nbsp;Well at least it is much less trouble to work with.<br>
<br>(or if you want to stick with your current method, use v.what.rast
instead of v.rast.stats to pick off single points at the data point;
and v.surf.rst might make a nicer surface than IDW, at the risk of
overshoots)<br>
<div class="Ih2E3d"><br>
<br>
&gt; 2. While the above mentioned data set is fairly small my<br>
&gt; largest data set is around 700MB with<br>
&gt;<br>
&gt; wc -l &nbsp;= &nbsp;20602625 AreaThreeNonGround.xyz<br>
&gt;<br>
&gt; If I import using v.in.ascii without a db and topology will<br>
&gt; I still be able to manipulate the vector data as described<br>
&gt; above<br>
<br>
</div>without a DB you can not populate a DB..<br>
v.surf.* have been modified to work even without topology, just for this case.<br>
<br>
r.in.xyz should handle 700MB input|20m points without complaint.<br>
<div class="Ih2E3d"><br>
<br>
&gt; and will I be able to use R scripts and functions on<br>
&gt; the data set?<br>
<br>
</div>don&#39;t know.<br>
<div class="Ih2E3d"><br>
&gt; Apologies for the long mail, I hope it is not too<br>
&gt; confusing.<br>
&gt;<br>
&gt; Many thanks and looking forward to your comments and<br>
&gt; suggestions.<br>
<br>
</div>hopefully r.in.xyz solves your problems, it is updated with more
statistics and features in GRASS 6.3.0 if you can get your hands on
that.<br>
<font color="#888888"><br>
<br>
Hamish<br>
</font><div><div class="Wj3C7c"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</div></div></blockquote></div>