Package 'forestdata'

Title: Download Forestry Data
Description: Functions for downloading forestry and land use data for use in spatial analysis. This packages offers a user-friendly solution to quickly obtain datasets such as forest height, forest types, tree species under various climate change scenarios, or land use data among others.
Authors: Adrián Cidre González [aut, cre]
Maintainer: Adrián Cidre González <[email protected]>
License: GPL (>= 3)
Version: 0.2.1
Built: 2024-11-25 23:12:35 UTC
Source: CRAN

Help Index


TALLO database

Description

Downloads the TALLO database, a global tree allometry and crown architecture database. Over 500,000 data points of individual trees with several measurements

Usage

fd_allometry_tallo(
  country = NULL,
  spatial = FALSE,
  metadata_path = NULL,
  quiet = FALSE
)

Arguments

country

a character vector with either ISO2 codes, ISO3 codes or full country names (not mixed) to filter out the data

spatial

logical. Whether to retrieve a tibble or a sf object

metadata_path

a character string of length 1 with the path to store the metadata and bibliography. The default path_metadata = NULL does not download the metadata

quiet

if TRUE, suppress any message or progress bar

Value

a tibble or a sf object

References

Tallo: A global tree allometry and crown architecture database. doi:10.1111/gcb.16302

Examples

## Download full database as tibble
tallo_tbl <- fd_allometry_tallo()

## Download full database as sf
tallo_sf <- fd_allometry_tallo(spatial = TRUE)

## Download data as sf for Czechia and Germany
tallo_cz_ge_sf <- fd_allometry_tallo(country = c("Czechia", "Germany"))

Forest Canopy Height

Description

Download the ETH Global Sentinel-2 10m Canopy Height (2020) or the Meta High Resolution 1m Global Canopy Height Map

Usage

fd_canopy_height(
  x = NULL,
  lon = NULL,
  lat = NULL,
  model = "eth",
  layer = "chm",
  crop = FALSE,
  mask = FALSE,
  quiet = FALSE
)

Arguments

x

a sf or SpatVector object. It will retrieve the necessary tiles to cover the area (if lat and lon are specified, this argument is ignored)

lon

a number specifying the longitude of the area where we want the tile

lat

a number specifying the latitude of the area where we want the tile

model

a string specifying the model to download. One of "eth" or "meta" (see details)

layer

a string for the layer to download (valid only for eth). The default "chm" downloads the Canopy Height Model, while "std" downloads the standard deviation. If you want both layers, use "all"

crop

when x is specified, whether to crop the tile(s) to the object

mask

when x is specified, whether to mask the tile(s) to the object

quiet

if TRUE, suppress any message or progress bar

Details

There are currently two global canopy height models available within this function.

Data may be freely used for research, study, or teaching, but be cited appropriately (see references below).

Value

A SpatRaster

References

Lang, Nico, Walter Jetz, Konrad Schindler, and Jan Dirk Wegner. "A high-resolution canopy height model of the Earth." arXiv preprint arXiv:2204.08322 (2022).

Tolan, J., Yang, H.I., Nosarzewski, B., Couairon, G., Vo, H.V., Brandt, J., Spore, J., Majumdar, S., Haziza, D., Vamaraju, J. and Moutakanni, T., 2024. Very high resolution canopy height maps from RGB imagery using self-supervised vision transformer and convolutional decoder trained on aerial lidar. Remote Sensing of Environment, 300, p.113888.

Examples

## Get 10m resolution CHM
eth_model <- fd_canopy_height(lon = -7.27, lat = 42.43)

## Get 1m resolution CHM
meta_model <- fd_canopy_height(lon = -7.27, lat = 42.43, model = "meta")

Download the Chorological Maps

Description

Download the Chorological Maps for the main European Woody Species.

Usage

fd_forest_chorological(species, range = "nat", quiet = FALSE)

Arguments

species

a character vector with the Latin name of a tree species contained in the Chorological Maps database (see details)

range

the default "nat" downloads the probable native range of the species, while "syn" downloads the synanthropic range (i.e. the introduced and naturalized area and isolated population since Neolithic)

