lasthin

366 views
Skip to first unread message

Andrew

unread,
Oct 5, 2011, 3:36:54 PM10/5/11
to LAStools - efficient tools for LIDAR processing
Hi Martin,

While using lasthin.exe today I was using a command line similar to
the following:


lasthin.exe -i file.las -keep_random_fraction 0.2 -o file_thinned.las


My original file contained around 18.8 million points. By applying "-
keep_random_fraction 0.2" I was expecting around 3.76 million points
in the output file (ie. 18.8 million * 0.2).

What I found was that the original file had 18,839,002 points and the
output generated by that command line contained 753,304 points. As a
fraction this is 0.04 times the number of points as the original file.
I note that 0.04 is 0.2 squared.

Perhaps I have misunderstood how the "-keep random_fraction" option is
working. Could you please explain in more detail how this parameter
works when running lasthin?

Thanks
Andrew



Martin Isenburg

unread,
Oct 5, 2011, 4:17:49 PM10/5/11
to LAStools - efficient tools for LIDAR processing
hello andrew,

the functionality "-keep_random_fraction 0.2" is implemented as a
LASfilter that is available to pretty much all LAStools that consume
LAS/LAZ points. Instead of using lasthin you should simply use, for
example, las2las.

>las2las -i file.las -keep_random_fraction 0.2 -o file_thinned.las -v
reading 10000000 and writing all surviving points ...
total time: 64.515 sec. written 1999997 surviving points.

lasthin uses a grid to thin and keeps only the lowest (or highest)
points of each grid cell. but lasthin will also apply the "-
keep_random_fraction 0.2" filter which means that in general you will
not quite get the result you want as only the surviving 1999997 points
will be considered when looking for the lowest (or highest) points of
each grid cell so that many grid cells may remain empty or won't
contain the lowest point.

>lasthin -i file.las -keep_random_fraction 0.2 -o file_thinned.las -v
Please license from 'martin....@gmail.com' to use LAStools
commercially.
grid_spacing was unspecified. we set it to 1.
thinning points onto 2406 by 2192 grid (grid_spacing = 1.00 units)
first pass reading 10000000 points ...
took 52.375 sec.
there are 1573646 surviving points. grid saturation is 29.84 percent.
second pass reading 10000000 and writing 1573646 points ...
took 56.578 sec and wrote 9304962 bytes to thin 'file.las'.

for lasthin the "thinning" is controlled via the '-step 1' flag that
controls the grid spacing:

>lasthin -i out0000.las -o out_thinned.las -step 1 -v
Please license from 'martin....@gmail.com' to use LAStools
commercially.
thinning points onto 2406 by 2192 grid (grid_spacing = 1.00 units)
first pass reading 10000000 points ...
took 50.671 sec.
there are 4279937 surviving points. grid saturation is 81.15 percent.
second pass reading 10000000 and writing 4279937 points ...
took 70.61 sec and wrote 119844734 bytes to thin 'file.las'.

Cheers,

Martin @lastools
Reply all
Reply to author
Forward
0 new messages