<div dir="ltr">Bringing a side conversation on testing the filtering features  v.in.lidar and r.in.lidar  into the dev list. <div><br></div><div> As I recall, Hamish had something similar working in r.in.xyz with regard to filtering by z value, but analyzing another variable.</div><div><br></div><div>Doug<br><div><br></div><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Newcomb, Doug</b> <span dir="ltr"><<a href="mailto:doug_newcomb@fws.gov">doug_newcomb@fws.gov</a>></span><br>Date: Tue, Sep 23, 2014 at 1:30 PM<br>Subject: Re: [GRASS-dev] v.in.lidar return filter<br>To: Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>><br><br><br><div dir="ltr">Markus,<div>Here is the result of subtracting the max elevation from the dsm created from the first returns using v.surt.rst (Height are in feet) . The raster resolution is 20ft, but I generated the dsm with a 3 ft minimum point distance.  I would expect the max height to be higher in most cases.</div><div><br></div><div>It looks like the 1st returns are being filtered correctly.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div>Doug</div><div> </div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 23, 2014 at 12:57 PM, Newcomb, Doug <span dir="ltr"><<a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Working with a test lidar data set from NC mountains ( better quality) .  Imported 2.6million points using v.in.lidar for all points .  Then went back and just imported first returns.  Got a reasonable number , so I'm creating a DSM from the 1st returns and will compare it to same resolution r.in.lidar for max.    <div><br></div><div>Filtering by return number and processing for intensity on first, mid, and last returns seems to do a good job on contrasting coniferous vs deciduous at the top of canopy, midstory, and groundcover look interesting too!  </div><div><br></div><div>When I tried to filter  for Z value of elevation 2000-7000 ft, I got nodata on the entire layer.  When I changed the Z range to 50 - 200 , I got some data with some nodata.</div><div><br></div><div> I'm guessing that the Z value filter is working on the intensity values instead of the Z values.</div><span><font color="#888888"><div><br></div><div>Doug</div><div><br></div><div><br></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 23, 2014 at 11:33 AM, Markus Neteler <span dir="ltr"><<a href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Anna just fixed it in trunk.<br>
Please try...<br>
<div><div><br>
<br>
<br>
On Tue, Sep 23, 2014 at 4:51 PM, Newcomb, Doug <<a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a>> wrote:<br>
> not yet, I was just speculating from looking at the  source.  I will try to<br>
> compile from edits to svn this afternoon.   If it works, I'll send a diff.<br>
><br>
> Doug<br>
><br>
><br>
><br>
> On Tue, Sep 23, 2014 at 10:18 AM, Markus Neteler <<a href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>> wrote:<br>
>><br>
>> Did you modify your local file? If yes, could you pls send me a diff<br>
>> against SVN or the full file? Then merging is easier...<br>
>><br>
>> thanks<br>
>> Markus<br>
>><br>
>> On Tue, Sep 23, 2014 at 2:19 PM, Newcomb, Doug <<a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a>><br>
>> wrote:<br>
>> > It looks like the same patch needs to be applied to r.in.lidar main.c<br>
>> > before<br>
>> > line 791. So modifying to the following for both v.in.lidar and<br>
>> > r.in.lidar<br>
>> > main.c should fix both?<br>
>> ><br>
>> > if (n_returns == 1) {<br>
>> ><br>
>> > switch (return_filter) {<br>
>> > case LAS_FIRST:<br>
>> >     if (return_no == 1)<br>
>> > skipme = 0;<br>
>> >     break;<br>
>> >               }<br>
>> > if (n_returns > 1) {<br>
>> ><br>
>> > switch (return_filter) {<br>
>> > case LAS_FIRST:<br>
>> >    if (return_no == 1)<br>
>> > skipme = 0;<br>
>> >    break;<br>
>> > case LAS_LAST:<br>
>> >    if (return_no == n_returns)<br>
>> > skipme = 0;<br>
>> >    break;<br>
>> > case LAS_MID:<br>
>> >    if (return_no > 1 && return_no < n_returns)<br>
>> > skipme = 0;<br>
>> >    break;<br>
>> > }<br>
>> ><br>
>> > Doug<br>
>> ><br>
>> ><br>
>> > On Tue, Sep 23, 2014 at 8:05 AM, Newcomb, Doug <<a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a>><br>
>> > wrote:<br>
>> >><br>
>> >> I don't think it was intentional to drop first and only returns, but if<br>
>> >> it<br>
>> >> is the first and only return the filter for First and Last Return would<br>
>> >> both<br>
>> >> match.<br>
>> >> Putting another if statement in front along the lines of  if(n_returns<br>
>> >> ==<br>
>> >> 1) set case LAS_FIRST should fix it.<br>
>> >><br>
>> >> Doug<br>
>> >><br>
>> >><br>
>> >> On Mon, Sep 22, 2014 at 6:54 PM, Anna Petrášová <<a href="mailto:kratochanna@gmail.com" target="_blank">kratochanna@gmail.com</a>><br>
>> >> wrote:<br>
>> >>><br>
>> >>> Hi,<br>
>> >>><br>
>> >>> I want to import first return points with v.in.lidar, but I get only<br>
>> >>> points where the pulse had more then one return. So it gives me trees<br>
>> >>> but<br>
>> >>> not ground or buildings. I looked in the code and there is an 'if'<br>
>> >>> which<br>
>> >>> skips points with only 1 return:<br>
>> >>><br>
>> >>><br>
>> >>> <a href="http://trac.osgeo.org/grass/browser/grass/trunk/vector/v.in.lidar/main.c#L672" target="_blank">http://trac.osgeo.org/grass/browser/grass/trunk/vector/v.in.lidar/main.c#L672</a><br>
>> >>><br>
>> >>> So the behavior looks intentional but what's the reason?<br>
>> >>><br>
>> >>> Thanks,<br>
>> >>><br>
>> >>> Anna<br>
>> >>><br>
>> >>> _______________________________________________<br>
>> >>> grass-dev mailing list<br>
>> >>> <a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
>> >>> <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
>> >><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Doug Newcomb<br>
>> >> USFWS<br>
>> >> Raleigh, NC<br>
>> >> 919-856-4520 ext. 14 <a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a><br>
>> >><br>
>> >><br>
>> >> ---------------------------------------------------------------------------------------------------------<br>
>> >> The opinions I express are my own and are not representative of the<br>
>> >> official policy of the U.S.Fish and Wildlife Service or Dept. of the<br>
>> >> Interior.   Life is too short for undocumented, proprietary data<br>
>> >> formats.<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Doug Newcomb<br>
>> > USFWS<br>
>> > Raleigh, NC<br>
>> > 919-856-4520 ext. 14 <a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a><br>
>> ><br>
>> > ---------------------------------------------------------------------------------------------------------<br>
>> > The opinions I express are my own and are not representative of the<br>
>> > official<br>
>> > policy of the U.S.Fish and Wildlife Service or Dept. of the Interior.<br>
>> > Life<br>
>> > is too short for undocumented, proprietary data formats.<br>
>> ><br>
>> > _______________________________________________<br>
>> > grass-dev mailing list<br>
>> > <a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
>> > <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Doug Newcomb<br>
> USFWS<br>
> Raleigh, NC<br>
> 919-856-4520 ext. 14 <a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a><br>
> ---------------------------------------------------------------------------------------------------------<br>
> The opinions I express are my own and are not representative of the official<br>
> policy of the U.S.Fish and Wildlife Service or Dept. of the Interior.   Life<br>
> is too short for undocumented, proprietary data formats.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Doug Newcomb</div><div>USFWS</div><div>Raleigh, NC</div><div>919-856-4520 ext. 14 <a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a></div><div>---------------------------------------------------------------------------------------------------------</div><div>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.</div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Doug Newcomb</div><div>USFWS</div><div>Raleigh, NC</div><div>919-856-4520 ext. 14 <a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a></div><div>---------------------------------------------------------------------------------------------------------</div><div>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.</div>
</div>
</div></div></div><br><br clear="all"><div><br></div>-- <br><div>Doug Newcomb</div><div>USFWS</div><div>Raleigh, NC</div><div>919-856-4520 ext. 14 <a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a></div><div>---------------------------------------------------------------------------------------------------------</div><div>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.</div>
</div></div></div>