quiet

if TRUE, suppress any message or progress bar

Details

Data may be freely used for research, study, or teaching, but be cited appropriately (see references below).

The chorological maps provide a general overview of the distribution of the main European woody species. The geodatabase was formed by the combination of numerous and heterogeneous data for a continental-scale overview of the species' distribution range. There are a total of 4 versions available, and the function will get the most recent version for each of the species. This means for instance that some species may be on version 2, and therefore, the data from that version will be retrieved.

Value

sf object

References

Caudullo, G., Welk, E., San-Miguel-Ayanz, J., 2017. Chorological maps for the main European woody species. Data in Brief 12, 666. DOI: doi.org/10.1016/j.dib.2017.05.007

See Also

metadata_forestdata for a list of possible species

Examples

# Download data for sweet chestnut
 chestnut_nat_sf <- fd_forest_chorological(species = "Castanea sativa", range = "nat")

 # Plot the data
 plot(chestnut_nat_sf$geometry)

EU-Trees4F Database

Description

Download data for tree species distribution in Europe for current (2005) distribution, and future distribution (2035, 2065, 2095).

Usage

fd_forest_eutrees4f(
  species,
  model = "clim",
  period = "all",
  scenario = "rcp45",
  type = "bin",
  distrib = "pot",
  quiet = FALSE
)

Arguments

species

a character vector of length 1 with the Latin name of the tree species (genus and species)

model

a character vector of length 1 with the name of the ensemble projection. One of 'clim' or 'sdms' (see details)

period

a numeric or character vector of length 1 with the center of the 30-year time period used for the model. One of '2005', '2035', '2065', '2095', or 'all' (see details)

scenario

a character vector of length 1 with the climate change scenario used. One of 'rcp45' or 'rcp85' (see details)

type

a character vector of length 1 with the type of output layer. One of 'bin', 'prob' or 'std' (see details)

distrib

a character vector of length 1 with the type of distribution. One of 'nat', 'pot', 'disp' or 'disp_lu' (see details)

quiet

if TRUE, suppress any message or progress bar

Details

Data may be freely used for research, study, or teaching, but be cited appropriately (see references below).

The data of EU-Trees4F database represent the distribution of the main woody species in Europe at 5 arc-minutes (~ 10 km) spatial resolution, in the Lambert Azimuthal Equal Area (EPSG:3035) CRS. The possible models to download are the following:

Model: type of model used

  • clim: climatic ensemble. A ensemble mean model that projects a consensus model from biomod2 into future conditions using the average of 11 Regional Climate Models (RCM).

  • sdms: Species Distribution Model (SDM) ensemble. A model that projects the consensus model for every single RCM, and then it averages the output of then 11 SDMs.

Period: 30-year time period

  • 2005: for current projections. This option ignores the scenario argument. They are not available for model = 'sdms' with type = 'std'.

  • 2035: average of 2020-2050

  • 2065: average of 2050-2080

  • 2095: average of 2080-2110

  • all: get the four periods (or three for std type). Note that for some species or configurations this might fail, because the raster extent might not match in different periods

Scenario: climate change scenario

  • rcp45: a climate change scenario that assumes moderate emissions reductions

  • rcp85: a climate change scenario with high greenhouse gas emissions and limited mitigation efforts

Type: type of output layer

  • bin: binary distribution map, where 1 represents presence of the tree species, while 0 represents absence of the tree species, derived from the prob map

  • prob: probability distribution map (0-1000). Represents the probability of being the potential distribution of the species

  • std: standard deviation of prob map. Only available for model = 'sdms'.

Distrib: type of species distribution

  • nat: realized distribution (masked with native range). Only available with type = 'bin'

  • pot: potential distribution

  • disp: natural dispersal model (migclim). Only available with type = 'bin'

  • disp_lu: natural dispersal model clipped by forest areas. Only available with type = 'bin'

Value

A single-band or multi-band SpatRaster

References

