View source: R/connected_components.R
knn_distance | R Documentation |
Computes the average distance between each point and its k-nearest neighbors in a point cloud. The results are stored in a new attribute.
knn_distance(las, k = 10, name = "distance")
las |
A LAS object representing the point cloud data. |
k |
The number of nearest neighbors. |
name |
A string specifying the name of the new attribute used to store the computed distances. |
A LAS object with an additional attribute named as specified by 'name'.
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyz", filter = "-inside 481250 3812980 481300 3813030")
las = knn_distance(las)
#plot(las, color = "distance", breaks = "quantile", legend = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.