Closed spono closed 4 years ago
Reproducible example please.
(sorry)
ctg = catalog(las.folder)
opt_chunk_size(ctg) <- 500
opt_chunk_buffer(ctg) <- 10
r = grid_canopy(ctg, res=0.5, p2r(0.1))
BTW, in the meantime I rolled back to 2.1.4 and it goes like a charm.
As I mentioned, first install 2.2.0 from CRAN. lidR
has now more than 900 unit tests that all run on on my machine, on travis CI and on different computers flavors on CRAN. Your example is trivial and should work. I'm pretty sure it comes from your installation.
Also notice that catalog
is deprecated (not formally yet) and that chunk_buffer
is not respected by grid_canopy
(see the documentation). But it does not matter actually this won't affect how it works.
yup, I still have to catch up with some changes..!
BTW, yes: the task is super-trivial and I tested both with 2.2.0 (from CRAN) and 2.2.1 (github) but I got that error. Tomorrow I can test more and reinstall everything
Do you have troubleshooting with grid_canopy
only or with all other functions?
The file is a strip few kms long and 80m wide.
this morning I tested:
r = grid_canopy(ctg, res=0.5, p2r(0.1, na.fill=tin() ) )
Error: missing value where TRUE/FALSE needed
r = grid_canopy(ctg, res=0.5, p2r(0.1) )
i[1] is 1 which is out of range [1,nrow=0]
grid_terrain:
r = grid_terrain(ctg, res=0.5, algorithm = knnidw(k=5L))
i[1] is 1 which is out of range [1,nrow=0]
Warning message:
There were 5 degenerated ground points. Some X Y Z coordinates were repeated. They were removed.
grid_metrics:
r = grid_metrics(ctg, mean(Z), res=0.5)
i[1] is 1 which is out of range [1,nrow=0]
Warning messages:
1: Invalid data: RGB colors are recorded on 8 bits instead of 16 bits.
2: Invalid data: RGB colors are recorded on 8 bits instead of 16 bits.
Same results with 2.2.0(CRAN) and 2.2.1 (github). I tried different options within each size range for:
I'm open to suggestions.
I just ran the following on a fresh install on lidR 2.2.0 on a virtual machine (W7). It worked smoothly
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
ctg = catalog(LASfile)
opt_chunk_size(ctg) <- 150
opt_chunk_buffer(ctg) <- 10
r = grid_canopy(ctg, res=0.5, p2r(0.1))
No new of you. Did you fix your trouble?
No new of you.
(unfortunately) you're right :)
Did you fix your trouble?
No. The example code you posted works fine for me as well, so this makes me think it might be an issue related to the data itself (I'm waiting for permissions before sending it). Nevertheless, it's pretty weird that the same process works smoothly on 2.1.4 [maybe something related to decimals or something wrong in the header? who knows..].
BTW, tomorrow I'll be able to test it on other machines and I'll let you have some news.
No need to send the cloud for the moment. Save the catalog with saveRDS
and share please.
I cannot reproduce only with the catalog. Without the point cloud I can only fake run the processing without actually computing anything. This is what I did and it worked
ctg = readRDS("/home/jr/Téléchargements/bug_314/ctg_test2_W10_R362_v220cran.rds")
opt_chunk_size(ctg) <- 500
opt_chunk_buffer(ctg) <- 10
plot(ctg, chunk = TRUE)
lidR:::catalog_fakerun(ctg, perror = 0)
If the code above works on your machine, I will need a point cloud and a fully (minimal) reproducible example. If you can reproduce with a single tile it 's better
You did not told me that it append only in the 3rd chunk. So it was useless to test only with a catalog and without data. Now please make a complete minimal reproducible example that fails. An example in which I don't have to guess anything please...
Edit: and not screen shoot please. One R file that works standalone and one las file (the one from your screenshot)
it fails on the first empty chunk it finds: 3rd in the case of chunk_size = 500
, 1st chunk in the case of chunk_size = 50
.
BTW, I send everything asap
So if I'm able to create an empty chunk I'm able to reproduce in theroy. Let me try first.
Ok I reproduced easily. The next time please give me all the information the first time that will save us a lot of time. It comes from readLAS
that fails at reading empty chunk for a reason I ignore. I will push a fix soon.
chunk <- readRDS("/tmp/RtmpX2pUzz/chunk3.rds")
las <- readLAS(chunk)
#> Error in `[.data.table`(data, 1:.N, `:=`(X = round_any(X, factor), Y = round_any(Y, :
#> i[1] is 1 which is out of range [1,nrow=0]
Fixed
ok, great! first guess was the correct one, then. Sorry to make you lose time and thanks for the patience, as usual.
Ciao JR, playing around with 2.2.0/.1 (as a result of #313 ) I'm not able anymore to process a catalog without getting the following:
Error: i[1] is 1 which is out of range [1,nrow=0]
Might it be related to wrong handling of empty chunks?