lidar_get_lowres_raster: Access to the low resolution (400x400m) rasters in the LiDAR...

View source: R/lfcLiDAR.R

lidar_get_lowres_rasterR Documentation

Access to the low resolution (400x400m) rasters in the LiDAR database

Description

lidar_get_lowres_raster is a wrapper for the $get_lowres_raster method of lfcLiDAR objects. See also lidar.

Usage

lidar_get_lowres_raster(
  object,
  variables,
  spatial = "stars",
  rast_column = "rast",
  clip = NULL
)

Arguments

object

lfcLiDAR object, as created by lidar

variables

character vector indicating the requested raster/s variables. "all" can be used to retrieve all variables.

spatial

character vector of lenght 1 indicating the type of raster object to return, "raster" or "stars", the default.

Details

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!

Value

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.

See Also

Other LiDAR functions: lidar_avail_tables(), lidar_clip_and_stats(), lidar_describe_var(), lidar_get_data(), lidar_point_value(), lidar()

Examples

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')
}


MalditoBarbudo/lfcdata documentation built on May 2, 2023, 10:30 p.m.