forked from LAStools/LAStools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerating_a_pit_free_dsm_beam_width.bat
101 lines (76 loc) · 2.71 KB
/
generating_a_pit_free_dsm_beam_width.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
::
:: a batch script for generating a pit-free DSM by utilizing
:: the idea described in the poster by A. Khosravipour et al.
:: in Silvilaser 2013 for pit-free CHM generation but applied
:: to the DSM case with two changes: (1) an additional step
:: is "splatting" the point into small circles to account for
:: a (conservative under-estimate of) beam width of the laser
:: and (2) using all the highest returns (from a finer grid
:: that has half the step size of the raster) for interpolation
:: instead of the first returns
::
::
:: specify parameters
::
:: allows you to run the script from other folders
set PATH=%PATH%;D:\lastools\bin;
:: specify the input LiDAR (with height stored in dm in 'user_data' field)
set LIDAR_WITH_HEIGHTS=lidar_with_heights.laz
:: specify the desired resolution
set STEP=0.5
:: specify the radius of the laser beam
set BEAM_RADIUS=0.1
:: specify the sub-resolution for the beam file (about half the step)
set SUB_STEP=0.25
:: specify the desired triangle kill (about 3 times the step)
set KILL=1.5
:: specify a temporary directory for the beam file and the partial DSMs
set TEMP_DSM_DIR=chicken_poop
:: specify the temporary beam file
set BEAM_LIDAR=%TEMP_DSM_DIR%\beam.laz
:: specify the final output DSM file name and format
set PIT_FREE_DSM=dsm.tif
rmdir %TEMP_DSM_DIR% /s /q
mkdir %TEMP_DSM_DIR%
::
:: do the actual processing
::
lasthin -i %LIDAR_WITH_HEIGHTS% ^
-highest ^
-step %SUB_STEP% ^
-subcircle %BEAM_RADIUS% ^
-o %BEAM_LIDAR%
blast2dem -i %BEAM_LIDAR% ^
-step %STEP% ^
-odir %TEMP_DSM_DIR% -odix _00 -obil
blast2dem -i %BEAM_LIDAR% ^
-drop_user_data_below 20 ^
-step %STEP% -kill %KILL% ^
-odir %TEMP_DSM_DIR% -odix _02 -obil
blast2dem -i %BEAM_LIDAR% ^
-drop_user_data_below 50 ^
-step %STEP% -kill %KILL% ^
-odir %TEMP_DSM_DIR% -odix _05 -obil
blast2dem -i %BEAM_LIDAR% ^
-drop_user_data_below 100 ^
-step %STEP% -kill %KILL% ^
-odir %TEMP_DSM_DIR% -odix _10 -obil
blast2dem -i %BEAM_LIDAR% ^
-drop_user_data_below 150 ^
-step %STEP% -kill %KILL% ^
-odir %TEMP_DSM_DIR% -odix _15 -obil
blast2dem -i %BEAM_LIDAR% ^
-drop_user_data_below 200 ^
-step %STEP% -kill %KILL% ^
-odir %TEMP_DSM_DIR% -odix _20 -obil
blast2dem -i %BEAM_LIDAR% ^
-drop_user_data_below 250 ^
-step %STEP% -kill %KILL% ^
-odir %TEMP_DSM_DIR% -odix _25 -obil
:: merge partial DSMs together into pit-free DSM
lasgrid -i %TEMP_DSM_DIR%\*.bil -merged ^
-step %STEP% -highest ^
-o %PIT_FREE_DSM%
:: remove the temporary files and directory
rmdir %TEMP_DSM_DIR% /s /q
echo "bye bye"