Skip to contents

Create a Canopy Height Model using triangulate and rasterize.

Usage

chm(res = 1, tin = FALSE, ofile = tempfile(fileext = ".tif"))

Arguments

res

numeric. The resolution of the raster.

tin

bool. By default the CHM is a point-to-raster based methods i.e. each pixel is assigned the elevation of the highest point. If tin = TRUE the CHM is a triangulation-based model. The first returns are triangulated and interpolated.

ofile

character. Full outputs are always stored on disk. If ofile = "" then the stage will not store the result on disk and will return nothing. It will however hold partial output results temporarily in memory. This is useful for stage that are only intermediate stage.

Examples

f <- system.file("extdata", "Topography.las", package="lasR")
pipeline <- reader_las() + chm()
exec(pipeline, on = f)
#> class       : SpatRaster 
#> dimensions  : 286, 286, 1  (nrow, ncol, nlyr)
#> resolution  : 1, 1  (x, y)
#> extent      : 273357, 273643, 5274357, 5274643  (xmin, xmax, ymin, ymax)
#> coord. ref. : NAD83(CSRS) / MTM zone 7 (EPSG:2949) 
#> source      : file1f7b11480777.tif 
#> name        : max