Ejemplo n.º 1
0
import os
from WBT.whitebox_tools import WhiteboxTools

wbt = WhiteboxTools()

# Set the working directory, i.e. the folder containing the data,
# to the 'data' sub-directory.
wbt.set_working_dir(os.path.dirname(os.path.abspath(__file__)) + "/data/")

# When you're running mulitple tools, the outputs can be a tad
# chatty. In this case, you may want to suppress the output by
# setting the verbose mode to False.
# wbt.set_verbose_mode(False)

# Interpolate the LiDAR data using an inverse-distance weighting
# (IDW) scheme.
print("Interpolating DEM...")
wbt.lidar_idw_interpolation(
i="wb_test1.las",
output="raw_dem.tif",
parameter="elevation",
returns="last",
resolution=1.0,
weight=1.0,
radius=2.5
)

# The resulting DEM will contain NoData gaps. We need to fill
# these in by interpolating across the gap.
print("Filling missing data...")
wbt.fill_missing_data(
from WBT.whitebox_tools import WhiteboxTools

wbt = WhiteboxTools()

# since i=none, our input will be everything in the working directory
wbt.set_working_dir("E:\\guelphAreaProject\\lasDir\\"
                    )  #select directory containing LAS files of interest

wbt.lidar_tile_footprint(  #this will create a polygon of a grid of square km tiles
    output=
    "E:\\guelphAreaProject\\grid.shp",  #choose output directory and file name
)