This tutorial illustrates a method to automatically process lidar data using scripts in uniDEM accurately and consistently.
Scripts can be recorded while interactively editing DEM and lidar data. Scripts are xml which are stored in, and can be inserted into and exported from uniDEM project files. Scripts can be modified to perform automated editing to program deliverables over large areas any interface that can modify xml files.
Three scripts are provided for illustrative purposes, but can be amalgamated and modified programmatically for fully automated processing using any language that can modify xml files and start an executable.
The following topics will be covered:For more lessons visit Working with Lidar Point Clouds.
The sample data used in this lesson is 3DEP lidar data in two LAZ files in LAS version 1.2 and located in Madison, MS, USA.
Prior to commencing this lesson, please download the sample data:This lesson will take approximately 10 minutes.
The CreateRasters script is used to create the raster layers from the Madison lidar dataset. It will be downloaded and imported into the project file for execution.
uniDEM Tool Name | Script Tool Name | Description |
---|---|---|
Points to DEM | POINTS_TO_DEM | Create a raster of the lowest elevation stored in the lidar points intersecting with a pixel of the raster being generated. |
Set Active DEM | ACTIVE | Sets the generated DEM (minDEM) to active allowing editing |
Select All (Ctrl-A) | SELECT_ALL | Select all DEM pixels for editing |
Kernel→Inverse Distance Weighted | FILL_IDW | Fill small areas of missing data with an Inverse Distance Weighted (IDW) void fill up to 15 pixels with a minimum of 30% valid elevations |
Triangulation | FILL_TRIANGULATION | Fill large areas of missing data by triangulating the dataset |
Clear Selection (Esc) | SELECT_NONE | Clear the select mask |
Copy | DATA_COMPONENT_COPY | Copy minDEM and name it minDEM Original for use later in the process |
Points to DEM | POINTS_TO_DEM | Create a raster of the standard deviation of the lidar points intersecting with a pixel of the raster being generated. |
Set Active DEM | ACTIVE | Sets the standard deviation raster (stdDev) to active allowing editing |
Select All (Ctrl-A) | SELECT_ALL | Select all DEM pixels for editing |
Kernel→Inverse Distance Weighted | FILL_IDW | Fill small areas of missing data with an Inverse Distance Weighted (IDW) void fill up to 15 pixels with a minimum of 30% valid elevations |
Triangulation | FILL_TRIANGULATION | Fill large areas of missing data by triangulating the dataset |
Clear Selection (Esc) | SELECT_NONE | Clear the select mask |
Points to DEM | POINTS_TO_DEM | Create a raster (count) of the number of lidar points intersecting with a pixel of the raster being generated. |
The Classify Land Use script is used to define Ground, Water, Vegetation and Buildings in a raster mask. The water will be flattened and a 3D breakline will be generated around the water.
uniDEM Tool Name | Script Tool Name | Description |
---|---|---|
Select Values | SELECT_RANGE | Select Water where the count raster holds 0-1 lidar returns for each pixel |
Clean Up | SELECT_CLEANUP | Remove "islands" - clean up all small holdes (<100m2) in the selection |
Clean Up | SELECT_CLEANUP | Remove small water bodies - clean up all small selections (<100m2) |
Assign Class | CLASS_ASSIGN | Assign selection to the Lake (23) classification |
Make Void | ASSIGN_VOID | Void all selected lake DEM pixels in minDEM |
Perimeter (Fill) | FILL_PERIMETER | Fill all selected lake pixels to the lowest 10th percentile of the shoreline (perimeter) elevations |
Lock | RASTER_LOCK | Lock edited water DEM and CLASS pixels so values cannot change |
(Convert) To Polygons | MASK_TO_POLYGON | Create 3D breaklines in shapefile format defining each water body |
Select Values | SELECT_RANGE | Select values of 1-1000m which represent forests from the stdDev dataset |
Erode | SELECT_ERODE | Erode selection by 2 pixels to remove building and other localized edges |
Grow | SELECT_GROW | Grow the selection by 2 pixels to generally cover the forested regions |
Blur→Percentile | BLUR_PERCENTILE | Blur the selections using a 5x5 kernel to the lowest 10th percentile to remove tree trunks |
Select All (Ctrl-A) | SELECT_ALL | Select all pixels |
(Auto) Bare Ground | CLASS_AUTO_BAREGROUND | Use the Bare Ground classification tool to segment all classes between Bare Ground (12) and Unknown (0) |
Clear Selection (Esc) | SELECT_NONE | Clear the selection |
Select By Class | SELECT_CLASS | Select all Unknown (0) classifications from the CLASS layer of minDEM |
Clean Up | SELECT_CLEANUP | Remove all selected areas < 50m2 to define the smallest building area |
Grow | SELECT_GROW | Grow the selection by 2 pixels to include building overhangs such as eaves |
Keypad Preset - 6 (Building) | CLASS_PRESET_6 | Assign the selection to the Building (64) pixels |
Select By Class | SELECT_CLASS | Select the Unknown (0) and Building (64) classifications |
Make Void | ASSIGN_VOID | Void all selected pixels as they are not assumed to be bare ground |
Grow | SELECT_GROW | Grow selection by one pixel around voided Building and Unknown classes |
Blur→Percentile | BLUR_PERCENTILE | Smooth the selected edges of the voids using a 5x5 median filter (50%) |
Kernel→Inverse Distance Weighted | FILL_IDW | Fill small void areas with an Inverse Distance Weighted (IDW) void fill |
Triangulation | FILL_TRIANGULATION | Fill large void areas with the Tringulation void fill |
Clear Selection (Esc) | SELECT_NONE | Clear the selection |
Select By Class | SELECT_CLASS | Select the Building (64) classification |
Lock | RASTER_LOCK | Lock the edited Building (64) DEM and CLASS pixels so they cannot change |
Clear Selection (Esc) | SELECT_NONE | Clear the selection |
Select Values | SELECT_RANGE | Select values of 1-1000m from the stdDev dataset which represent forests |
Grow | SELECT_GROW | Grow selection by one pixel to capture forest holes and extents |
Clean Up (Selection) | SELECT_CLEANUP | Remove small holes (<10m2) in the selected forest |
Assign Class | CLASS_ASSIGN | Assign the selection to Medium Vegetation (14) |
Clear Selection (Esc) | SELECT_NONE | Clear the selection |
Select All (Ctrl-A) | SELECT_ALL | Select all pixels |
Unlock | RASTER_UNLOCK | Unlock all DEM and CLASS pixels for minDEM |
Clear Selection (Esc) | SELECT_NONE | Clear the selection |
uniDEM Tool Name | Script Tool Name | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Select By Class | SELECT_CLASS | Select Medium Forest (14) from the 2D land use CLASS layer | |||||||||||||||||||||
(Classification) Set From DEM | POINTS_CLASS_FROM_DEM | Assign LAS classes in the selection based on their height above the bare earth DEM (minDEM)
|
|||||||||||||||||||||
Clear Selection (Esc) | SELECT_NONE | Clear the selection | |||||||||||||||||||||
Select By Class | SELECT_CLASS | Select Lake (23) from the 2D land use CLASS layer in minDEM | |||||||||||||||||||||
(Classification) Set From DEM | POINTS_CLASS_FROM_DEM | Assign LAS classes in the selection based on their height above the bare earth DEM (minDEM)
|
|||||||||||||||||||||
Clear Selection (Esc) | SELECT_NONE | Clear the selection | |||||||||||||||||||||
Select By Class | SELECT_CLASS | Select Unknown (0) and Bare Ground (12) from the 2D land use CLASS layer in minDEM | |||||||||||||||||||||
(Classification) Set From DEM | POINTS_CLASS_FROM_DEM | Assign LAS classes in the selection based on their height above the bare earth DEM (minDEM)
|
|||||||||||||||||||||
Clear Selection (Esc) | SELECT_NONE | Clear the selection | |||||||||||||||||||||
Select By Class | SELECT_CLASS | Select Building (64) from the 2D land use CLASS layer in minDEM | |||||||||||||||||||||
(Classification) Set From DEM | POINTS_CLASS_FROM_DEM | Assign LAS classes in the selection based on their height above the bare earth DEM (minDEM)
|
|||||||||||||||||||||
Make Void | ASSIGN_VOID | Void the flattened buildings in minDEM so they can be replaced with the values from the minDEM Original dataset | |||||||||||||||||||||
Delta Surface | FILL_DELTA_SURFACE | Fill the voided building with the unedited elevations from minDEM Original | |||||||||||||||||||||
(Classification) Set From DEM | POINTS_CLASS_FROM_DEM | Assign all pixels greater than 2 meters from the closest DEM height to High Vegetation (5) | |||||||||||||||||||||
Clear Selection (Esc) | SELECT_NONE | Clear the selection |