meteoland_get_lowres_raster: Access to the low resolution (1000x1000m) rasters in the...

View source: R/lfcMeteoland.R

meteoland_get_lowres_rasterR Documentation

Access to the low resolution (1000x1000m) rasters in the Meteoland database

Description

meteoland_get_lowres_raster is a wrapper for the $get_lowres_raster method of lfcMeteoland objects. See also meteoland.

Usage

meteoland_get_lowres_raster(
  object,
  date,
  spatial = "stars",
  rast_column = "rast",
  bands = TRUE,
  clip = NULL
)

Arguments

object

lfcMeteoland object, as created by meteoland

date

character with the date of the raster to retrieve, i.e "2020-04-25"

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 lfcMeteoland object created by meteoland, 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: RasterBrick if spatial is raster, 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 Meteoland functions: meteoland_historical_points_interpolation(), meteoland_points_interpolation(), meteoland_raster_interpolation()

Examples

if (interactive()) {
  meteolanddb <- meteoland()
  # raster
  ab_raster <- meteoland_get_lowres_raster(meteolanddb, '2020-04-25', 'raster')
  # stars
  ab_stars <- meteoland_get_lowres_raster(meteolanddb, '2020-04-25', 'stars')

  # we can use pipes
  meteolanddb |>
    meteoland_get_lowres_raster('2020-04-25', 'raster')

  # meteolanddb is an R6 object, so the previous examples are the same as:
  meteolanddb$get_lowres_raster('2020-04-25', 'raster')
  meteolanddb$get_lowres_raster('2020-04-25', 'stars')
}


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