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 executing pipeline #25

Closed
wiesehahn opened this issue Apr 9, 2024 · 6 comments
Closed

R crashes when executing pipeline #25

wiesehahn opened this issue Apr 9, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@wiesehahn
Copy link

I try to run a simple pipeline, but R crashes (" R encountered a fatal error") quickly after execution start.
This does not happen for the example file ( f <- system.file("extdata", "Topography.las", package="lasR")) but for any of my tested files.

# does not work
library(lasR)

f = "folder/file.las"
pipeline <- reader(f) + dtm()
exec(pipeline)

So it seems that something with my file is the problem. However, with lidR I can read and plot the file.

# this works
library(lidR)

las <- readLAS("folder/file.las")
> summary(las)
class        : LAS (v1.4 format 8)
memory       : 1.6 Gb 
extent       : 558000, 558524.9, 5724000, 5725000 (xmin, xmax, ymin, ymax)
coord. ref.  : ETRS89 / ETRS89 / UTM 32N + DHHN2016 
area         : 485764 m²
points       : 17.31 million points
density      : 35.64 points/m²
density      : 26.98 pulses/m²
File signature:           LASF 
File source ID:           0 
Global encoding:
 - GPS Time Type: Standard GPS Time 
 - Synthetic Return Numbers: no 
 - Well Know Text: CRS is WKT 
 - Aggregate Model: false 
Project ID - GUID:        00000000-0000-0000-0000-000000000000 
Version:                  1.4
System identifier:        LAStools (c) by rapidlasso GmbH 
Generating software:      las2las64 (version 200813) 
File creation d/y:        292/2023
header size:              375 
Offset to point data:     3115 
Num. var. length record:  5 
Point data format:        8 
Point data record length: 59 
Num. of point records:    17313297 
Num. of points by return: 13108155 2637306 1149427 341107 68044 8956 286 14 2 0 0 0 0 0 0 
Scale factor X Y Z:       0.001 0.001 0.001 
Offset X Y Z:             0 5e+06 0 
min X Y Z:                558000 5724000 217.37 
max X Y Z:                558524.9 5725000 310 
Variable Length Records (VLR):
   Variable Length Record 1 of 5 
       Description: by LAStools of rapidlasso GmbH 
       Tags:
          Key 1024 value 1 
          Key 3072 value 25832 
          Key 3076 value 9001 
          Key 4099 value 9001 
          Key 4096 value 7837 
   Variable Length Record 2 of 5 
       Description: RIEGL Extra Bytes 
       Extra Bytes Description:
          Distance: Distance
          Group: Group
          Normal: Normal vector 2+15+15 bits
   Variable Length Record 3 of 5 
       Description:  
       Extra Bytes Description:
          Distance: Distance
          Group: Group
          Normal: Normal vector 2+15+15 bits
   Variable Length Record 4 of 5 
       Description: TerraScan Extra Bytes 
       Extra Bytes Description:
          Distance: Distance
          Group: Group
          Normal: Normal vector 2+15+15 bits
   Variable Length Record 5 of 5 
       Description: by LAStools of rapidlasso GmbH 
       WKT OGC COORDINATE SYSTEM: COMPD_CS["ETRS89 / ETRS89 / UTM 32N + DHHN2016",PROJCS["ETRS89 / ETRS8 [...] (truncated)
Extended Variable Length Records (EVLR):  void

Any idea what might cause this problem?

@Jean-Romain
Copy link
Collaborator

I need one of your file. The problem is likely related to the format 1.4 maybe with the pdrf 8.

@Jean-Romain Jean-Romain self-assigned this Apr 9, 2024
@Jean-Romain Jean-Romain added the bug Something isn't working label Apr 9, 2024
@Jean-Romain
Copy link
Collaborator

Reproduced with

library(lasR)
f <- system.file("extdata", "las14_prf6.laz", package="rlas")
pipeline <- reader(f) + dtm()
exec(pipeline)

Jean-Romain added a commit that referenced this issue Apr 10, 2024
@Jean-Romain
Copy link
Collaborator

Jean-Romain commented Apr 10, 2024

I fixed my issue, which was related to the fact that there was 0 ground point. Maybe your issue is different. In my case the error is now

Erreur : in 'triangulate' while processing the point cloud: impossible to construct a Delaunay triangulation with 0 points

By the way the correct syntax is now (from 0.3.0)

pipeline <- reader_las() + dtm()
exec(pipeline, on = f)

reader_las() can be conveniently omitted. Do not forget to read the changelog. lasR is still maturing, the API is not definitive and may change.

@wiesehahn
Copy link
Author

thanks, fixed it.
Forgot that the files were unclassified, with prior ground classification it works.

@wiesehahn
Copy link
Author

By the way the correct syntax is now (from 0.3.0)

pipeline <- reader_las() + dtm()
exec(pipeline, on = f)

reader_las() can be conveniently omitted. Do not forget to read the changelog. lasR is still maturing, the API is not definitive and may change.

You might want to change this under e.g. https://r-lidar.github.io/lasR/reference/chm.html#ref-examples where its written as

f <- system.file("extdata", "Topography.las", package="lasR")
pipeline <- reader(f) + chm()

@Jean-Romain
Copy link
Collaborator

Thank you for reporting. I updated the doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants