Hi JR :)
Creating a grid of classification values, i get this error in the middle of the catalog:
An error occurred when processing the chunk 92. Try to load this chunk with:
chunk <- readRDS("/tmp/RtmpFAOX6S/chunk92.rds")
las <- readLAS(chunk)
vector::reserve
Code is:
resolution = 1.0
n_cores = 15
size_tile = 150
size_buffer = 25
path_data = ""
path_data = ""
path_output_local = ""
if(!dir.exists(path_output_local)) dir.create(path_output_local, recursive = TRUE)
ctg <- readLAScatalog(path_data)
opt_chunk_size(ctg) <- size_tile
opt_chunk_buffer(ctg) <- size_buffer
opt_output_files(ctg) <- file.path(path_output_local, "{ID}_classif")
opt_progress(ctg) <- T
future::plan(future::multisession, workers = n_cores)
majority_class <- function(z) {
v = which.max(table(z))
v = as.numeric(names(v))
return(v)
}
catalog_apply(ctg, function(las_chunk) {
print(las_chunk)
r <- grid_metrics(las_chunk, ~majority_class(Classification), res = resolution)
return(r)}
)
future::plan(future::sequential)
gc()
Do you know what this vector::reserve error is ?
Thanks !
Hi JR :)
Creating a grid of classification values, i get this error in the middle of the catalog:
Code is:
Do you know what this vector::reserve error is ?
Thanks !