0

I'm having difficulty with the method to obtain the percentage of points classified as ground using grid_metrics(). I would like to implement pground (one metric) like stdmetrics (a set of metrics), but can't see how.

Does it have to be set up in a custom function instead?

The reference I'm using:

https://www.rdocumentation.org/packages/lidR/versions/3.1.0/topics/stdmetrics

1 Answer 1

3

It is not clear what your problem is. If the following does not anwser your question please edit your question to clarify.

library(lidR)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)
pground <- grid_metrics(las, ~sum(Classification == LASGROUND)/.N*100, 10)
plot(pground, col = gray.colors(50))

0

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.