Mauri, Achille; Cescatti, Alessandro; GIRARDELLO, MARCO; Strona, Giovanni; Beck, Pieter; Caudullo, Giovanni; et al. (2022). EU-Trees4F. A dataset on the future distribution of European tree species.. figshare. Collection. https://doi.org/10.6084/m9.figshare.c.5525688.v2

See Also

metadata_forestdata for a list of possible species

Examples

# Download data for Betula pendula
betula_pendula_sr <- fd_forest_eutrees4f(species = "Betula pendula")

Forest Extent

Description

[Deprecated] This function is deprecated in favour of fd_forest_glad. Download the Forest Extent raster from the Global Land Analysis & Discovery by using a vectorial object or a pair of coordinates (latitude, longitude).

Usage

fd_forest_extent_glad(
  x = NULL,
  lon = NULL,
  lat = NULL,
  year = 2020,
  crop = FALSE,
  quiet = FALSE,
  ...
)

Arguments

x

a sf or SpatVector object. It will retrieve the necessary tiles to cover the area (if lat and lon are specified, this argument is ignored)

lon

a number specifying the longitude of the area where we want the tile

lat

a number specifying the latitude of the area where we want the tile

year

year of the forest extent data. One of 2000, 2020 or 'all'

crop

when x is specified, whether to crop the tiles(s) to the object

quiet

if TRUE, suppress any message or progress bar

...

additional arguments passed to the crop function

Details

The Forest Extent Map is a product offered by the Global Land Analysis & Discovery organization. The spatial resolution of the product is 0.00025º (approximately 30 meters at the Equator), and it's distributed in tiles of 10ºx10º. Pixels with forest height > 5 meters are classified as the forest class.

Note that each tile is stored as a raster file of 1.5 GB, so for big extensions the function might take some time to retrieve the data.

Value

SpatRaster object

References

Potapov P., Hansen M.C., Pickens A., Hernandez-Serna A., Tyukavina A., Turubanova S., Zalles V., Li X., Khan A., Stolle F., Harris N., Song X.-P., Baggett A., Kommareddy I., Kommareddy A. (2022) The global 2000-2020 land cover and land use change dataset derived from the Landsat archive: first results. Frontiers in Remote Sensing doi:10.3389/frsen.2022.856903

Examples

# Get tile for Galicia (Spain)
 galicia_forest_extent <- fd_forest_extent_glad(lon = -7.8, lat = 42.7, year = 2020)

BD Forêt

Description

Download the BD Forêt data for a French Department. This function downloads the polygons of forest vegetation in France.

Usage

fd_forest_france(department, path_metadata = NULL, version = 2, quiet = FALSE)

Arguments

department

a character string of length 1 with the name of a French department (see examples)

path_metadata

a character string of length 1 with the path to store the metadata of the BD Forêt database. The default path_metadata = NULL does not download the metadata

version

the version number of the BD Forêt data. Either 1 or 2 (see details)

quiet

if TRUE, suppress any message or progress bar

Details

The BD Forêt is a database where the forest cover of France is stored by department, with the spatial distribution of tree species in the country.

The BD Forêt version 1 was developed by photointerpretation of infrared color aerial images with a minimum mapped area of 2.25 hectares. The year of reference for each department varies between 1987 and 2002. The version 1 contains the following variables:

  • ID: surface object identifier

  • CODE_TFV: alphanumeric code of the vegetation formation

  • TFV: vegetation formation type

  • TFV_G11: type of coverage and predominant composition of the vegetation in 11 groups

  • ESSENCE: description of tree species according to the unique basic nomenclature for all departments

The BD Forêt version 2 was developed between 2007 and 2018 by photointerpretation of color infrared images from the BD ORTHO. It assigns a vegetation formation type to each mapped area larger than 5,000m2m^2. This version contains the variables:

  • DEP: department name

  • CYCLE: order number of the departmental revision

  • ANREF: year of reference of the data

  • TFIFN: code of the departalmental type of vegetation cover. The nomenclature is specific to each department

  • LIBELLE: departamental type of vegetation cover. The nomenclature is specific to each department

  • LIBELLE2: departamental type of vegetation cover in capital letters. The nomenclature is specific to each department

  • TYPN: code of the national type of vegetation cover

  • NOMB_TYPN: national type of vegetation cover

