I used to process a LIDAR catalog with the following code (using the LAScatalog processing engine from the great lidR
package):
library(lidR)
lasdir <- "D:\\LAS\\"
output <- "D:\\LAS\\PRODUCTS\\"
epsg = "+init=epsg:25829"
res = 1
no_cores <- detectCores()
cat <- lascatalog(lasdir = lasdir,
outputdir = output,
pattern = '*COL.laz$|*COL.LAZ$',
catname = "Catalog",
clipcat = FALSE, clipcatbuf = FALSE, clipbuf = 1000, clipcatshape = clipcatshape,
cat_chunk_buffer = 20,
cores = no_cores, progress = TRUE,
laz_compression = TRUE, epsg = epsg,
retilecatalog = FALSE, tile_chunk_buffer = 10,
tile_chunk_size = 1000,
filterask = FALSE,
filter = "-keep_first -drop_z_below 2")
DEM_output <- paste0(output,"DEM_", str_pad(res, 3, "left", pad = "0"), "/")
opt_output_files(cat) <- paste0(DEM_output,"{ORIGINALFILENAME}") #set filepaths
DEM <- grid_terrain(cat, res = res, algorithm = "knnidw"(k = 5, p = 2))
There was some actualization of the library and now, the parameters cores
seems not working and although the process works, now it does not work in parallel. A message states that: Option no longer supported. See ?lidR-parallelism
.
How can I process a catalog in parallel now?