Skip to content
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

R crashes when reading in laz files with lidR #56

Open
AndresKasekamp opened this issue Apr 27, 2022 · 3 comments
Open

R crashes when reading in laz files with lidR #56

AndresKasekamp opened this issue Apr 27, 2022 · 3 comments
Assignees
Labels
Bug A bug in the package Segfault Session crashed

Comments

@AndresKasekamp
Copy link

I have problem with reading in laz files from one of the flight years from my NMA. It causes RStudio to crash without any messages. All the other years work perfectly and I can easily apply functions to it. Using the erroneous laz files in LASTools has not produced any errors. I am using the latest lidR version.

It is probably related to https://stackoverflow.com/questions/60457539/lidr-readlas-function-crashes-r-when-reading-some-las-files .

I am attaching a Google Drive link with the error and no error laz files.
https://drive.google.com/drive/folders/1SVsfenH_petxogLg7-QvBaeQ98aHrDvj?usp=sharing

@r-lidar r-lidar deleted a comment from AndresKasekamp Apr 27, 2022
@Jean-Romain Jean-Romain transferred this issue from r-lidar/lidR Apr 27, 2022
@Jean-Romain
Copy link
Collaborator

This is not related to lidR. Moved to rlas

library(rlas)
las = read.las("issue 574/no_error.laz")

@Jean-Romain Jean-Romain self-assigned this Apr 27, 2022
@Jean-Romain Jean-Romain added Bug A bug in the package Segfault Session crashed labels Apr 27, 2022
@AndresKasekamp
Copy link
Author

AndresKasekamp commented May 3, 2022

I managed to solve the problem. The erroneous laz had Extra Byte attributes Amplitude and Pulse width. The no error laz had Amplitude, Pulse width, Reflectance and Deviation. They are numbered 1-4 accordingly. By specifying which attributes to read in (or not to read in), RStudio did not crash anymore. For example

 las <- readLAS(r"(laz_check\error.laz)", select = "xyzia")

lidR reads every attribute in by default. However, it it is interesting that my error.laz had attributes Amplitude and Pulse width, but I cannot use them. The error.laz Amplitude did have a different type than no_error.laz (4 (short) vs 3 (unsigned short)). However, Pulse width had the same data type and using "xyzia2" still causes RStudio to crash.

@Jean-Romain
Copy link
Collaborator

Thanks for the investigation. This helps to narrow down the potential issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in the package Segfault Session crashed
Projects
None yet
Development

No branches or pull requests

2 participants