- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 15
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 trying to use the rlas lidr command readLAS with some .las files #70
Comments
Reproduced. It comes from the extrabytes
|
The problem is in LASlib. Try it with LASools: it crashes las2txt crash-clip20m.las -parse xyz0 -otxt This should be reported in LAStools https://github.com/LAStools/LAStools. I don't know if the file is corrupted or not. It is impossible to read the extra bytes. You can read the file without the extrabytes rlas::read.las("~/Téléchargements/test/crash-clip20m.las", select = "xyz") I think it the same bug than #59 and I will probably not fix it. You are saying that QGIS reads it properly but does QGIS loads extrabytes? |
Much appreciated, this is very helpful. Based on the information I did figure a kind of ugly work around by loading the file into R with only the xyz points (ie. If it is of interest, I did try converting a file to las 1.4 using LASTools las2las tool- the result would open in Agisoft but not in QGIS and not in R/lidR possibly any issues with 1.2 just persist through? I will try exporting my original file as las 1.4 and beginning with that one, possibly that will sidestep the issue- sounds like that is where my files should be anyways. I will report this at LASTools as suggested. Very much appreciate the advice and expertise! |
Notice that in
For the other questions, I'm sorry, in absence of reproducible examples and reproducible files I can't say anything. |
Please delete your lastools bug report and create a dedicated one for lastools that do not mention |
My apologies, I am new to this and just getting a grasp on the various dependencies I did not realize lidR was also running on the LASlib. I've run the issue down a bit farther and it appears that the problem happens when files are created by whiteboxtools (the crash-clip file I provided was a clip from a las file created by whiteboxtools. I am confused about how LASTools can work with the file but lidR cannot since they are both using LASlib. It looks like I cannot delete my post but I will edit/update the issue. |
As shown above lastools does not work. As long as it does not try to read the extrabyte values it works. But if you try to read the extrabyte it crashes. |
Fully updated versions of R, rlas, lidr (version 4.1.1). I am working with las files created in Agisoft Metashape with no problem.
If I try to load the same dataset created in LASTools or Whiteboxtools (opencore for both) R crashes consistently. These files open and I have no issues in other software (i.e. QGIS).
Tried in RStudio as well as regular R Terminal, tried with the files formatted as both las and laz files. Since it sounds like CRS informaiton can be a cause of something like this I viewed the las files headers and compared CRS information. It appears identical line-for-line in the files that work and those that do not, additionally readLAScatalog() when applied to the files will report the correct CRS. However I cannot work with the files without readLAS.
test.zip
I have created very small subset files that show the issue- clip20m.las was created in Agisoft Metashape and lidR and loads just fine. crash-clip20m.las was created in AgisoftMetashape and LASTools lasclip, it cannot be read into lidR with readlas() as it causes an immediate crash of R or RStudio.
QGIS will read both files just fine including the CRS information. Would prefer to be able to use multiple sets of tools (WBT, LASTools, lidR, etc.), also concerned if there is some problem with the files although they appear to validate as correct to ASPRS format with lasvalidate. Currently my primary reason to switch between software packages is the ability to fully remove degenerated ground points with the same xy coordinates which it seems there is not a straightforward method for in lidR (duplicates only removes those with the same xy&z).
I don't get any error messages as R promptly crashes with the gray bomb and closes. Is this user error or a bug? Either way any ideas of how to solve it? Still pretty new to working with lidar files and jumping back into using R after many years, any help is much appreciated!
The text was updated successfully, but these errors were encountered: