1:: 2:: a batch script for converting raw flight lines (not tiled) into 3:: a number of products with a tile-based multi-core batch pipeline 4:: 5 6:: include LAStools in PATH to allow running script from anywhere 7 8set PATH=%PATH%;..; 9 10:: specify the number of cores to use 11 12set NUM_CORES=1 13 14:: create clean folder for the raw tiles with buffer 15 16rmdir .\tiles_raw /s /q 17mkdir .\tiles_raw 18 19:: use lastile to create a buffered tiling from the original 20:: flight strips. the flag '-files_are_flightlines' assures 21:: that points from different flight lines will get a unique 22:: flight lines ID stored in the 'point source ID' attribute 23:: that makes it possible to later identify from which points 24:: belong to the same flight strip. we use '-tile_size 1000' 25:: to specify the tile size and request a buffer of 50 meters 26:: around every tile with '-buffer 50'. this buffer helps to 27:: reduce edge artifacts at tile boundaries in a tile-based 28:: processing pipeline. we shift the coordinate plane tiling 29:: by 920 in x and 320 in y so that the flight strips fit in 30:: exactly 4 tiles (experimentally discovered). the '-olaz' 31:: flag requests compressed output tiles to overcome the I/O 32:: bottleneck. 33:: NOTE: usually you won't include option '-tile_ll 920 320' 34 35lastile -i strips_raw\*.laz -files_are_flightlines ^ 36 -tile_size 1000 -buffer 50 -tile_ll 920 320 ^ 37 -o tiles_raw\tile.laz -olaz 38 39:: create clean folder for the ground-classified tiles 40 41rmdir .\tiles_ground /s /q 42mkdir .\tiles_ground 43 44:: use lasground to find the bare-earth points in all tiles 45:: with the '-metro' setting (which uses a step of 50m) 46:: and '-extra_fine' setting for the initial ground estimate 47:: (see: lasground_README.txt). the '-odir tiles_ground -olaz' 48:: parameters specify to store the ground-classified tiles 49:: compressed and with the same name to the 'tiles_ground' 50:: folder. if we have multiple tiles then this process runs 51:: on as many cores as specified by the %NUM_CORES% set above. 52 53lasground -i tiles_raw\*.laz ^ 54 -metro -extra_fine ^ 55 -odir tiles_ground -olaz ^ 56 -cores %NUM_CORES% 57 58:: 59:: NOTE: if the only objective is to create bare-earth DTM rasters 60:: (as it may well be the case in archeological applications) we 61:: can skip from here straight to the last step where the buffers 62:: are stripped off each tile 63:: 64 65:: create clean folder for the denoised tiles 66 67rmdir .\tiles_denoised /s /q 68mkdir .\tiles_denoised 69 70:: use lasheight to remove low and high outliers that are often 71:: just noise (e.g. clouds or birds). by default lasheight uses 72:: the points classified as ground to construct a TIN and then 73:: calculates the height of all other points in respect to this 74:: ground surface TIN. with '-drop_above 40 -drop_below -3' all 75:: points that are 40 meters above the ground or 3 meters below 76:: the ground are removed from the output LAZ tiles that are to 77:: be stored in the 'tiles_denoised' folder. if we have multiple 78:: input files this process runs on %NUM_CORES% many cores. 79 80lasheight -i tiles_ground\*.laz ^ 81 -drop_above 40 -drop_below -3 ^ 82 -odir tiles_denoised -olaz ^ 83 -cores %NUM_CORES% 84 85:: create clean folder for the classified tiles 86 87rmdir .\tiles_classified /s /q 88mkdir .\tiles_classified 89 90:: use lasclassify to identify buildings and trees in all denoised 91:: tiles. your milage may vary on this step because automatic LiDAR 92:: classification is a hard problem. all the default settings are 93:: used (see: lasclassify_README.txt). 94 95lasclassify -i tiles_denoised\*.laz ^ 96 -odir tiles_classified -olaz ^ 97 -cores %NUM_CORES% 98 99:: create clean folder for the final tiles (stripped of the buffer) 100 101rmdir .\tiles_final /s /q 102mkdir .\tiles_final 103 104:: use lastile to remove the buffer from the classified tiles which 105:: is requested with the option '-remove_buffer'. 106 107lastile -i tiles_classified\*.laz ^ 108 -remove_buffer ^ 109 -odir tiles_final -olaz 110