Variables are type of soil, elevation, slope, aspect, roughness, solar radiation, distance to sea, protected areas, distance to roads, distance to cities and town, distance to rivers and waterbodies.

get_env_variables(
  extent_latlon,
  extent_proj,
  EPSG,
  country_name,
  destination,
  resol = 1000,
  rm_download = FALSE,
  forest_year = 2010,
  gisBase = NULL
)

Arguments

extent_latlon

vector. First output of get_aoi_extent() function.

extent_proj

vector. Second output of get_aoi_extent() function.

EPSG

int. to consider for this country/area.

country_name

character. country name (in English) which be use to collect protected areas. This country must be available in https://www.protectedplanet.net/en/thematic-areas/wdpa?tab=WDPA.

destination

character. absolute path where to download files like here() output.

resol

int. Resolution. If in meters, recommended resolutions are 250m, 500m, 1km, 2km or 5km. The resolution needs to be carefully chosen. If set too small (e.g. < 250m), raster file will be too big to fit in memory and R will crash. Default is 1km.

rm_download

boolean. If TRUE remove download files and folders. Keep only environ.tif in data_raw folder, default is FALSE.

forest_year

int. Forest at the decade chosen. Must be one of 2000, 2010 or 2020, default is 2010.

gisBase

NULL or character. Parameter gisBase for rgrass::initGRASS(). The directory path to GRASS binaries and libraries, containing bin and lib subdirectories among others; if NULL, system("grass --config path") is tried.

Value

character. Absolute path to environ.tif file.

Details

environ.tif.aux.xml is an extention of environ.tif, it allows to classify soilgrid variable with QGIS with RasterAttributeTable extension. Nevertheless it's cause problems to open it with stars package but not with terra. If you have any problems to open environ.tif, you can remove environ.tif.aux.xml. This solve all accessibility problems with stars and terra packages.

Unit of each environ variable :

NameUnit
Elevationm
Aspectdegrees
Roughnessm
Slopedegrees
Solar radiationWh.m^-2.day
Soilgridscategory
Forestbinary
Distance to forestm
Distance seam
Distance roadm
Distance placem
Distance watering placem
Protected Area (WDPA)category
Population densitypeople/km²