2

I'm using lidR 3.1.2. This problem has been occurring since very recently with the following error

Error in eval(call("@", object, slot)) : 
  no slot of name "EVLR" for this object of class "LASheader"`

The error occurs when I try to view the header, or with writeLAS().

On another computer that initially had version 3.1.1, there was no problem dealing with the exact same .Rdata containing the object. I updated it to 3.1.2 and the error occurred there as well.

The .Rdata file was created earlier containing an object which is a list of point cloud subsets. The subsets were created using lidR functions.

Furthermore, I reinstalled the previous version and there was no problem viewing the header.

1 Answer 1

2

In lidR 3.1.2 the class LASheader has a new slot @EVLR to be compatible with rlas 1.4.0 which bring a better support of LAS formats (especially 1.4) by allowing (among other) to read and write Extended Variable Length Records. This change is expected to be backward compatible so you should not have a problem but you loaded an already existing R object saved in a .rds or .Rdata file which is not longer in a compatible format.

To fix it, read your LAS file again with readLAS(). If, for a reason or another, you can't read again the file you should be able to init @EVLR manually then save back the .Rdata. I tested it:

# with 3.1.1
library(lidR)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)
saveRDS(las, "Megaplot.rds")

# with 3.1.2
las <- readRDS("Megaplot.rds")
las@header # broken
las@header@EVLR <- list()
las@header # fixed
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.