Closed spono closed 11 months ago
I'm not sure to understand. The code failed while processing chunk 22 or did it process everything and failed at the end while merging the partial outputs?
(Sorry, I came back to this only today)
I partially updated the previous comment to keep the conversation clean. Anyway, I would say that it processes fine but it fails to merge the tile output to the one coming from the previous tiles due to a NULL
. And this blocks the whole process.
BTW, I checked better and I imagine that it might be related to the drop_null
option in the catalog_apply
engine, which is set to FALSE
.
If I'm correct, at this point, I ask you how to set it to TRUE
when used with functions other than catalog_apply
such as, e.g., crown_metrics
(my case).
In the code you write "not intended to be used by regular users": could it be an idea to expose it as opt_drop_null(ctg) = TRUE
?
drop null is supposed to be already true. Anyway, you are not supposed to used it. Does the following look like a valid reproducible example ?
library(lidR)
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
ctg = readLAScatalog(LASfile)
las <- readLAS(LASfile, select = "xyz", filter = "-inside 481250 3812980 481300 3813030")
ttops <- locate_trees(las, lmf(ws = 5))
res = list(ttops, list(NULL), ttops)
engine_merge(ctg, res)
Fixed. The case was originally handled but moving to sf
reintroduced it.
Ciao JR, I'm delineating the tree crowns from a large dataset running this:
and I got this error:
Luckily, your fail-safe code outputs a list of
sf
objects. As a cross-check, I tried to merge such list withdplyr::bind_rows
and it gets merged with no issues, producing ansf
object with the crowns from the few processed tiles. I quickly checked the point clouds and I confirm that the tile that failed (i.e.chunk22
mentioned above) didn't have any segmented object in it. So, the warningNo tree found
is correct but I don't understand why the second one saysMerging is impossible
.Is that the desired behaviour? Would be possible to fix it allowing to skip to the next tile or to remove NULL values before merging?
Dealing with high mountain areas it is not rare that a tile covers only high elevation rocky spots with nothing to segment.