<br><font size=2 face="sans-serif">>>Markus,</font><font size=3>
</font><font size=2 face="sans-serif"><br>
>> Were you planning on adding filtering
options by return number on v.in.lidar? It occurs to me that you
could speed things up by only processing the subset of the data that you
want to >>use. I could see it being a useful thing to create
a vector layer composed only of 1st returns ( top of canopy/buildings)
Selecting only last returns is useful, as well as selecting points
that >>are neither first nor last returns . </font><font size=3>
</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.</font>
<br><font size=3>Excellent!<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</font>
<br>
<br><font size=3>Sounds good. That would have the advantage of "standardizing"
the lidar attibute names for future lidar point processing modules in GRASS
<br>
<br>
>Markus M</font>
<br>
<br><font size=2 face="sans-serif">Doug</font>
<br>
<br><font size=2 face="sans-serif">Doug Newcomb
<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.
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 <markus.metz.giswork@googlemail.com></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 <grass-dev@lists.osgeo.org></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, <</font><a href=mailto:Doug_Newcomb@fws.gov><font size=3 color=blue><u>Doug_Newcomb@fws.gov</u></font></a><font size=3>>
wrote:</font>
<br><font size=2 face="sans-serif"><br>
Markus,</font><font size=3> </font><font size=2 face="sans-serif"><br>
Were you planning on adding filtering options
by return number on v.in.lidar? It occurs to me that you could speed
things up by only processing the subset of the data that you want to use.
I could see it being a useful thing to create a vector layer composed
only of 1st returns ( top of canopy/buildings) Selecting only last
returns is useful, as well as selecting points that are neither first nor
last returns . </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>
</font>
<br><font size=2 face="sans-serif"> I've been
primarily working with aggregate las files that I have dumped to text (
via liblas las2txt ) and then parse via python for first, middle,
and last 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("Enter the aggregate lidar filename: ")
<br>
outfil = raw_input("Enter the ASCII output filename for the Lidar
Data: ")</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>
lasline=intxt.readline()</font><font size=3> </font><font size=2 face="Courier New"><br>
lasinfo=lasline.split(',')</font><font size=3> </font><font size=2 face="Courier New"><br>
if (len(lasinfo))< 5:break</font><font size=3> </font><font size=2 face="Courier New"><br>
numreturns=int(lasinfo[4])</font><font size=3> </font><font size=2 face="Courier New"><br>
returnnum=int(lasinfo[5])</font><font size=3> </font><font size=2 face="Courier New"><br>
# In the data input file for this instance, the number of
returns</font><font size=3> </font><font size=2 face="Courier New"><br>
# 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>
# 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>
if ( numreturns==returnnum):</font><font size=3> </font><font size=2 face="Courier New"><br>
outtxt.write(lasline)</font><font size=3> <br>
</font><font size=2 face="Courier New"><br>
<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, </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 "middle"
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("Enter the aggregate lidar filename: ")
<br>
outfil = raw_input("Enter the ASCII output filename for the Lidar
Data: ")</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>
lasline=intxt.readline()</font><font size=3> </font><font size=2 face="Courier New"><br>
lasinfo=lasline.split(',')</font><font size=3> </font><font size=2 face="Courier New"><br>
if (len(lasinfo))< 5:break</font><font size=3> </font><font size=2 face="Courier New"><br>
numreturns=int(lasinfo[4])</font><font size=3> </font><font size=2 face="Courier New"><br>
returnnum=int(lasinfo[5])</font><font size=3> </font><font size=2 face="Courier New"><br>
# In the data input file for this instance, the number of
returns</font><font size=3> </font><font size=2 face="Courier New"><br>
# 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>
# 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>
# If the return number is 1 , skip that value. All
other values are middle canopy values,which is what we want.</font><font size=3>
</font><font size=2 face="Courier New"><br>
if ( numreturns==returnnum): continue</font><font size=3>
</font><font size=2 face="Courier New"><br>
if (returnnum==1):continue</font><font size=3> </font><font size=2 face="Courier New"><br>
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. 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. It works great for large
datasets( > 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 <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.
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 <</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>></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 <</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">></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 <</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">></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>
> Markus Metz wrote:<br>
[snip]<br>
><br>
>> v.in.lidar is a notch faster than las2txt | v.in.ascii. And<br>
>> easier to use...<br>
><br>
> I'm not too surprised the speed difference is not so huge, as<br>
> unix pipes are very efficient. but the easier to use thing is<br>
> very important.. both las2txt and v.in.ascii are a bundle of<br>
> command line switches to get right.<br>
><br>
><br>
>> Speed comparisons:<br>
>><br>
>> # sample las file with 1,287,775 points<br>
>><br>
>> # with table and topology<br>
> ...<br>
>> real 6m34.430s<br>
> ...<br>
>> real 6m13.823s<br>
> ...<br>
>> # without table, with topology<br>
> ...<br>
>> real 1m53.578s<br>
> ...<br>
>> real 1m44.876s<br>
><br>
><br>
> 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 "|"
|<br>
v.in.ascii in=- out=points_ascii -ztb x=1 y=2 z=3<br>
<br>
real 0m20.932s<br>
user 0m18.424s<br>
sys 0m6.869s<br>
<br>
<br>
time v.in.lidar in=points.las out=points_las -obt<br>
<br>
real 0m9.117s<br>
user 0m2.946s<br>
sys 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>