Voxel metrics summarized into pixels #591
Unanswered
RCBlackburn
asked this question in
Q&A
Replies: 1 comment
-
It is unclear what you are trying to do. To my understanding your are trying to count the number of points per 2x2x2 voxel and then average that per 20x20 pixel. I think this should do the job library(lidR)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)
vox = voxel_metrics(las, .(N = length(Z)), res = 2)
vox = LAS(vox)
pix = pixel_metrics(vox, .(avgN = mean(N)), res = 20) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Does the package currently allow for a workaround of summarizing the
voxel_metrics()
output by usingpixel_metrics()
? For example, in the below code, I am attempting to summarize mean points per voxel with 20 m resolution pixels using the Megaplot.laz file. However,voxel_metrics()
needs to be inside the custom functionstd_voxel()
and requires an las whichpixel_metrics()
can't seem to supply. This results in the entire las file being processed at once withpixel_metrics()
output having one value that is the mean of the entire las. Essentially, I was wondering if there is a way to usevoxel_metrics()
withinpixel_metrics()
currently or if it could be easily adjusted to work?Beta Was this translation helpful? Give feedback.
All reactions