-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
write.las writes a deeply corrupted file #25
Comments
The error is reproducible without data1 = read.las("~/Téléchargements/SubArea_012_011.8_6.las")
header1 = read.lasheader("~/Téléchargements/SubArea_012_011.8_6.las")
f = tempfile(fileext = ".las")
write.las(f, header1, data1)
data2 = read.las(f)
#> ERROR: 'end-of-file' after 6359 of 6365 points
#> Warning: there are 19 points flagged 'withheld'.
#> Warning: there are 3658 points flagged 'synthetic'.
header2 = read.lasheader(f) |
Well, I found the issue. But in the meantime I don't know how to fix it and I'm not even sure if I should fix it. Basically the header states to add an offset in the binary file but this offset is not respected. I'm not going through details. The following fixes your issues waiting for a better internal fix. library(lidR)
las = readLAS("SubArea_012_011.8_6.las")
las@header@PHB$`Header Size` = 235
f = tempfile(fileext = ".las")
writeLAS(las, f) I'm wondering if @floriandeboissieu have a better understanding of the header size management in LASlib |
Ok, thank you JR!
|
Sorry for the late answer, I don't have much time this end of year. |
Hello, I have a specific set of laz files that result in strange behavior when read / write with lidR
SubArea_012_011.8_6.las.zip
The text was updated successfully, but these errors were encountered: