Hi Martin,
Thanks for responding. I am trying to create the pit-free CHM. Before we create the series of CHMs using different height thresholds, we need to normalise the lidar points and remove points above a certain height. My data is one laz file with about 134m points. I got the 'abnormal program termination' message, when I attempted to thin the data with the following:
lasthin -i lidar_normalised_below50m.laz -subcircle 0.1 -step 0.16667 -highest -o temp.laz
I followed some of your posts on this, from which I got the impression that it had something to do with the memory allocation. Coarser steps (e.g -step 1) worked, but I am interested in finer resolution. I also found that las2las has the -thin_with_grid argument. My question first question is that:
Q1: In case of a big file, can we do the following instead of using lasthin?
#Thinning
las2las -i lidar_normalised_below50m.laz -thin_with_grid 0.16667 -o thinned.laz
lasthin -i thinned.laz -subcircle 0.1 -o thinned_splat.laz
but we can't add the argument -highest here.
I also wanted to know that:
Q2: How is thin_with_grid (in las2las) different from -step x (in lasthin)?
My third question is about the pit-free CHM. The
journal article explicitly mentions the use of 'first returns' in each height threshold; however "the pit-free method of Khosravipour et al." at the end of this
blog and the "pit_free_script.bat" in "example_batch_scripts" (pasted below in light blue colour) do not use the '-keep_first' argument when using las2dem (please note here that my data is classified: report.txt attached). I am curious to know that:
Q3: Does las2dem / blast2dem create the raster surfaces (e.g. chm_02.bil. chm_05.bil...chm_65.bil) using the 'first returns' in their respective height threshold, even if -keep_first is not explicitly mentioned in the arguments?
I tested both, using -keep_first and the
blog method, and the results are different. -keep_first created a coarser CHM with many pits as compared to not using the argument -keep_first.
To create a CHM, I am using the script below.
mkdir tmp_chm
lasheight -i lidar_normalised.laz -drop_z_above 50 -odix _below50 -olaz
## no thinning because the point density was already low (report.txt attached)
## instead of -drop_z_below, I used -keep_class, because the data was already classified
blast2dem -i lidar_normalised_below50.laz -keep_class 2 -step 1 -o tmp_chm/chm_ground.bil
blast2dem -i lidar_normalised_below50.laz -step 1 -kill 1.0 -o tmp_chm/chm_00.bil
blast2dem -i lidar_normalised_below50.laz -keep_class 4 5 -step 1 -kill 1.0 -o tmp_chm/chm_02.bil
blast2dem -i lidar_normalised_below50.laz -keep_class 5 -step 1 -kill 1.0 -o tmp_chm/chm_05.bil
blast2dem -i lidar_normalised_below50.laz -drop_z_below 10 -step 1 -kill 1.0 -o tmp_chm/chm_10.bil
blast2dem -i lidar_normalised_below50.laz -drop_z_below 15 -step 1 -kill 1.0 -o tmp_chm/chm_15.bil
blast2dem -i lidar_normalised_below50.laz -drop_z_below 20 -step 1 -kill 1.0 -o tmp_chm/chm_20.bil
blast2dem -i lidar_normalised_below50.laz -drop_z_below 25 -step 1 -kill 1.0 -o tmp_chm/chm_25.bil
blast2dem -i lidar_normalised_below50.laz -drop_z_below 30 -step 1 -kill 1.0 -o tmp_chm/chm_30.bil
blast2dem -i lidar_normalised_below50.laz -drop_z_below 35 -step 1 -kill 1.0 -o tmp_chm/chm_35.bil
blast2dem -i lidar_normalised_below50.laz -drop_z_below 40 -step 1 -kill 1.0 -o tmp_chm/chm_40.bil
blast2dem -i lidar_normalised_below50.laz -drop_z_below 45 -step 1 -kill 1.0 -o tmp_chm/chm_45.bil
lasgrid -i tmp_chm/chm*.bil -merged -step 1 -highest -o tmp_chm/chm_pit_free_TEST.bil
lasgrid -i tmp_chm/chm*.bil -merged -step 1 -highest -false -set_min_max 0 50 -o tmp_chm/chm_pit_free_TEST.png
## rmdir tmp_chm
Thank you for bearing the length of my email :)
Kind regards,
Irfan
"pit_free_script.bat" in "example_batch_scripts"
rmdir temp_dir /s /q
mkdir temp_dir
las2dem -i normalized.laz -drop_z_above 0.1 -step %STEP% -o temp_dir/chm_ground.bil
lasthin -i normalized.laz -subcircle 0.025 -step %HALF_STEP% -highest -o temp.laz
las2dem -i temp.laz -step %STEP% -kill %KILL% -o temp_dir/chm_00.bil
las2dem -i temp.laz -drop_z_below 2 -step %STEP% -kill %KILL% -o temp_dir/chm_02.bil
las2dem -i temp.laz -drop_z_below 5 -step %STEP% -kill %KILL% -o temp_dir/chm_05.bil
las2dem -i temp.laz -drop_z_below 10 -step %STEP% -kill %KILL% -o temp_dir/chm_10.bil
las2dem -i temp.laz -drop_z_below 15 -step %STEP% -kill %KILL% -o temp_dir/chm_15.bil
las2dem -i temp.laz -drop_z_below 20 -step %STEP% -kill %KILL% -o temp_dir/chm_20.bil
las2dem -i temp.laz -drop_z_below 25 -step %STEP% -kill %KILL% -o temp_dir/chm_25.bil
las2dem -i temp.laz -drop_z_below 30 -step %STEP% -kill %KILL% -o temp_dir/chm_30.bil
las2dem -i temp.laz -drop_z_below 35 -step %STEP% -kill %KILL% -o temp_dir/chm_35.bil
las2dem -i temp.laz -drop_z_below 40 -step %STEP% -kill %KILL% -o temp_dir/chm_40.bil
las2dem -i temp.laz -drop_z_below 45 -step %STEP% -kill %KILL% -o temp_dir/chm_45.bil
las2dem -i temp.laz -drop_z_below 50 -step %STEP% -kill %KILL% -o temp_dir/chm_50.bil
las2dem -i temp.laz -drop_z_below 55 -step %STEP% -kill %KILL% -o temp_dir/chm_55.bil
las2dem -i temp.laz -drop_z_below 60 -step %STEP% -kill %KILL% -o temp_dir/chm_60.bil
las2dem -i temp.laz -drop_z_below 65 -step %STEP% -kill %KILL% -o temp_dir/chm_65.bil
lasgrid -i temp_dir/chm*.bil -merged -step %STEP% -highest -false -set_min_max 0 65 -o chm_pit_free_d05.png
rmdir temp_dir /s /q