This function computes topographic variables from a point cloud
exposition
altitude
slope.
Values are computed after fitting a plane to the points. It supposes a
homogeneous sampling of the plot by points. Points can be cropped on disk if
center and radius are provided. In case a centre is provided, the altitude
is computed by bilinear interpolation at the center location
(rasterize_terrain
with tin
algorithm),
otherwise it is the mean of the points altitude range.
terrain_points_metrics(p, centre = NULL, r = NULL)
a data.frame with altitude, exposition (gr), slope (gr) and adjR2 of plane fitting
matrix, data.frame or LAS
object with ground point
coordinates (X, Y, Z). In case of an object which is not LAS, the object is first
converted.
vector. x y coordinates of center to extract points inside a disc
numeric. radius of disc
# set number of threads
lidR::set_lidr_threads(2)
# sample points
XYZ <- data.frame(x = runif(200, -10, 10), y = runif(200, -10, 10))
XYZ$z <- 350 + 0.3 * XYZ$x + 0.1 * XYZ$y + rnorm(200, mean = 0, sd = 0.5)
# compute terrain statistics
terrain_points_metrics(XYZ)
terrain_points_metrics(XYZ, centre = c(5, 5), r = 5)
# with a LAS object
LASfile <- system.file("extdata", "las_chablais3.laz", package="lidaRtRee")
las_chablais3 <- lidR::readLAS(LASfile)
terrain_points <- lidR::filter_ground(las_chablais3)
terrain_points_metrics(terrain_points)
terrain_points_metrics(terrain_points, centre = c(974360, 6581650), r = 10)
Run the code above in your browser using DataLab