add_verticality: Add point-wise verticality from local PCA

View source: R/traits_from_point_cloud.R

add_verticalityR Documentation

Add point-wise verticality from local PCA

Description

Computes a verticality metric (0-1) for each point in a LAS object based on the z-component of the dominant local PCA eigenvector.

Usage

add_verticality(las, k = 30, name = "verticality")

Arguments

las

A LAS object.

k

Number of nearest neighbors for local PCA.

name

Name of the attribute to store.

Value

The input 'LAS' object with a new numeric attribute containing verticality values (0–1).

Examples


las = lidR::readLAS(system.file("extdata", "tree_0744.laz", package="tReeTraits"))
las = add_verticality(las, k = 20)
head(las@data)


tReeTraits documentation built on Feb. 26, 2026, 1:07 a.m.