lidar_get_lowres_raster | R Documentation |
lidar_get_lowres_raster
is a wrapper for the
$get_lowres_raster
method of lfcLiDAR
objects.
See also lidar
.
lidar_get_lowres_raster(
object,
variables,
spatial = "stars",
rast_column = "rast",
clip = NULL
)
object |
|
variables |
character vector indicating the requested raster/s variables.
|
spatial |
character vector of lenght 1 indicating the type of raster object to return, "raster" or "stars", the default. |
Connection to database can be slow. Rasters retrieved from the db are stored
in a temporary cache inside the lfcLiDAR object created by lidar
,
making subsequent calls to the same table are faster. But, be warned that in-memory
rasters can use a lot of memory!
A raster object: RasterLayer
if spatial is raster
and only one
variable is requested, RasterBrick
if more than one variable is requested.
stars
if spatial is stars
. See
https://r-spatial.github.io/stars/index.html for details about stars objects and
raster
for details about raster objects.
Other LiDAR functions:
lidar_avail_tables()
,
lidar_clip_and_stats()
,
lidar_describe_var()
,
lidar_get_data()
,
lidar_point_value()
,
lidar()
if (interactive()) {
lidardb <- lidar()
# raster
ab_raster <- lidar_get_lowres_raster(lidardb, 'AB', 'raster')
# stars
ab_stars <- lidar_get_lowres_raster(lidardb, 'AB', 'stars')
# we can use pipes
lidardb |>
lidar_get_lowres_raster('AB', 'raster')
# or retrieve several tables at one time
lidardb |>
lidar_get_lowres_raster(c('AB', 'DBH'), 'stars')
# lidardb is an R6 object, so the previous examples are the same as:
lidardb$get_lowres_raster('AB', 'raster')
lidardb$get_lowres_raster('AB', 'stars')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.