我在使用rlas和rLiDAR包读取和编辑LAS文件时遇到了问题。我浏览了他们的PDF文档上的示例,但不断收到错误。下面是rlas包。
> lasfile <- system.file("LAS", "42389364730000.las", package = "rlas")
> lasdata <- rlas::readlasdata(lasfile)
ERROR: wrong file signature '~Version Information
VERS. 2.0:
WRAP. YES:
END. PE'
ERROR: cannot open lasreaderlas with file name 'C:\Users\Paul.Victor\Documents\R\R-3.4.3\library\rlas\LAS\42389364730000.las'
Error: LASlib internal error. See message above.下面是rLiDAR错误...
> lasfile <- system.file("LAS", "42389364730000.LAS", package = "rLiDAR")
>
> lasdata <- readLAS(lasfile, short = TRUE)
Error in readLAS(lasfile, short = TRUE) :
The LASfile input is not a valid LAS file我已经将LAS文件保存在system.file()中每个包的文件夹中,类似于他们的PDF上的示例。任何帮助解决这些问题或引导我到不同的库,将非常感谢!
发布于 2018-10-12 04:22:04
问题是,您正在使用的库是为激光雷达LAS文件设计的,而您正在尝试读取的文件是well log LAS文件格式...具有相同文件扩展名的两种不同规程/数据类型。
发布于 2017-12-14 01:16:20
您没有正确调用文件路径。如果您想访问示例文件,可以使用system.file函数,但如下所示:
> library(rlas)
> lasfile <- system.file("extdata", "example.laz", package = "rlas")
> lasdata <- rlas::readlasdata(lasfile)
> str(lasdata)
Classes ‘data.table’ and 'data.frame': 30 obs. of 13 variables:
$ X : num 339003 339003 339003 339003 339004 ...
$ Y : num 5248001 5248000 5248000 5248000 5248000 ...
$ Z : num 976 975 974 974 974 ...
$ gpstime : num 269347 269347 269347 269347 269347 ...
$ Intensity : int 82 54 27 55 117 81 84 104 91 99 ...
$ ReturnNumber : int 1 1 2 2 1 1 1 1 1 1 ...
$ NumberOfReturns : int 1 1 2 2 1 1 1 1 1 1 ...
$ ScanDirectionFlag: int 1 1 1 1 0 0 1 1 1 1 ...
$ EdgeOfFlightline : int 1 0 0 0 0 0 1 0 0 0 ...
$ Classification : int 1 1 1 1 1 1 1 1 1 1 ...
$ ScanAngle : int -21 -21 -21 -21 -21 -21 -21 -21 -21 -21 ...
$ UserData : int 32 32 32 32 32 32 32 32 32 32 ...
$ PointSourceID : int 17 17 17 17 17 17 17 17 17 17 ...
- attr(*, ".internal.selfref")=<externalptr> 请参见here以查看文件所在的位置。
要导入您自己的文件,只需指定正确的路径,例如
lasfile <- C:/Users/Paul.Victor/Documents/myproject/myfile.lazhttps://stackoverflow.com/questions/47797573
复制相似问题