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

Error when running grid_terrain() #332

Closed
lucas-johnson opened this issue Mar 25, 2020 · 8 comments
Closed

Error when running grid_terrain() #332

lucas-johnson opened this issue Mar 25, 2020 · 8 comments
Assignees
Labels
Bug A bug in the package

Comments

@lucas-johnson
Copy link

lucas-johnson commented Mar 25, 2020

Running grid_terrain() on a catalog with the following settings:

opt_stop_early(ctg) <- FALSE
opt_chunk_buffer(ctg) <- 100
opt_filter(ctg) <- "-drop_withheld -drop_class 7 18"
opt_output_files(ctg) <- "~/Downloads/dtm/{*}"
opt_progress(ctg) <- FALSE

I have also selected some files as buffer only:
image

I get the following error message:

> grid_terrain(ctg, res=1, knnidw(k=5))
The original tiling pattern does not match with the resolution 1. Chunks were extended to avoid partial pixels.
Error in if (all(!process[tile_is_in_bbox])) select <- FALSE else if (sum(tile_is_in_bbox) >  : 
  missing value where TRUE/FALSE needed
@Jean-Romain
Copy link
Collaborator

This is not related to grid_terrain but to the function that creates the chunks. Please save your LAScatalog with saveRDS and share it. This should be enought to reproduce. Please also mention your lidR version.

@Jean-Romain Jean-Romain self-assigned this Mar 25, 2020
@Jean-Romain Jean-Romain added the Bug A bug in the package label Mar 25, 2020
@lucas-johnson
Copy link
Author

lucas-johnson commented Mar 25, 2020

Yeah it seems to be a problem with grid_metrics as well. I encountered the bug with the devel branch (lidR 3.0.0), but have since reinstalled the current cran distribution (lidR 2.2.3), and have the same issue.

ctg_chunk_bug.rds

@lucas-johnson
Copy link
Author

Seems to be working in version 2.2.2

@Jean-Romain
Copy link
Collaborator

Could you confirm if this work or not

lidR:::catalog_makecluster(ctg)

Surprisingly it works on my computer

@lucas-johnson
Copy link
Author

Yes it works in version 2.2.3.

@Jean-Romain
Copy link
Collaborator

Ok I reproduced. It fails with the partial processing only.

library(lidR)
ctg = readRDS("~/Téléchargements/ctg_chunk_bug.rds")
lidR:::catalog_makecluster(ctg, realignment = list(res = 20, start = c(0,0))) # fail

ctg$processed = NULL
lidR:::catalog_makecluster(ctg, realignment = list(res = 20, start = c(0,0))) # ok

@Jean-Romain
Copy link
Collaborator

Jean-Romain commented Mar 25, 2020

Fixed, thanks

@lucas-johnson
Copy link
Author

Thanks so much!

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