For more information, download the metadata using the argument path_metadata (information in French).

Value

A sf object with POLYGON geometry

References

https://geoservices.ign.fr/bdforet

See Also

metadata_forestdata for a list of possible Department names

Examples

# Download BD Foret V2 for the department of Ardèche
ardeche_bdforet1_sf <- fd_forest_france(department = "Ardeche", version = 1)

Global Land Analysis & Discovery datasets

Description

Download data from GLAD database including forest extent, forest height, and land cover at ~30m spatial resolution

Usage

fd_forest_glad(
  x = NULL,
  lon = NULL,
  lat = NULL,
  model = "extent",
  year = 2020,
  crop = FALSE,
  mask = FALSE,
  quiet = FALSE
)

Arguments

x

a sf or SpatVector object. It will retrieve the necessary tiles to cover the area (if lat and lon are specified, this argument is ignored)

lon

a number specifying the longitude of the area where we want the tile

lat

a number specifying the latitude of the area where we want the tile

model

a character vector of length 1 indicating the model to retrieve (see details)

year

year of the data (see details)

crop

when x is specified, whether to crop the tile(s) to the object

mask

when x is specified, whether to mask the tile(s) to the object

quiet

if TRUE, suppress any message or progress bar

Details

The Global Land Analysis & Discovery (GLAD) includes several datasets which can be accessed through the model argument:

  • landcover: global land cover and land use dataset. Dataset divided into 10ºx10º tiles containing measures of bare ground and tree height inside and outside of wetlands, seasonal water percent, binary labels of built-up, permanent ice/snow, and cropland. Available for the years 2000, 2005, 2010, 2015, and 2020.

  • landcover-change: changes of landcover from 2000 to 2020. Argument year is ignored.

  • extent: dataset showing presence of forest, defined as wildland, managed, and planted tree cover including agroforestry and orchards. Includes areas where the vegetation is taller than 5 meters. Available for the years 2000 and 2020.

  • height: dataset measuring the height of woody vegetation taller than 3 meters. Available for the years 2000 and 2020.

The spatial resolution of the product is 0.00025º (approximately 30 meters at the Equator), and it's distributed in tiles of 10ºx10º.

Note that each tile is stored as a raster file of 1.5 GB, so for big extensions the function might take some time to retrieve the data.

Value

SpatRaster object

References

Potapov P., Hansen M.C., Pickens A., Hernandez-Serna A., Tyukavina A., Turubanova S., Zalles V., Li X., Khan A., Stolle F., Harris N., Song X.-P., Baggett A., Kommareddy I., Kommareddy A. (2022) The global 2000-2020 land cover and land use change dataset derived from the Landsat archive: first results. Frontiers in Remote Sensing doi:10.3389/frsen.2022.856903

P. Potapov, X. Li, A. Hernandez-Serna, A. Tyukavina, M.C. Hansen, A. Kommareddy, A. Pickens, S. Turubanova, H. Tang, C.E. Silva, J. Armston, R. Dubayah, J. B. Blair, M. Hofton (2020) Mapping and monitoring global forest canopy height through integration of GEDI and Landsat data. Remote Sensing of Environment, 112165.doi:10.1016/j.rse.2020.112165

Examples

# Get tile for Galicia (Spain)
 galicia_forest_extent <- fd_forest_glad(lon = -7.8, lat = 42.7, year = 2020)

Forest Cover of Spain

Description

Download the MFE50 (Spanish Forestry Map 1:50,000) for a province. The MFE50 was built during 1997-2006.

Usage

fd_forest_spain_mfe50(province, path_metadata = NULL, quiet = FALSE)

Arguments

province

a character string of length 1 with the name of a Spanish province

path_metadata

a character string of length 1 with the path to store the metadata of the MFE50. The default path_metadata = NULL does not download the metadata

quiet

