Closed flottsam closed 2 years ago
Please provide a minimal reproducible example. Did you normalize with normalize_height()
?
Hi. This seems to be closed but I have the same problem. I am using some normalized clouds generated some years ago in LP360 and were stored in txt format. I used txt2las to convert them to LAS but when I try to unnormalize them it gives the error mentioned above. The clouds are classified into ground and no-ground. Is it possible to add this "Zref" attribute? Also, it might be worthy to mention that I have access to data of the same sites to create a DTM.
HI. I came up with this workaround:
library(lidR)
library(terra)
library(sf)
dtm = terra::rast("path_to_dtm")
las = readLAS("path_to_las_file")
points <- st_as_sf(x = data.frame(las$X, las$Y),
coords = c("las.X", "las.Y"),
crs = st_crs(25832))
Zdtm <- terra::extract(dtm, terra::vect(points))
las_unn = las
las_unn$Z = las_unn$Z + Zdtm[,2]
I just tried to
unnormalize_height(las)
, but received the error:I've not had this problem in the past. It appears that the
Zref
attribute is indeed missing in the normalized las file.