1::
2:: an example batch script for processing a huge LAS/LAZ file into a
3:: file containing only ground points using a tile-based multi-core
4:: processing pipeline by tiling, removing noise, classifying ground,
5:: and finally merging the resulting ground points into one file. the
6:: settings below are for a dense-survey from a low-flying helicopter.
7::
8
9::echo off
10
11:: set relevant variables
12
13set LAStools=E:\LAStools\bin\
14set TILE_SIZE=250
15set BUFFER=30
16set STEP=1
17set CORES=4
18
19:: print-out which LAStools version are we running
20
21%LAStools%^
22lastile -version
23
24:: create temporary tile directory
25
26rmdir temp_tiles /s /q
27mkdir temp_tiles
28
29:: create a temporary tiling with tile size 250 and buffer 30
30
31%LAStools%^
32lastile -i %1 ^
33        -set_classification 0 ^
34        -tile_size %TILE_SIZE% -buffer %BUFFER% -flag_as_withheld ^
35        -o temp_tiles\tile.laz -olaz
36
37:: create another temporary tile directory
38
39rmdir temp_tiles_denoised /s /q
40mkdir temp_tiles_denoised
41
42:: run lasnoise on all temporary tiles on multiple cores while
43:: aggressively filtering noise points in an attempt to get as
44:: many erroneous points below the ground as possible. wrong
45:: classification of points above the grounds as noise does not
46:: matter here.
47
48%LAStools%^
49lasnoise -i temp_tiles\tile*.laz ^
50         -step_xy 1 -step_z 0.25 ^
51         -classify_as 7 ^
52         -odir temp_tiles_denoised -olaz ^
53         -cores %CORES%
54
55:: delete temporary tile directory
56
57rmdir temp_tiles /s /q
58
59:: create another temporary tile directory
60
61rmdir temp_tiles_thinned /s /q
62mkdir temp_tiles_thinned
63
64:: run lasthin on all temporary tiles on multiple cores to mark
65:: the point closest to the fifth (5th) lowest percentile in each
66:: 1 meter by 1 meter cell with temporary classification code 6
67
68%LAStools%^
69lasthin -i temp_tiles_denoised\tile*.laz ^
70        -ignore_class 7 ^
71        -step 1 -percentile 0.05 ^
72        -classify_as 6 ^
73        -odir temp_tiles_thinned -olaz ^
74        -cores %CORES%
75
76:: delete temporary tile directory
77
78rmdir temp_tiles_denoised /s /q
79
80:: create another temporary tile directory
81
82rmdir temp_tiles_ground /s /q
83mkdir temp_tiles_ground
84
85:: run lasground_new on all temporary tiles on multiple cores
86:: but only on that one point marked as classification 6 per
87:: 1 meter by 1 meter (by ignoring the other two classification
88:: codes 7 and 0) with options '-city' and '-ultra_fine'.
89
90%LAStools%^
91lasground_new -i temp_tiles_thinned\tile*.laz ^
92              -ignore_class 7 0 ^
93              -city -ultra_fine ^
94              -odir temp_tiles_ground -olaz ^
95              -cores %CORES%
96
97:: delete temporary tile directory
98
99rmdir temp_tiles_thinned /s /q
100
101:: merge the ground points of all tiles (all points that now
102:: have classification 2) except the buffer points that were
103:: flagged as 'withheld' during the initial tiling by lasthin
104
105%LAStools%^
106lasmerge -i temp_tiles_ground\tile*.laz ^
107         -drop_withheld -keep_class 2 ^
108         -o %2 -olaz
109
110:: delete other temporary tile directory
111
112rmdir temp_tiles_ground /s /q
113