if TRUE, suppress any message or progress bar

Details

The Spanish Forestry Map at scale 1:50,000 is a project that was undertaken during the years 1997-2006. The data contains the cartography of forest stands in Spain. The definition of the variables is contained in an excel file that can be downloaded by using the argument path_metadata.

Value

A sf object with POLYGON geometry

References

https://www.miteco.gob.es/es/biodiversidad/servicios/banco-datos-naturaleza/informacion-disponible/mfe50.html

See Also

metadata_forestdata for a list of possible species

Examples

# Download MFE50 for the province of Lugo
lugo_mfe50_sf <- fd_forest_spain_mfe50(province = "Lugo")

Spanish Forest Inventory

Description

Download the tables and SIG data from the Spanish Forest Inventory

Usage

fd_inventory_spain(
  province,
  ifn = 4,
  database = "field",
  path_metadata = NULL,
  quiet = FALSE
)

Arguments

province

a character string of length 1 with the name of a Spanish province

ifn

number of Spanish Forest Inventory (from 2 to 4)

database

the name of the database (either 'field' or 'gis')

path_metadata

a character string of length 1 with the path to store the metadata of the selected database. The default path_metadata = NULL does not download the metadata

quiet

if TRUE, suppress any message or progress bar

Details

The IFN2 doesn't have 'gis' data for Asturias, Cantabria and Navarra.

In the future a function to process the data will be added.

Value

A list with the tables

References

https://www.miteco.gob.es/es/biodiversidad/temas/inventarios-nacionales/inventario-forestal-nacional.html

See Also

metadata_forestdata for a list of possible species

Examples

# Download MFE50 for Canary Islands
canarias_ifn4_lst <- fd_inventory_spain("Canarias")

cantabria_ifn3_gis_lst <- fd_inventory_spain("cantabria", ifn = 3, database = "gis")

Global Land Cover

Description

Download a SpatRaster from the Global Land Cover from the Copernicus Global Land Service.

Usage

fd_landcover_copernicus(
  x,
  lon = NULL,
  lat = NULL,
  year = 2019,
  layer = "forest",
  crop = FALSE,
  ...
)

Arguments

x

an sf or SpatVector object. It will retrieve the necessary tiles to cover the area (if lat and lon are specified, this argument is ignored)

lon

a number specifying the longitude of the area where we want the tile

lat

a number specifying the latitude of the area where we want the tile

year

year of the land cover data. One of 2015:2019 or 'all'

layer

a character vector of the layer(s) to use from the Global Land Cover. See details

crop

when x is specified, whether to crop the tile(s) to the object

...

additional arguments passed to the crop function

Details

There are 14 different layers that can be downloaded:

  • "discrete": land cover discrete classification

  • "classification": land cover classification probability

  • "bare": cover fraction of bare and sparse vegetation

  • "builtup": cover fraction of builtup

  • "crops": cover fraction of cropland

  • "tree": cover fraction of forest

  • "grass": cover fraction of herbaceous vegetation

  • "mosslichen": cover fraction of moss and lichen

  • "seasonalwater": cover fraction of seasonal inland water

  • "shrub": cover fraction of shrubland

  • "snow": cover fraction of snow and ice

  • "permanentwater": cover fraction of permanent inland water

  • "forest" (default): forest types. (0): unknown; (1): evergreen needle leaf forest; (2): evergreen broad leaf forest; (3): deciduous needle leaf; (4): deciduous broad leaf; (5): mix of forest types

  • "datadensityindicator": input data density

Value

SpatRaster object

References

Buchhorn, M.; Smets, B.; Bertels, L.; De Roo, B.; Lesiv, M.; Tsendbazar, N. - E.; Herold, M.; Fritz, S. Copernicus Global Land Service: Land Cover 100m: collection 3: epoch 2019: Globe 2020. DOI 10.5281/zenodo.3939050

Examples

