lidar_clip_and_stats | R Documentation |
lidar_clip_and_stats
is a wrapper for the $clip_and_stats
method of lfcLiDAR
objects. See lidar
.
lidar_clip_and_stats(object, sf, polygon_id_variable, variables)
object |
|
sf |
sf object with the polygon/s to clip |
polygon_id_variable |
character vector of length 1 with the name of the
variable of |
variables |
character vector with the names of the variables to access |
The stats returned are the following:
poly_km2
: Area in square kilometers of the polygon supplied
pixels
: Pixel count intersecting with the polygon supplied. Only pixels
with value are counted
average
: Average value for the pixels intersecting with the polygon
supplied
min
: Minimum value for the pixels intersecting with the polygon
supplied
max
: Maximum value for the pixels intersecting with the polygon
supplied
sd
: Standard deviation value for the pixels intersecting with the
polygon supplied
km2
: Area covered by the raster intersecting with the polygon supplied
km2_perc
: Percentage of the supplied polygon area covered by the raster
This function returns the same sf object provided with new columns with the mean of each polygon for each variable requested.
Other LiDAR functions:
lidar_avail_tables()
,
lidar_describe_var()
,
lidar_get_data()
,
lidar_get_lowres_raster()
,
lidar_point_value()
,
lidar()
if (interactive()) {
library(dplyr)
lidardb <- lidar()
polygons_data <- lidar_get_data('lidar_provincias', 'DBH') |>
select(poly_id, DBH_check = DBH_mean, geometry)
dbh_provinces <- lidar_clip_and_stats(lidardb, polygons_data, 'poly_id', 'DBH')
dbh_provinces$DBH_check == dbh_provinces$DBH_mean
# lidardb is an R6 object, so the previous example is the same as:
lidardb$clip_and_stats(polygons_data, 'poly_id', 'DBH')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.