Get CHM with spike free algorithm for big laz files

209 views
Skip to first unread message

mauro...@gmail.com

unread,
Oct 13, 2016, 2:58:03 AM10/13/16
to LAStools - efficient tools for LiDAR processing
Hello,

I had this problem already several times and I don`t know wheater I`m solving it the proper way.
I have a big laz File from which I want to get a spike free CHM.

What I do (supposing laz cloud has already classified ground points):

1. lastile -i myBigLaz.laz -odir ...\tiles -olaz -buffer 20 -tile_size 100 -cores 6                    #tile the big laz
2. lasheight -i ...\tiles\*.laz -olaz -odix _NORM -replace_z -cores 6                                  # normalize the tiles 
3. las2dem -i ...\tiles\*_NORM.laz -spike_free 1 -obil -odix "something" -step 1                 # apply spike free algorithm
4. lastile -i ...\tiles\*.bil -remove_buffer -o myBigCHM_spikefree.tif --> ?????                     # put the raster tiles together

The step I`m not sure about is how to put together the chm Tiles derived by the spike free algorithm. I noticed, that I could reverse the tiling with lastile using "bil" rasters, but there I`m not sure about the "-remove_buffer" flag. How would such a workflow be correctly implemented?

Thanks for any help.


Mauro

Martin Isenburg

unread,
Oct 14, 2016, 2:15:25 PM10/14/16
to LAStools - efficient command line tools for LIDAR processing
Hello Mauro,

I have a big laz File from which I want to get a spike free CHM.

The most important thing will be to tile the LAZ file into sufficiently small tiles such that each has a buffer of a few meters like you are doing it. In order to take advantage of multi-core processing you will need to lasindex your LAZ file first. For simplicity, let's omit this step here. In addition we add '-refine 15000000' which will report if there is any resulting tile with more than 15 million points. 

lastile -i myBigLaz.laz ^
          -tile_size 100 -buffer 5 ^
          -refine 15000000 ^
          -odir ..\tiles -olaz

If there are any overly large tiles reported than you should run a few times (1 or 2 or 3 times) this call.

lastile -i ..\tiles\*.laz ^
          -refine_tiles 15000000 ^
          -olaz ^
          -cores 4

until those reports are done with. The you normalize them as 

lasheight -i ..\tiles\*.laz ^
                -replace_z ^
                -odir norm_tiles -olaz ^
                -cores 6 

and then run las2dem using the spike-free algorithm (with the right "freeze" parameter) while cutting off the buffer:

las2dem -i ..\norm_tiles\*.laz ^
              -step 1.0 -spike_free 1.0 ^
              -use_tile_bb ^
              -odir ..\chm -obil 

Here a bit more info about the spike-free algorithm of Khosravipour et al 2016:


Regards,

Martin @rapidlasso

Mauro Marty

unread,
Oct 23, 2016, 11:58:39 AM10/23/16
to LAStools - efficient tools for LiDAR processing
Hello Martin,

thanks for the explanation.
I think I missed the use_tile_bb to clip the bils to the original size.

I tried the workflow and it worked up to the point you described. But then if I have all these SpikeFree bils, I want to merge them to the area of the original big laz.
I do this with "lasmerge -i ...\tiles\*.bil -o SpikeFreeCHM.tif

This results in a tif of an approximate size of 1.3 GB. If I try to open it in a GIS, that doesn`t work. I get the message that the tif might be too big or corrupted.
Is there a way to store the merge result in a bigTIFF or to tile it?

Thanks, Mauro

Martin Isenburg

unread,
Oct 23, 2016, 9:08:34 PM10/23/16
to LAStools - efficient command line tools for LIDAR processing
Hello Mauro,

indeed. If the combined TIFF is too big (i think there are at least 3 size restrictions that are something like number of columns below 32768, number of rows below 32768 and file size below 2 GB) then you can try the IMG format instead. Sorry, no BigTIFF support at the moment.

However, you may consider not to merge them all into one big CHM but instead merge the partial CHMs of each CHM into many smaller pit-free CHM rasters that are then combined in memory rather than on disk using the virtual raster concept of GDAL available also via QGIS.

Regards,

Martin @rapidlasso

Reply all
Reply to author
Forward
0 new messages