2

I would like to have an idea about the classification of point clouds loaded in a LAScatalog with lidR. With a las file, I can do this way:

library(lidR)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)
table(las$Classification)

How can I perform such queries with LAScatalog?

1
  • You have to read the files to get these information. They are not stored in the header and are thus not accessible in a LAScatalog
    – JRR
    Commented Feb 8, 2021 at 13:18

1 Answer 1

3

You have to read the files to get these information. The header of a las file does not store a summary of the classification. Consequently a LAScatalog cannot access such information because it only reads the headers. You can loop through your files:

lapply(files, function(file) {
  las <- readLAS(files, select = "c")
  table(las$Classification)
})

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.