Skip to contents

cloud2raster() is an all-in-one function to process raw .las|.laz files to generate a CHM raster (.tif), a DTM raster (.tif), and .las files which have been height normalized. The order of operations is:

Usage

cloud2raster(
  output_dir,
  input_las_dir,
  input_treemap_dir = NULL,
  input_foresttype_dir = NULL,
  accuracy_level = 2,
  max_ctg_pts = 7e+07,
  max_area_m2 = 9e+07,
  transform = FALSE,
  new_crs = NA,
  old_crs = NA,
  keep_intrmdt = F,
  dtm_res_m = 1,
  chm_res_m = 0.25,
  min_height = 2,
  max_height = 70,
  noise_level = 2,
  overwrite = TRUE
)

Arguments

output_dir

parent directory where new folders point_cloud_processing_delivery and point_cloud_processing_temp will be written for exports

input_las_dir

directory where .las|.laz point cloud data exists...program will search all sub-directories for all .las|.laz files and process them as one

input_treemap_dir

character. directory where Treemap 2016 exists. Use get_treemap() first.

input_foresttype_dir

character. directory where Forest Type Groups data exists. Use get_foresttype() first.

accuracy_level

numeric. Choose processing accuracy. accuracy_level = 1 uses DTM to height normalize the points accuracy_level = 2 uses triangulation with high point density (20 pts/m2) to height normalize the points accuracy_level = 3 uses triangulation with very high point density (100 pts/m2) to height normalize the points

max_ctg_pts

numeric. Max number of points to process at one time. Setting this number higher will possibly reduce run times but increase the chance of running out of memory and vice versa.

max_area_m2

numeric. Max area to process at one time. See max_ctg_pts parameter, this one is less important as never experienced memory issues with large areas (just lots of points)

transform

logical. should the las/laz files be transformed? If set to TRUE the parameters new_crs must be defined.

new_crs

string. crs to change to as an epsg numerical code

old_crs

string. crs to change from as an epsg numerical code

keep_intrmdt

logical. this process writes intermediate data to the disk, keep those intermediate files (classfied, normalized, stem las files)?

dtm_res_m

numeric. The desired resolution of the DTM produced in meters.

chm_res_m

numeric. The desired resolution of the CHM produced in meters.

min_height

numeric. Set the minimum height (m) for individual tree detection

max_height

numeric. Set the maximum height (m) for the canopy height model

noise_level

numeric. Choose point cloud noise reduction level 1, 2, or 3. Use a higher noise level for point clouds with more noise which tend to produce raster outputs with pits or spikes that are too severe to be filled with standard post-processing. The default level of 2 has similar processing time compared to level to 1 but uses a more broadly applicable noise detection algorithm. Level 3 takes 10-40% longer to process.

  • noise_level = 1 uses isolated voxel filter (IVF) with a resolution of 5 voxels and 9 other points to identify noise

  • noise_level = 2 uses a single-pass, fine-scale statistical outlier removal (SOR) that primarily targets local noise

  • noise_level = 3 uses a muli-pass statistical outlier removal (SOR) that first applies a coarse-scale filter to find points/clusters far from the main cloud mass and then applies a fine-scale filter to identify local noise

overwrite

logical. Should the output files in the point_cloud_processing_delivery directory from previous iterations be deleted?

Value

Returns the goods. Exports files of the goods to new folders "point_cloud_processing_delivery" and "point_cloud_processing_temp" in the output_dir defined by the user in the function call.

Examples

 if (FALSE) { # \dontrun{
 # test las file but this could also be a directory path with >1 .las|.laz files
 i <- system.file("extdata", "MixedConifer.laz", package="lidR")
 # run it
 r <- cloud2trees::cloud2raster(output_dir = tempdir(), input_las_dir = i)
 # what is it?
 r %>% names()
 # there's a DTM
 r$dtm_rast %>% terra::plot()
 # there's a CHM
 r$chm_rast %>% terra::plot()
 # there's a data.frame with the file structure for the project
 r$create_project_structure_ans %>% dplyr::glimpse()
 # there's a information detailing how the point cloud was processed
 r$chunk_las_catalog_ans$process_data %>% dplyr::glimpse()
 r$chunk_las_catalog_ans$is_chunked_grid
 r$chunk_las_catalog_ans$las_ctg@data %>% dplyr::glimpse()
 # there's a list of the height normalized .las files created
 r$normalize_flist
 } # }