View source: R/reconstruct_ground.R
reconstruct_ground | R Documentation |
Reconstructs the ground surface with a grid resolution defined
by the user and adds a second grid around the animal position with an
optimal resolution so that no sightline can pass through the ground when
computing visibility with the visibility
function.
reconstruct_ground( data, ground_res, position, angular_res, method, full_raster, ... )
data |
LAS class object containing a 3d point cloud + a Classification
field that classes points as ground and non-ground, as provided by the
|
ground_res |
numeric. The grid resolution to reconstruct the ground on the entire 3D scene. Default = 0.05. NOTE: a if needed, second grid may be added with smaller (internally computed) resolution. |
position |
vector of length 3 containing the xyz coordinates of the
animal position when computing the visibility with the
|
angular_res |
numeric. The angular resolution of sightlines when
computing the visibility with the |
method |
which algorithm to use for spatial interpolation. Can be
"knnidw", "tin" or "kriging". See documentation from the
|
full_raster |
should the entire raster be interpolated for the ground
portion around the animal position? Parameter passed to the
|
... |
other arguments to pass to the spatial interpolation algorithm.
See documentation from |
A LAS class object containing the 3D point cloud coordinates
with the ground reconstructed to be passed directly to the
visibility
function. Note: the Classification field is
preserved.
#- import the tree_line_plot dataset file <- system.file("extdata", "tree_line_plot.laz", package="viewshed3d") tls <- lidR::readLAS(file,select="xyz") #- class ground and vegetation points class <- lidR::classify_ground(tls, lidR::csf(rigidness = 1L, class_threshold = 0.2, sloop_smooth = FALSE)) #- reconstruct the ground. Here the ground is reconstructed with the user #- defined resolution only. recons <- viewshed3d::reconstruct_ground(data=class,position = c(0,0,3), ground_res = 0.05, angular_res = 2, method="knnidw") lidR::plot(recons,color="Classification", colorPalette = c("darkgreen","chocolate4")) #- when the position is closer to the ground, the user defined resolution is #- not sufficient and a second grid is added with the optimal resolution so #- that no sightline can pass trough the ground when computing visibility. #- In this example, full_raster = TRUE was used as a portion of the ground #- near the animal location is not reconstructed because of a data #- gap around a TLS scan position when using full_raster = FALSE. recons <- viewshed3d::reconstruct_ground(data=class,position = c(0,0,1), ground_res = 0.05, angular_res = 2, method="knnidw", full_raster = TRUE) lidR::plot(recons,color="Classification", colorPalette = c("darkgreen","chocolate4"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.