<br><font size=2 face="sans-serif">&gt;&gt;Markus,</font><font size=3>
</font><font size=2 face="sans-serif"><br>
&nbsp; &nbsp; &nbsp; &nbsp;&gt;&gt; Were you planning on adding filtering
options by return number on v.in.lidar? &nbsp;It occurs to me that you
could speed things up by only processing the subset of the data that you
want to &gt;&gt;use. &nbsp; I could see it being a useful thing to create
a vector layer composed only of 1st returns ( top of canopy/buildings)
&nbsp;Selecting only last returns is useful, as well as selecting points
that &gt;&gt;are neither first nor last returns . &nbsp;</font><font size=3>
</font>
<br><font size=3>&gt;Yes, I was thinking of such filter options, they would
be very easy and straightforward to implement, something like v.in.lidar
returns=[all,first,last,middle]. Currently there is only spatial &gt;filtering
available.</font>
<br><font size=3>Excellent!<br>
<br>
&gt;I was also thinking about an option to select columns to be imported
as attributes, equivalent to the las2txt --parse option, but could not
yet come up with a user-friendly solution: flags &gt;don't work because
too many and conflicting with existing flags, a parse option very much
like the one of las2txt is too cryptic. I think I will settle for something
like v.in.lidar &gt;attributes=coords,classes,color,egde,angle,return,nreturns,...
where the attributes option takes none, one or multiple answers</font>
<br>
<br><font size=3>Sounds good. &nbsp;That would have the advantage of &quot;standardizing&quot;
the lidar attibute names for future lidar point processing modules in GRASS
<br>
<br>
&gt;Markus M</font>
<br>
<br><font size=2 face="sans-serif">Doug</font>
<br>
<br><font size=2 face="sans-serif">Doug Newcomb &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; <br>
USFWS<br>
Raleigh, NC<br>
919-856-4520 ext. 14 doug_newcomb@fws.gov<br>
---------------------------------------------------------------------------------------------------------<br>
The opinions I express are my own and are not representative of the official
policy of the U.S.Fish and Wildlife Service or Dept. of the Interior. &nbsp;
Life is too short for undocumented, proprietary data formats.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Markus Metz &lt;markus.metz.giswork@googlemail.com&gt;</b>
</font>
<p><font size=1 face="sans-serif">06/03/2011 10:36 AM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Doug_Newcomb@fws.gov</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">GRASS developers list &lt;grass-dev@lists.osgeo.org&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [GRASS-dev] ] LiDAR LAS import -
filter on import?</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3><br>
</font>
<br><font size=3>On Fri, Jun 3, 2011 at 3:30 PM, &lt;</font><a href=mailto:Doug_Newcomb@fws.gov><font size=3 color=blue><u>Doug_Newcomb@fws.gov</u></font></a><font size=3>&gt;
wrote:</font>
<br><font size=2 face="sans-serif"><br>
Markus,</font><font size=3> </font><font size=2 face="sans-serif"><br>
&nbsp; &nbsp; &nbsp; &nbsp; Were you planning on adding filtering options
by return number on v.in.lidar? &nbsp;It occurs to me that you could speed
things up by only processing the subset of the data that you want to use.
&nbsp; I could see it being a useful thing to create a vector layer composed
only of 1st returns ( top of canopy/buildings) &nbsp;Selecting only last
returns is useful, as well as selecting points that are neither first nor
last returns . &nbsp;</font><font size=3> <br>
</font>
<br><font size=3>Yes, I was thinking of such filter options, they would
be very easy and straightforward to implement, something like v.in.lidar
returns=[all,first,last,middle]. Currently there is only spatial filtering
available.<br>
<br>
I was also thinking about an option to select columns to be imported as
attributes, equivalent to the las2txt --parse option, but could not yet
come up with a user-friendly solution: flags don't work because too many
and conflicting with existing flags, a parse option very much like the
one of las2txt is too cryptic. I think I will settle for something like
v.in.lidar attributes=coords,classes,color,egde,angle,return,nreturns,...
where the attributes option takes none, one or multiple answers<br>
<br>
Markus M<br>
<br>
&nbsp;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; I've been
primarily working with aggregate las files that I have dumped to text (
via liblas las2txt ) &nbsp;and then parse via python for first, middle,
and last &nbsp;returns. I have not taken the time to learn C yet, but perhaps
the logic of these simple python programs would be useful .</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
The following is the python script I use to separate the last returns.</font><font size=3>
</font><font size=2 face="sans-serif"><br>
---------------------------------------------------------------------------------------------------------------------------------</font><font size=3>
</font><font size=2 face="Courier New"><br>
import struct,os,string,re,binascii,glob</font><font size=3> </font><font size=2 face="Courier New"><br>
infile = raw_input(&quot;Enter the aggregate lidar filename: &nbsp;&quot;)
<br>
outfil = raw_input(&quot;Enter the ASCII output filename for the Lidar
Data: &nbsp;&quot;)</font><font size=3> </font><font size=2 face="Courier New"><br>
intxt=open(infile,'r')</font><font size=3> </font><font size=2 face="Courier New"><br>
outtxt=open(outfil,'w')</font><font size=3> </font><font size=2 face="Courier New"><br>
while 1:</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; lasline=intxt.readline()</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; lasinfo=lasline.split(',')</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; if (len(lasinfo))&lt; 5:break</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; numreturns=int(lasinfo[4])</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; returnnum=int(lasinfo[5])</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; # In the data input file for this instance, the number of
returns</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; # is the fifth column, and the return number is the sixth
column ( x=1,y=2,z=3,intensity=4).</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; # If the value of these colums is equal, it should be the
last return.</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; if ( numreturns==returnnum):</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; &nbsp; &nbsp; outtxt.write(lasline)</font><font size=3> <br>
</font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; <br>
intxt.close()</font><font size=3> </font><font size=2 face="Courier New"><br>
outtxt.close()</font><font size=3> </font><font size=2 face="sans-serif"><br>
--------------------------------------------------------------------------------------------------------------------------------</font><font size=3>
</font><font size=2 face="sans-serif"><br>
For parsing the first returns, &nbsp;</font><font size=2 face="Courier New">substitute
if (returnnum==1):</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Here is the python script I use to separate out the &quot;middle&quot;
returns.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
-------------------------------------------------------------------------------------------------------------------------------</font><font size=3>
<br>
</font><font size=2 face="Courier New"><br>
import struct,os,string,re,binascii,glob</font><font size=3> </font><font size=2 face="Courier New"><br>
infile = raw_input(&quot;Enter the aggregate lidar filename: &nbsp;&quot;)
<br>
outfil = raw_input(&quot;Enter the ASCII output filename for the Lidar
Data: &nbsp;&quot;)</font><font size=3> </font><font size=2 face="Courier New"><br>
intxt=open(infile,'r')</font><font size=3> </font><font size=2 face="Courier New"><br>
outtxt=open(outfil,'w')</font><font size=3> </font><font size=2 face="Courier New"><br>
while 1:</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; lasline=intxt.readline()</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; lasinfo=lasline.split(',')</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; if (len(lasinfo))&lt; 5:break</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; numreturns=int(lasinfo[4])</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; returnnum=int(lasinfo[5])</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; # In the data input file for this instance, the number of
returns</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; # is the fifth column, and the return number is the sixth
column ( x=1,y=2,z=3,intensity=4).</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; # If the value of these colums is equal, it should be the
last return, so skip that entry</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; # If the return number is 1 , skip that value. &nbsp;All
other values are middle canopy values,which is what we want.</font><font size=3>
</font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; if ( numreturns==returnnum): continue</font><font size=3>
</font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; if (returnnum==1):continue</font><font size=3> </font><font size=2 face="Courier New"><br>
&nbsp; &nbsp; outtxt.write(lasline)</font><font size=3> </font><font size=2 face="Courier New"><br>
intxt.close()</font><font size=3> </font><font size=2 face="Courier New"><br>
outtxt.close()</font><font size=3> </font><font size=2 face="sans-serif"><br>
------------------------------------------------------------------------------------------------------------------------------</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
I really appreciate your adding lidar data classifications from the standard
into the program. &nbsp;I haven't actually seen any lidar data with classifications
yet, but I have hope for the future :-). </font><font size=3><br>
</font><font size=2 face="sans-serif"><br>
As a bit of background , I'm taking the last returns and then running r.in.xyz
to create a raster with the intensities as the z values to get relative
soil moistures, and looking at points that are neither first nor last returns
as a possible measure of vegetation density. &nbsp;It works great for large
datasets( &gt; 4 billion points) , but I'm feeling the need for more point
analysis.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Doug</font><font size=3> <br>
<br>
</font><font size=2 face="sans-serif"><br>
Doug Newcomb &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
USFWS<br>
Raleigh, NC</font><font size=2 color=blue face="sans-serif"><u><br>
</u></font><a href="tel:919-856-4520%20ext.%2014" target=_blank><font size=2 color=blue face="sans-serif"><u>919-856-4520
ext. 14</u></font></a><font size=2 face="sans-serif"> </font><a href=mailto:doug_newcomb@fws.gov target=_blank><font size=2 color=blue face="sans-serif"><u>doug_newcomb@fws.gov</u></font></a><font size=2 face="sans-serif"><br>
---------------------------------------------------------------------------------------------------------<br>
The opinions I express are my own and are not representative of the official
policy of the U.S.Fish and Wildlife Service or Dept. of the Interior. &nbsp;
Life is too short for undocumented, proprietary data formats.</font><font size=3>
<br>
<br>
</font>
<p>
<table width=100%>
<tr valign=top>
<td width=51%><font size=1 face="sans-serif"><b>Markus Metz &lt;</b></font><a href=mailto:markus.metz.giswork@googlemail.com target=_blank><font size=1 color=blue face="sans-serif"><b><u>markus.metz.giswork@googlemail.com</u></b></font></a><font size=1 face="sans-serif"><b>&gt;</b>
<br>
Sent by: </font><a href="mailto:grass-dev-bounces@lists.osgeo.org" target=_blank><font size=1 color=blue face="sans-serif"><u>grass-dev-bounces@lists.osgeo.org</u></font></a><font size=3>
</font>
<p><font size=1 face="sans-serif">06/03/2011 02:20 AM</font><font size=3>
</font>
<td width=48%>
<br>
<table width=100%>
<tr valign=top>
<td width=13%>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td width=86%><font size=1 face="sans-serif">Hamish &lt;</font><a href=mailto:hamish_b@yahoo.com target=_blank><font size=1 color=blue face="sans-serif"><u>hamish_b@yahoo.com</u></font></a><font size=1 face="sans-serif">&gt;</font><font size=3>
</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">GRASS developers list &lt;</font><a href="mailto:grass-dev@lists.osgeo.org" target=_blank><font size=1 color=blue face="sans-serif"><u>grass-dev@lists.osgeo.org</u></font></a><font size=1 face="sans-serif">&gt;</font><font size=3>
</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[GRASS-dev] Re: [GRASS-user] LiDAR LAS
import</font></table>
<br>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br><font size=3><br>
<br>
</font><tt><font size=2><br>
Hamish wrote:<br>
&gt; Markus Metz wrote:<br>
[snip]<br>
&gt;<br>
&gt;&gt; v.in.lidar is a notch faster than las2txt | v.in.ascii. And<br>
&gt;&gt; easier to use...<br>
&gt;<br>
&gt; I'm not too surprised the speed difference is not so huge, as<br>
&gt; unix pipes are very efficient. but the easier to use thing is<br>
&gt; very important.. both las2txt and v.in.ascii are a bundle of<br>
&gt; command line switches to get right.<br>
&gt;<br>
&gt;<br>
&gt;&gt; Speed comparisons:<br>
&gt;&gt;<br>
&gt;&gt; # sample las file with 1,287,775 points<br>
&gt;&gt;<br>
&gt;&gt; # with table and topology<br>
&gt; ...<br>
&gt;&gt; real&nbsp;&nbsp;&nbsp; 6m34.430s<br>
&gt; ...<br>
&gt;&gt; real&nbsp;&nbsp;&nbsp; 6m13.823s<br>
&gt; ...<br>
&gt;&gt; # without table, with topology<br>
&gt; ...<br>
&gt;&gt; real&nbsp;&nbsp;&nbsp; 1m53.578s<br>
&gt; ...<br>
&gt;&gt; real&nbsp;&nbsp;&nbsp; 1m44.876s<br>
&gt;<br>
&gt;<br>
&gt; I take it that without topology it runs in just seconds?<br>
<br>
Update: no attribute table, no topology<br>
<br>
time las2txt -i points.las --stdout --parse xyz --delimiter &quot;|&quot;
|<br>
v.in.ascii in=- out=points_ascii -ztb x=1 y=2 z=3<br>
<br>
real &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0m20.932s<br>
user &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0m18.424s<br>
sys &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0m6.869s<br>
<br>
<br>
time v.in.lidar in=points.las out=points_las -obt<br>
<br>
real &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0m9.117s<br>
user &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0m2.946s<br>
sys &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0m5.985s<br>
<br>
<br>
Markus M<br>
_______________________________________________<br>
grass-dev mailing list</font></tt><tt><font size=2 color=blue><u><br>
</u></font></tt><a href="mailto:grass-dev@lists.osgeo.org" target=_blank><tt><font size=2 color=blue><u>grass-dev@lists.osgeo.org</u></font></tt></a><font size=3 color=blue><u><br>
</u></font><a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target=_blank><tt><font size=2 color=blue><u>http://lists.osgeo.org/mailman/listinfo/grass-dev</u></font></tt></a><font size=3><br>
</font>
<br>
<br>