1

I am trying to save a clip_roi object to a LAS file and I used the code in the following question. However I still get the same error:

Error: Argument is not a LAS object

How can I save a clip_roi object to a LAS file?

lidR: Save LAS files from a clip_roi list

Code:

for (i in range(lengths(clip_roi_object))) 
{
  writeLAS(clip_roi_object[[i]], "path/filename.las", index = FALSE)
}

1 Answer 1

2

The question your are linking contains several flaws. Copying the question was not the good idea, you should have copied the answer even if it is a little out-dated by the fact that we prefer to use sf nowadays. Something like that

library(lidR)
library(sf)
ctg <- readLAScatalog(...)
polys <- st_read("shapefile.shp")
opt_output_files(ctg) <- "folder/plot_{ID}"
new_ctg <- clip_roi(ctg, polys)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.