Skip to content

get_layer(): bbox #10

@rellimylime

Description

@rellimylime

#' Retrieve a WRI layer for a bounding box
#'
#' Streams one or more WRI layers from cloud storage and returns a
#' \code{SpatRaster} cropped to a bounding box.
#'
#' @param bbox numeric vector. Bounding box in the format
#' \code{c(xmin, ymin, xmax, ymax)} in WGS84 (EPSG:4326).
#' @param layer_id character. One or more layer IDs to retrieve. Use
#' \code{wri_overview()} to find valid IDs. Defaults to \code{"WRI_score"}.
#'
#' @return A \code{terra::SpatRaster} cropped to the bounding box.
#' Multi-layer if multiple IDs provided.
#'
#' @examples
#' # Bounding box around Butte County, CA
#' bbox <- c(-122.0, 39.5, -121.2, 40.2)
#' get_layer(bbox)
#'
#' # Specific layer
#' get_layer(bbox, layer_id = "water_domain_score")
#'
#' # Multiple layers
#' get_layer(bbox, layer_id = c("water_domain_score", "air_domain_score"))
#'
#' @export
get_layer <- function(bbox, layer_id = "WRI_score") {}

Metadata

Metadata

Labels

functionExported user-facing function

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions