Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voxel_metrics() results are different with all_voxels=TRUE #437

Closed
zoeschindler opened this issue Jun 4, 2021 · 4 comments
Closed

voxel_metrics() results are different with all_voxels=TRUE #437

zoeschindler opened this issue Jun 4, 2021 · 4 comments
Assignees
Labels
Bug A bug in the package

Comments

@zoeschindler
Copy link

zoeschindler commented Jun 4, 2021

Hello,

I really hope this is not some embarrassing user-side error, but I've got an issue with voxel_metrics(). Depending on whether I use all_voxels=TRUE or all_voxels=FALSE, it returns different results:

voxels <- voxel_metrics(las, length(X), res=0.1, all_voxels=FALSE)
nrow(voxels[voxels$V1 > 0 & voxels$Z > 0.65 & voxels$Z <=0.95])
#> [1] 212
voxels <- voxel_metrics(las, length(X), res=0.1, all_voxels=TRUE)
nrow(voxels[voxels$V1 > 0 & voxels$Z > 0.65 & voxels$Z <=0.95])
#> [1] 0

It also happens when I beforehand exchange the NAs with 0s:

voxels <- voxel_metrics(las, length(X), res=0.1, all_voxels=FALSE)
nrow(voxels[voxels$V1 > 0 & voxels$Z > 0.65 & voxels$Z <=0.95])
#> [1] 212
voxels <- voxel_metrics(las, length(X), res=0.1, all_voxels=TRUE)
voxels$V1[is.na(voxels$V1)] <- 0
nrow(voxels[voxels$V1 > 0 & voxels$Z > 0.65 & voxels$Z <=0.95])
#> [1] 0

The result using all_voxels=FALSE is the right one. I would attach the las-file, but I don't know how to add a 122MB las-file here.

Edit: When I don't select the data depending on height, the difference is 301134 vs 43107 rows.

@Jean-Romain Jean-Romain self-assigned this Jun 4, 2021
@Jean-Romain
Copy link
Collaborator

Well, I will need the file. I'm sure you have access to a remote storage with your company/university. Or google drive with your google account if you have one. Also if it is a 122 MB las file it will become something like 25-50 MB laz file.

@zoeschindler
Copy link
Author

Here, I hope this works. I just put it into a zip-file.

@Jean-Romain Jean-Romain added the Bug A bug in the package label Jun 4, 2021
@Jean-Romain
Copy link
Collaborator

I found an important problem in the 3D rendering. I don't know exactly what it is but there is bug confirmed

@Jean-Romain
Copy link
Collaborator

I still do not understand exactly why there was a problem with the join but I fixed it anyway. The output is now correct and I also enhanced the plot function for a better rendering. Thank you for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in the package
Projects
None yet
Development

No branches or pull requests

2 participants