使用 rLiDAR 中的 chullLiDAR2D 函数计算凸包时出现此错误。有趣的是,在同一个 LAS 文件上使用 chullLiDAR3D 计算 3D 凸包时,我没有收到此错误。我已经发布了代码和 XY_ID 变量以供进一步参考。
谢谢,
#Computing and plotting the 2D-convex hull of a LAS file
#Importing the LAS file
library(rLiDAR)
LAS_File <- system.file("test.las", package = "rLiDAR")
#Read the LAS file
LAS <- readLAS("D:/Summer_2019/NRS_Project/01_data/01_las_2013/test.las", short = TRUE)
#Subsetting the height of the data
XYZ <- subset(LAS[,1:3],LAS[,3] >= 1.37)
#Get the LiDAR clusters
set.seed(1)
clLAS <- kmeans(XYZ, 32)
#Setting the IDs of the points
ID <- as.factor(clLAS$cluster)
#Setting the XYZID input
XY_ID <- cbind(XYZ[,1:2],ID)
summary(XY_ID)
View(XY_ID)
#Calculating the LiDAR convex hull of the clusters
chull_Trees <- chullLiDAR2D(XY_ID)