Learn R Programming

lidR (version 2.2.5)

lasdetectshape: Estimation of the shape of the points neighborhood

Description

Computes the eigenvalues of the covariance matrix of the neighbouring points using several possible algorithms. The points that meet a given criterion based on the eigenvalue are labeled as approximately coplanar/colinear or any other shape supported.

Usage

lasdetectshape(las, algorithm, attribute = "Shape", filter = NULL)

Arguments

las

an object of class LAS

algorithm

An algorithm for shape detection. lidR has: shp_plane, shp_hplane and shp_line.

attribute

character. The name of the new column to add into the LAS object.

filter

formula of logical predicates. Enables the function to run only on points of interest in an optimized way. See also examples.

Value

A LAS object with a new column named after the argument attribute that indicates those points that are part of a neighborhood that is approximately of the shape searched (TRUE) or not (FALSE).

Examples

Run this code
# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)

las <- lasdetectshape(las, shp_plane(k = 15), "Coplanar")
plot(las, color = "Coplanar")

# Drop ground point at runtime
las <- lasdetectshape(las, shp_plane(k = 15), "Coplanar", filter = ~Classification != 2L)
plot(las, color = "Coplanar")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab