Lasthin - abnormal program termination

145 views
Skip to first unread message

Michiel Gielen

unread,
Apr 18, 2014, 10:19:29 AM4/18/14
to last...@googlegroups.com
Hi,

for my master thesis I'm comparing the effects of point density on point-cloud processing software.
Therefore need to thin out a point cloud I received, so I could simulate a thinner cloud.

To thin out this cloud I'm using the Lasthin function, but when I use smaller values for the grid parameter, like 0.02 for instance,
I keep getting abnormal program termination.

Do you have any idea where this problem comes from?

Kind regards

Martin Isenburg

unread,
Apr 23, 2014, 12:13:31 PM4/23/14
to LAStools - efficient command line tools for LIDAR processing
Hello,

in the meantime I have exchanged a few emails with Michiel and he send a bit more detail on his input and on the console output (see attached screenshot). Here i becomes evident that although thinning 286 million points is a piece of cake for lasthin, his LiDAR extends across an area of about 2.1 km by 7.9 km. Overlaying this with a 5 cm resolution grid (aka '-step 0.05') means that internally a grid with an approximate size of 42000 x 158000 needs to be managed and that causes a (not-so-nice) memory crash.

A work-around uses the batch script below that first tiles the LiDAR, thins each tile on multiple cores, and then merges them back together. This script will also be part of the next LAStools release. You may need to modify the script slightly to fit your configuration and your data. Note that this script does not preserve the original order of the points. If you need to preserve the original order of the points look for how it this done using the '-reversible' option in the very similar "huge_las_file_delete_duplicates.bat" script.

Regards,

Martin @rapidlasso

--
http://rapidlasso.com - fast tools to batch your LiDARs

===============================

::
:: an example batch script for thinning a single huge LAS/LAZ file
:: with a very very fine grid
::

echo off

::
:: specify parameters
::

:: allows you to run the script from other folders
set PATH=%PATH%;D:\lastools\bin;

:: specify the resolution of the thinning grid
set STEP=0.05

:: specify the size of the temporary tiles. it is important that
:: the tile size can be evenly divided by the grid resolution
:: meaning that TILE_SIZE/STEP is XXXX.0 without decimal digits 
set TILE_SIZE=500

:: specify the number of cores to run on
set NUM_CORES=3

:: specify the name for temporary directory
set TEMP_DIR=temp_dir_thinning

::
:: do the actual processing
::

:: create temporary tile directory

rmdir %TEMP_DIR% /s /q
mkdir %TEMP_DIR%

:: create a temporary tiling with TILE_SIZE

lastile -i %1 ^
        -tile_size %TILE_SIZE% ^
        -o %TEMP_DIR%\tile.laz -olaz

:: thins the tiles on NUM_CORES

lasthin -i %TEMP_DIR%\tile*.laz ^
        -step %STEP% -lowest ^
        -odix _thinned -olaz ^
        -cores %NUM_CORES%

:: recreate the (less huge) thinned LAS / LAZ file

lasmerge -i %TEMP_DIR%\tile*_thinned.laz ^
         -o %1 -odix _thinned

:: delete the temporary tile directory

rmdir %TEMP_DIR% /s /q


huge_las_file_thin_with_fine_grid.bat.txt
lasthin_crash_screenshot.png
Reply all
Reply to author
Forward
0 new messages