Skip to contents

This function processes a LAS file to generate a Canopy Height Model (CHM) using the specified resolution and pixel-to-region (p2r) parameters. The resulting CHM can optionally be saved as a TIFF file in the specified output folder. The function uses the rasterize_canopy method from the lidR package for rasterizing the LAS point cloud.

Usage

create_CHM_from_LAS(las_path, res_par, p2r_par, save_chm, output_folder)

Arguments

las_path

The file path of the LAS file from which the CHM is to be created.

res_par

The resolution parameter for the CHM raster; specifies the size of each pixel in the output raster.

p2r_par

The pixel-to-region parameter used in the p2r algorithm for rasterizing the point cloud.

save_chm

A logical value indicating whether to save the generated CHM as a TIFF file. If TRUE, the CHM is saved; if FALSE, it is not saved.

output_folder

The directory path where the CHM TIFF file should be saved if saving is enabled.

Value

The function returns NULL invisibly. If save_chm is TRUE, the CHM is saved as a TIFF file.

Examples

if (FALSE) { # \dontrun{
create_CHM_from_LAS("path/to/your/las_file.las", 0.5, 2, TRUE, "path/to/output/folder")} # }