forked from LAStools/LAStools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphotogrammetry_points_to_dtm_dsm_countours.bat
119 lines (84 loc) · 2.59 KB
/
photogrammetry_points_to_dtm_dsm_countours.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
::
:: an example batch script for generating both DTM and DSM
:: rasters from a large dense-matching point cloud using a
:: tile-based processing pipeline
::
::
:: specify parameters
::
:: allows you to run the script from other folders
set PATH=%PATH%;D:\lastools\bin;
:: specify input file
set INPUT_POINTS=D:\lastools\bin\macmahanfarm.laz
:: specify desired output raster resolution
set STEP=0.5
:: specify desired contour line spacing
set EVERY=1.0
set COARSE_STEP=1.0
:: specify file name and format for DTM
set OUTPUT_DTM=D:\lastools\bin\macmahanfarm_dtm.tif
:: specify file name and format for DSM
set OUTPUT_DSM=D:\lastools\bin\macmahanfarm_dsm.tif
:: specify file name and format for elevation contour
set OUTPUT_ISO=D:\lastools\bin\macmahanfarm_iso.shp
:: specify temporary directory for tiles
set TEMP_DIR=D:\lastools\bin\poop
:: specify size of tile and edge-artifact-avoiding buffer
set TILE_SIZE=500
set BUFFER=25
:: specify number of cores
set CORES=4
::
:: do the actual processing
::
:: create or empty temporary directory
rmdir %TEMP_DIR% /s /q
mkdir %TEMP_DIR%
:: create buffered tiling
lastile -i %INPUT_POINTS% ^
-rescale 0.01 0.01 0.01 ^
-tile_size %TILE_SIZE% -buffer %BUFFER% ^
-o %TEMP_DIR%\tile.laz -olaz
:: run lassort on all tiles
lassort -i %TEMP_DIR%\tile*.laz ^
-odix _s -olaz ^
-cores %CORES%
:: run lasground on all tiles
lasground -i %TEMP_DIR%\tile*_s.laz ^
-all_returns ^
-city -ultra_fine ^
-odix g -olaz ^
-cores %CORES%
:: create the DTMs for all tiles
las2dem -i %TEMP_DIR%\tile*_sg.laz ^
-keep_class 2 ^
-step %STEP% ^
-use_tile_bb ^
-ocut 3 -odix _dtm -obil ^
-cores %CORES%
:: join into single DTM
lasgrid -i %TEMP_DIR%\tile*_dtm.bil -merged ^
-step %STEP% ^
-o %OUTPUT_DTM%
:: create the DSMs for all tiles
las2dem -i %TEMP_DIR%\tile*_sg.laz ^
-step %STEP% ^
-use_tile_bb ^
-ocut 3 -odix _dsm -obil ^
-cores %CORES%
:: join into single DSM
lasgrid -i %TEMP_DIR%\tile*_dsm.bil -merged ^
-step %STEP% ^
-o %OUTPUT_DSM%
:: create an averaged (smoother) coarse DTM
lasgrid -i %TEMP_DIR%\tile*_dtm.bil -merged ^
-step %COARSE_STEP% -average ^
-o %TEMP_DIR%\dtm_coarse.bil
:: create elevation contours from DTM using BLAST
blast2iso -i %TEMP_DIR%\dtm_coarse.bil ^
-iso_every %EVERY% ^
-smooth 2 -simplify_length 1 -simplify_area 1 -clean 5 ^
-o %OUTPUT_ISO%
:: remove the temporary files and directory
:: rmdir %TEMP_DIR% /s /q
echo "bye bye"