getAOI {rlandfire}R Documentation

Create extent vector for landfireAPI()

Description

getAOI creates an extent vector in WGS84 from spatial data

Usage

getAOI(data, extend = NULL, sf_order = FALSE)

Arguments

data

A SpatRaster, SpatVector, sf, stars, or RasterLayer (raster) object

extend

Optional. A numeric vector of 1, 2, or 4 elements to increase the extent by.

sf_order

If extend != NULL, logical indicating that the order of the extend vector follows sf::st_bbox() (xmin, ymin, xmax, ymax) when TRUE or terra::extend() (xmin, xmax, ymin, ymax) when FALSE. This is FALSE by default to ensure backwards compatibility with previous versions.

Value

Returns an extent vector ordered xmin, ymin, xmax, ymax with a lat/lon projection.

Examples

r <- terra::rast(nrows = 50, ncols = 50,
  xmin = -123.7835, xmax = -123.6352,
  ymin = 41.7534, ymax = 41.8042,
  crs = terra::crs("epsg:4326"),
  vals = rnorm(2500))
ext <- getAOI(r, c(10, 15))


[Package rlandfire version 1.0.0 Index]