In my workflow, I'm working with a large LAS catalog to segment trees. The process for doing this involves normalizing the LAS tiles, then segmenting the trees, and then unnormalizing the tiles at the end. Because of the steps involved, I have to specify in the normalize_height()
function the add_lasattribute
argument to be TRUE because if it's not and a LAS tile is saved, then I cannot unnormalize it later on. What I am finding is when the add_lasattribute
argument is set to TRUE, and then the tile is unnormalized and then you try to write the tile to a new file, an error occurs due to extra bytes in the header. Here is a reproducible example:
library(lidR) LASfile <- system.file("extdata", "Topography.laz", package="lidR") las <- readLAS(LASfile) nlas <- normalize_height(las, tin(), add_lasattribute = TRUE) unlas <- unnormalize_height(nlas) writeLAS(unlas, file.path(tempdir(), "unlas.las")) # Error: Invalid file: the header describes extra bytes attributes that are not in the data.
My current workaround is to put the unnormalization step for my catalog into a custom catalog_apply
function which manually removes the extra bytes from the header after the unnormalization. I am wondering if this behaviour could be modified in the unnormalize_height()
function so that the header information is being properly updated to remove the extra bytes that are added due to the add_lasattribute = TRUE
argument in the normalize_height()
function?
Additionally, would it be possible to add documentation to the normalize_height()
function such that it includes the add_lasattribute
and Wdegenerated
arguments? I noticed these get passed on as ...
in the function itself, but they don't show up in the help file when called with ?normalize_height
.
Many thanks for your help!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4