# Get tile for Galicia (Spain) and year 2019
 galicia_forest_extent <- fd_landcover_copernicus(
  lat  = 42.7,
  lon  = -7.8,
  year = 2019
 )
 # Get forest and discrete classification tiles for all years
 galicia_forest_extent <- fd_landcover_copernicus(
  lat  = 42.7,
  lon  = -7.8,
  year = "all",
  layer = c("forest", "discrete")
 )

Download data from the ESRI Land Cover Explorer

Description

Download an UTM tile of the ESRI Land Cover Explorer for a specified year

Usage

fd_landcover_esri(utm_code, year, quiet = TRUE)

Arguments

utm_code

a character string of length 1 with an UTM code (e.g. "29N")

year

an integer or vector of integers corresponding to the base year of the land cover tile. The option year = 'all' downloads all the available images (2017:2023)

quiet

if TRUE (the default), suppress status messages, and the progress bar

Value

A SpatRaster

References

https://livingatlas.arcgis.com/en/home/

Examples

# Download Land Cover for UTM tile 29N year 2023
lc <- fd_landcover_esri("29N", year = 2023)

# Download Land Cover for UTM time 29N for all years
lc <- fd_landcover_esri("29N", year = "all")

Download the DEFID2 database

Description

Download the Database of European Forest Insect and Disease Disturbances.

Usage

fd_pathogens_defid2(
  agent = "all",
  host = "all",
  symptoms = "all",
  country = "all",
  geometry = "polygon",
  quiet = TRUE
)

Arguments

agent

a character vector with the desired forest insect(s) and/or disease(s). The default 'all' retrieves every agent

host

a character vector with the desired host tree(s) species. The default 'all' retrieves every tree

symptoms

a character vector with the desired symptom(s). The default 'all' retrieves every symptom

country

a character vector with the desired country(ies). The default 'all' retrieves every country

geometry

a string with 'polygon' to retrieve polygon data, or 'point' to retrieve point data

quiet

if TRUE (the default), suppress status messages, and the progress bar

Details

Data may be freely used for research, study, or teaching, but be cited appropriately (see references below).

This function will download the DEFID2 database to the temporary directory once per session. After it's downloaded, the queries to the database are faster than the first time.

Note that 99.6% of the observations correspond to Picea abies. Also, 99.3% of the observations are in Czechia.

The data comprises over 650,000 georeferenced records, which can be retrieved as points or polygons, representing insects and diseases that occurred between 1963 and 2021 in European Forests.

Please, cite the data with the reference below.

Value

sf object with MULTIPOLYGON or POINT geometry

References

Forzieri G, Dutrieux LP, Elia A, Eckhardt B, Caudullo G, Taboada FÁ, Andriolo A, Bălacenoiu F, Bastos A, Buzatu A, Castedo Dorado F, Dobrovolný L, Duduman M, Fernandez-Carillo A, Hernández-Clemente R, Hornero A, Ionuț S, Lombardero MJ, Junttila S, Lukeš P, Marianelli L, Mas H, Mlčoušek M, Mugnai F, Nețoiu C, Nikolov C, Olenici N, Olsson P, Paoli F, Paraschiv M, Patočka Z, Pérez-Laorga E, Quero JL, Rüetschi M, Stroheker S, Nardi D, Ferenčík J, Battisti A, Hartmann H, Nistor C, Cescatti A, Beck PSA (2023). The Database of European Forest Insect and Disease Disturbances: DEFID2. Global Change Biology

Examples

# Get the entire database (takes some seconds/minutes)
defid2_sf <- fd_pathogens_defid2()

# Get data for Spain and Portugal
defid2_iberia_sf <- fd_pathogens_defid2(country = c("Spain", "Portugal"))

Metadata for forestdata functions

Description

A list with the names of tree species or regions depending on the dataset.

Usage

metadata_forestdata

Format

A list of 7 elements:

chorological_species

Latin name of tree species for fd_forest_chorological

eutrees4f_species

Latin name of tree species for fd_forest_eutrees4f

bdforet_tbl_departments

Departments of France for fd_forest_france

mfe_provinces

Province names for fd_forest_spain_mfe50

spain_ifnx

Province names for fd_inventory_spain