3

I want to generate a DEM using a point cloud (.las) for which I tried reading it in R using rlas, lidR and rLiDAR : readLAS command and none of it seems to work.

The LASfile is not being read at all. The error is :

Error in readBin(con, "raw", size = 1, n = 4, endian = "little") : 
  can only read from a binary connection
In addition: Warning message:
In file(LASfile, open = "rb") :
  file("") only supports open = "w+" and open = "w+b": using the former

And the code is:

library(lidR)
library(rLiDAR)
library(rlas)
setwd("D:/Thing/Path")
LASfile <- system.file("extdata", "ABCD.las", package="rLiDAR")
rLAS <- readLAS(LASfile, short = TRUE)
2
  • Without some information about that file we can't help. Is it text or binary? What format is it supposed to be? Do any other files that are supposed to be that type work or you? Can we get the file?
    – Spacedman
    Commented Nov 18, 2018 at 12:06
  • I don't have any other file so I don't know if it works with others. The file is too big and it is .las format.
    – ADIR
    Commented Nov 18, 2018 at 13:28

1 Answer 1

4

You are trying to read the file "ABCD.las" from the package rLiDAR. The package rLiDAR does not have such file. You probably meant something like:

readLAS("D:/Thing/Path/ABCD.las")

Also you loaded both lidR and rLiDAR that both have a readLAS function that give two different outputs. You are likely to run into trouble using the two packages simultaneously. In addition rlas is the backend that drives read/write of las files in lidR. You will almost never need to load this package in your workspace.

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.