Skip to content

Get Started

Launch the interactive notebook tutorial for the lidar Python package with Google Colab now:

Open In Colab

A Quick Example

 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
import os
import pkg_resources
from lidar import *

# identify the sample data directory of the package
package_name = 'lidar'
data_dir = pkg_resources.resource_filename(package_name, 'data/')

# use the sample dem. Change it to your own dem if needed
in_dem = os.path.join(data_dir, 'dem.tif')
# set the output directory
out_dir = os.getcwd()

# parameters for identifying sinks and delineating nested depressions
min_size = 1000      # minimum number of pixels as a depression
min_depth = 0.5      # minimum depth as a depression
interval = 0.3       # slicing interval for the level-set method
bool_shp = True      # output shapefiles for each individual level

# extracting sinks based on user-defined minimum depression size
out_dem = os.path.join(out_dir, "median.tif")
in_dem = MedianFilter(in_dem, kernel_size=3, out_file=out_dem)
sink_path = ExtractSinks(in_dem, min_size, out_dir)
dep_id_path, dep_level_path = DelineateDepressions(sink_path, 
                                                   min_size, 
                                                   min_depth, 
                                                   interval, 
                                                   out_dir, 
                                                   bool_shp)
print('Results are saved in: {}'.format(out_dir))

lidar GUI

lidar also provides a Graphical User Interface (GUI), which can be invoked using the following Python script:

1
2
import lidar
lidar.gui()

image

ArcGIS Toolbox

Toolbox interface

toolbox

toolbox_ui

Video tutorials

Delineating nested surface depressions and catchments using ArcGIS Pro

demo

Delineating nested surface depressions and catchments using ArcMap

demo


Last update: 2021-07-10