when to use lasindex

470 views
Skip to first unread message

Kirschbaum, Alan

unread,
Aug 10, 2017, 3:24:56 PM8/10/17
to last...@googlegroups.com
Hello-

Martin mentioned in an earlier post that it is necessary to run lasindex in order to fully utilize the -cores switch. How often do you need to implement lasindex while chaining together multiple tools? For example, do I need to use lasindex after lastile AND after I run lasheight? 

Below is an example script. 

Thanks for the suggestions and pointers.

-al


set PATH=%PATH%;C:\LAStools\bin;

set STEP=100
set CORES=6

set BLOCK=f:\BayfieldCounty_lidar_forestry_metrics\LAStools\Slices

lastile -i -v f:\BayfieldCo_WI_LIDAR\Classified_LAZ\*.laz ^
    -drop_scan_angle_above 15 ^
    -drop_scan_angle_below -15 ^
    -tile_size 2000 -buffer 300 ^
    -keep_class 1 2 ^
    -odir %BLOCK%\laz_tiled -olaz ^
    -cores %CORES%

lasindex -i -v %BLOCK%\laz_tiled\*.laz ^
    -cores %CORES%

lasheight -i -v %BLOCK%\laz_tiled\*.laz ^
    -replace_z ^
    -classify_below -2 7 ^
    -classify_above 150 7 ^
    -odir %BLOCK%\tiles_normalized -olaz ^
    -cores %CORES%

lasindex -i -v %BLOCK%\tiles_normalized\*.laz ^
    -cores %CORES%

lascanopy -i -v %BLOCK%\tiles_normalized\*.laz ^
    -cover_cutoff 1.0 ^
    -cov -dns ^
    -height_cutoff 2.0 ^
    -d 2 5 10 20 30 40 50 60 70 80 90 100 ^
    -p 5 10 25 50 75 90 ^
    -max -avg -std -kur -qav ^
    -b 50 75 90 ^
    -use_tile_bb ^
    -step %STEP% ^
    -odir %BLOCK%\tiles_sliced -oimg ^
    -cores %CORES%

Al Kirschbaum
Remote Sensing Specialist
National Park Service
Great Lakes Inventory and Monitoring Network
2800 Lake Shore Drive East, Suite D
Ashland, WI 54806
715.682.0631 x227
al_kir...@nps.gov

Martin Isenburg

unread,
Aug 12, 2017, 8:50:42 AM8/12/17
to LAStools - efficient command line tools for LIDAR processing
Hello Alan,

I have improved your workflow to what you see below. The *most* important improvement is to run lasindex *before* lastile in case you want to run lastile with multiple cores. There are two good choices for lastile:

1) run lastile on a single core
2) first run lasindex and then run lastile on multiple cores

but running lastile with multiple cores *without* having spatially indexed LiDAR is a very bad option. That will generally be much slower than simply running lastile on a single core. Without spatial indexing each core will have to reach most of the LiDAR and you drown in I/O overload. For the combination of lastile with multiple cores the spatial indexing information is crucial. I should let the lastile tool issue a warning in future versions.

Once you have buffered tiles there is no more need for spatial indexing because each tile gets processed on its own (without querying the data along the edges from neighbor tiles) and because there is no spatial area-of-interest query happening (each tile gets loaded and processed completely. Hence the later calls to lasindex gave no performance gains at all.

When does lasindex give performance gains?

(a) during multi-core tiling
(b) during on-the-fly buffering with '-buffered 200'
(c) during area-of-interest queries with '-inside xxx xxx xxx xxx' calls
(d) during clipping operations (e.g. lasclip, lascanopy with 'lop')
(e) when picking a rectangular area in the LAStools GUIs
(f) typical clip, zip, ship server operations like:

las2las -i server2\area34\*.laz -merged ^
            -inside 203525 5354475 205575 5357525 ^
            -o download\user_request_002635.laz

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

set PATH=%PATH%;C:\LAStools\bin;

set STEP=100
set CORES=6

set BLOCK=f:\BayfieldCounty_lidar_forestry_metrics\LAStools\Slices

lasindex -i -v f:\BayfieldCo_WI_LIDAR\Classified_LAZ\*.laz ^
    -cores %CORES%

lastile -i -v f:\BayfieldCo_WI_LIDAR\Classified_LAZ\*.laz ^
    -drop_scan_angle_above 15 ^
    -drop_scan_angle_below -15 ^
    -tile_size 2000 -buffer 300 ^
    -keep_class 1 2 ^
    -odir %BLOCK%\laz_tiled -olaz ^
    -cores %CORES%

lasheight -i -v %BLOCK%\laz_tiled\*.laz ^
    -replace_z ^
    -classify_below -2 7 ^
    -classify_above 150 7 ^
    -odir %BLOCK%\tiles_normalized -olaz ^
    -cores %CORES%

lascanopy -i -v %BLOCK%\tiles_normalized\*.laz ^
    -drop_class 7 ^
    -cover_cutoff 1.0 ^
    -cov -dns ^
    -height_cutoff 2.0 ^
    -d 2 5 10 20 30 40 50 60 70 80 90 100 ^
    -p 5 10 25 50 75 90 ^
    -max -avg -std -kur -qav ^
    -b 50 75 90 ^
    -use_tile_bb ^
    -step %STEP% ^
    -odir %BLOCK%\tiles_sliced -oimg ^
    -cores %CORES%
Reply all
Reply to author
Forward
0 new messages