raster.read: Read and buffer raster layers.

View source: R/main.R

raster.readR Documentation

Read and buffer raster layers.

Description

Read raster layers of environmental or other variables and crop them to a given extent around the known occurrences.

Usage

raster.read(longlat, layers = NULL, ext = 1)

Arguments

longlat

Matrix of longitude and latitude or eastness and northness (two columns in this order) of species occurrence records.

layers

Raster* object as defined by package raster.

ext

Either extent of map or buffer around the known records used to crop layers. If buffer, it is relative to the maximum distance between any two records.

Details

If layers are not given, the function will read either 30 arc-second (approx. 1km) or 5 arc-minutes (approx. 10km) resolution rasters from worldclim (Fick & Hijmans 2017) and landcover (Tuanmu & Jetz 2014) if red.setup() is run previously.

Value

A RasterStack object (If no layers are given: Variables 1-19 = bioclim, 20 = elevation, 21-32 = proportion landcover, 33 = most common landcover).

References

Fick, S.E. & Hijmans, R.J. (2017) Worldclim 2: new 1-km spatial resolution climate surfaces for global land areas. International Journal of Climatology, in press.

Tuanmu, M.-N. & Jetz, W. (2014) A global 1-km consensus land-cover product for biodiversity and ecosystem modeling. Global Ecology and Biogeography, 23: 1031-1045.

Examples

layers = red.examples("red.layers")
records = red.examples("red.records")
par(mfrow=c(1,2))

terra::plot(layers[[1]])
points(records)

croppedLayers <- raster.read(records, layers, 0.1)
terra::plot(croppedLayers[[1]])
points(records)

red documentation built on Sept. 9, 2023, 1:07 a.m.

Related to raster.read in red...