Type: | Package |
Title: | Download Forestry Data |
Version: | 0.3.1 |
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. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
LazyData: | true |
Imports: | sf, stringr, tibble, tidyr, dplyr, purrr, terra, stringi, archive, foreign, lifecycle, cli, glue, countrycode |
RoxygenNote: | 7.3.2 |
Depends: | R (≥ 4.1.0) |
Collate: | 'utils-not-exported.R' 'GLAD.R' 'allometry.R' 'canopy-height.R' 'chorological-maps.R' 'data.R' 'eutrees4f.R' 'forest-country.R' 'forest-inventory.R' 'forestdata-package.R' 'globals.R' 'land-cover.R' 'pathogens.R' |
Suggests: | aws.s3, RODBC, odbc, giscoR, testthat (≥ 3.0.0), rmarkdown, ggplot2, tidyterra |
Config/testthat/edition: | 3 |
URL: | https://cidree.github.io/forestdata/ |
NeedsCompilation: | no |
Packaged: | 2025-05-18 17:48:54 UTC; User |
Author: | Adrián Cidre González [aut, cre] |
Maintainer: | Adrián Cidre González <adrian.cidre@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-05-22 05:10:13 UTC |
forestdata: 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.
Author(s)
Maintainer: Adrián Cidre González adrian.cidre@gmail.com
See Also
Useful links:
Calculates dominant height
Description
Calculates dominant height
Usage
calc_dominant_height(nmax, ntress, height)
Value
A numeric vector
Crop a list of SpatRasters (Internal) Crop using cli feedback
Description
Crop a list of SpatRasters (Internal) Crop using cli feedback
Usage
crop_with_feedback(r, xwgs84, quiet)
Value
An SpatRaster
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 |
metadata_path |
a character string of length 1 with the path to store the
metadata and bibliography. The default |
quiet |
if |
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,
merge = FALSE,
quiet = FALSE
)
Arguments
x |
a |
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 " |
layer |
a string for the layer to download (valid only for eth). The default " |
crop |
when |
mask |
when |
merge |
if |
quiet |
if |
Details
There are currently two global canopy height models available within this function.
-
eth: the ETH Global Sentinel-2 10m Canopy Height from the year 2020. Visit https://www.research-collection.ethz.ch/handle/20.500.11850/609802 for more information
-
meta: the Meta High Resolution 1m Global Canopy Height. Visit doi:10.1016/j.rse.2023.113888 for more information
Data may be freely used for research, study, or teaching, but be cited appropriately (see references below).
Value
A SpatRaster
or SpatRasterCollection
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
## Not run:
## 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")
## End(Not run)
Forest Canopy Height
Description
Download the ETH Global Sentinel-2 10m Canopy Height (2020)
Usage
fd_canopy_height_eth(
x = NULL,
lon = NULL,
lat = NULL,
layer = "chm",
crop = FALSE,
mask = FALSE,
merge = FALSE,
quiet = FALSE
)
Arguments
x |
a |
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 |
layer |
a string for the layer to download. The default " |
crop |
when |
mask |
when |
merge |
if |
quiet |
if |
Details
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).
Forest Canopy Height
Description
Download the High Resolution 1m Global Canopy Height Map
Usage
fd_canopy_height_meta(
x = NULL,
lon = NULL,
lat = NULL,
crop = FALSE,
mask = FALSE,
merge = FALSE,
quiet = FALSE
)
Arguments
x |
a |
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 |
crop |
when |
mask |
when |
merge |
if |
quiet |
if |
Details
Data may be freely used for research, study, or teaching, but be cited appropriately (see references below).
Value
A SpatRaster
or SpatRasterCollection
References
https://registry.opendata.aws/dataforgood-fb-forests/
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 " |
quiet |
if |
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 |
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'
withtype = '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")
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 |
version |
the version number of the BD Forêt data. Either 1 or 2 (see details) |
quiet |
if |
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,000m^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,
merge = FALSE,
quiet = FALSE
)
Arguments
x |
a |
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 |
mask |
when |
merge |
if |
quiet |
if |
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 |
quiet |
if |
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
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",
process_level = 0,
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') |
process_level |
integer. Used when |
path_metadata |
a character string of length 1 with the path to store the
metadata of the selected database. The default |
quiet |
if |
Details
The IFN2 doesn't have 'gis' data for Asturias, Cantabria and Navarra.
Value
A list
with the tables
References
See Also
metadata_forestdata for a list of possible species
Examples
## Not run:
library(odbc)
if ("Microsoft Access Driver (*.mdb, *.accdb)" %in% odbc::odbcListDrivers()$name) {
# Download MFE50 for Canary Islands
canarias_ifn4_lst <- fd_inventory_spain("Canarias")
} else {
message("Skipping example as <Microsoft Access Driver (*.mdb, *.accdb)> is not available.")
}
## End(Not run)
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,
...,
quiet = FALSE
)
Arguments
x |
an |
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 |
... |
additional arguments passed to the crop function |
quiet |
if |
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 = FALSE)
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 |
quiet |
if |
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")
EU Forest Species database
Description
Downloads the EU Forest Species database, an European database of more than 500,000 forest tree species occurrences
Usage
fd_occ_euforest(species = NULL, country = NULL, spatial = FALSE, quiet = FALSE)
Arguments
species |
a character vector with the name of one or more tree species |
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 |
quiet |
if |
Value
a tibble
or a sf
object
References
A high resolution pan-European tree occurrence dataset doi:10.6084/m9.figshare.c.3288407.v1
See Also
metadata_forestdata eutrees4f_species for a list of possible species
Examples
## Download full database as tibble
euforest_tbl <- fd_occ_euforest()
## Download full database as spatial
euforest_sf <- fd_occ_euforest(spatial = TRUE)
## Download data for Abies alba for Czechia and Germany
euforest_cz_ge_sf <- fd_occ_euforest(species = "Abies alba", country = c("Czechia", "Germany"))
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 = FALSE
)
Arguments
agent |
a character vector with the desired forest insect(s) and/or
disease(s). The default ' |
host |
a character vector with the desired host tree(s) species. The
default ' |
symptoms |
a character vector with the desired symptom(s). The default
' |
country |
a character vector with the desired country(ies). The default
' |
geometry |
a string with ' |
quiet |
if |
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"))
Calculates Basal Area in square meters.
Description
Calculates Basal Area in square meters.
Usage
fdi_basal_area(diameter, ntrees = NULL, units = "cm")
Value
A numeric vector
Calculates diametric class
Description
Calculates diametric class
Usage
fdi_diametric_class(
x,
dmin = 7.5,
dmax = NULL,
class_length = 5,
include_lowest = TRUE,
return_intervals = FALSE
)
Value
A numeric vector
Calculates the dominant height
Description
Calculates the dominant height
Usage
fdi_dominant_height(diameter, height, ntrees = NULL, which = "assman")
Value
A numeric vector
(Internal) Downloads data to tempdir Download data to tempdir
Description
(Internal) Downloads data to tempdir Download data to tempdir
Usage
fdi_download(download_url, destfile, timeout = 1e+05)
Arguments
download_url |
Url of data to download |
destfile |
Path of the downloaded data |
timeout |
Time to stop downloading |
Value
TRUE or FALSE
(Internal) Downloads data to tempdir Download data to tempdir
Description
(Internal) Downloads data to tempdir Download data to tempdir
Usage
fdi_download_7zip(download_url, dir_unzip, dir_zip, timeout = 10000)
Arguments
download_url |
Url of data to download |
dir_unzip |
Path of the unzipped downloaded data |
dir_zip |
Path of the zipped downloaded data |
timeout |
Time to stop downloading |
Value
Unzipped file
Donwload a read a raster (Internal) Helper to download and read a raster from an URL
Description
Donwload a read a raster (Internal) Helper to download and read a raster from an URL
Usage
fdi_download_raster(url, start = NULL, end = NULL, timeout = 5000)
Value
A SpatRaster
(Internal) Downloads data to tempdir Download data to tempdir
Description
(Internal) Downloads data to tempdir Download data to tempdir
Usage
fdi_download_unzip(download_url, dir_unzip, dir_zip, timeout = 1e+05)
Arguments
download_url |
Url of data to download |
dir_unzip |
Path of the unzipped downloaded data |
dir_zip |
Path of the zipped downloaded data |
timeout |
Time to stop downloading |
Value
Unzipped file
(Internal) Fix non Latin-ASCII names
Description
A function that fixes names with strange characters, spaces, and also convert to title
Usage
fdi_fix_names(name)
Arguments
name |
String to fix |
Value
A character vector of same length as name
Combines different raster tiles (Internal) Helper to combine rasters from forest extent GLAD
Description
Combines different raster tiles (Internal) Helper to combine rasters from forest extent GLAD
Usage
get_combined_raster(year_i, url_table, area, crop, ...)
Value
A SpatRaster
Combines different raster tiles (Internal) Helper to combine rasters from Copernicus Global Land Cover.
Description
Combines different raster tiles (Internal) Helper to combine rasters from Copernicus Global Land Cover.
Usage
get_combined_raster_2l(year_i, layer_i, url_table)
Value
A SpatRaster
Masks a list of SpatRasters (Internal) Masks using cli feedback
Description
Masks a list of SpatRasters (Internal) Masks using cli feedback
Usage
mask_with_feedback(r, xwgs84, quiet)
Value
An SpatRaster
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
Nest IFN3 or IFN 4 regeneration data (Internal) Helper to nest data from IFN
Description
Nest IFN3 or IFN 4 regeneration data (Internal) Helper to nest data from IFN
Usage
nest_ifn_regeneration(data, codes, process_level = 1)
Value
A tibble
Nest IFN3 or IFN 4 shrub data (Internal) Helper to nest data from IFN
Description
Nest IFN3 or IFN 4 shrub data (Internal) Helper to nest data from IFN
Usage
nest_ifn_shrub(data, codes, agents, ifn = 4)
Value
A tibble
Nest IFN3 or IFN 4 tree data (Internal) Helper to nest data from IFN
Description
Nest IFN3 or IFN 4 tree data (Internal) Helper to nest data from IFN
Usage
nest_ifn_tree(
data,
codes,
agents,
which = "current",
ifn = 4,
process_level = 1
)
Value
A tibble
Process a list returned by fd_iventory_spain (Internal) Helper process IFN3 or IFN4 data
Description
Process a list returned by fd_iventory_spain (Internal) Helper process IFN3 or IFN4 data
Usage
process_ifn(data, process_level = 1, ifn = 4, province_fix)
Value
An sf
object
Level 2 process of tree data (Internal) Helper to process tree data of IFN
Description
Level 2 process of tree data (Internal) Helper to process tree data of IFN
Usage
process_pmayores(data)
Value
A tibble