add_slope: Put slope back into data

View source: R/add_slope.R

add_slopeR Documentation

Put slope back into data

Description

Reverse the result of the remove_slope function.

Usage

add_slope(data)

Arguments

data

a LAS of a TLS scene from which the slope was previously removed.

Value

a LAS with slope.

Examples


#- import the tree_line_plot dataset
file <- system.file("extdata", "tree_line_plot.laz", package="viewshed3d")
tls <- lidR::readLAS(file)

center <- c(0,0,2) # defines the scene center for the entire process
angle <- 1 # defines the angular resolution for the entire process

#- remove noise to avoid visibility estimates error
tls_clean <- viewshed3d::denoise_scene(tls,method="sd",
                                       filter=6)


#- class ground and vegetation points
class <- lidR::classify_ground(tls_clean, lidR::csf(rigidness = 1L,
                                                 class_threshold = 0.2,
                                                 sloop_smooth = FALSE))


# remove the slope from the classified scene
no_slope <- viewshed3d::remove_slope(data = class,c(0,0,0))

# add the slope
slope_back <- viewshed3d::add_slope(no_slope$data)


Blecigne/viewshed3d documentation built on Nov. 5, 2022, 9:08 p.m.