
Import PRODES Deforestation Data from TerraBrasilis for Brazilian Municipalities
Source:R/sus_grid_prodes.R
sus_grid_prodes.Rdsus_grid_prodes() downloads INPE PRODES annual deforestation data from the
TerraBrasilis WFS API, spatially intersects deforestation polygons with
municipality boundaries, and returns municipality-level annual deforestation
areas as a climasus_df compatible with sus_mod_dlnm() and
sus_climate_anomaly().
PRODES (Projeto de Monitoramento do Desmatamento na Amazônia Legal por Satélite) is INPE's primary deforestation monitoring program. Deforestation exposure is a key driver of frontier malaria (SINAN), dengue, leishmaniasis, and respiratory disease from biomass burning in Brazil.
Usage
sus_grid_prodes(
years,
biomes = c("Amazon", "Cerrado", "MataAtlantica", "Caatinga", "Pampa", "Pantanal"),
uf = NULL,
municipalities = NULL,
use_cache = TRUE,
cache_dir = "~/.climasus4r_cache/prodes",
lang = "pt",
verbose = TRUE
)Arguments
- years
Integer vector. Years to download. Availability by biome: Amazon 2007–present; all others 2000–present.
- biomes
Character vector. Biomes to include. Any combination of:
"Amazon","Cerrado","MataAtlantica","Caatinga","Pampa","Pantanal". Default: all six biomes.- uf
Character vector. Optional state filter (e.g.,
c("MT", "PA")). Reduces download size.NULL= all states in the selected biome(s).- municipalities
An
sfPOLYGON object (e.g., fromgeobr::read_municipality()). When provided, deforestation polygons are spatially intersected with municipality boundaries and annual areas are aggregated. IfNULL, raw deforestation polygons are returned as an sfclimasus_df.- use_cache
Logical. Reuse previously downloaded GeoJSON files and aggregated Parquet caches. Default
TRUE.- cache_dir
Character. Root cache directory. Default
"~/.climasus4r_cache/prodes".- lang
Character. Message language:
"pt"(default),"en","es".- verbose
Logical. Print progress. Default
TRUE.
Value
If
municipalitiesis provided: aclimasus_dfwith columnscode_muni(character),date(Date, Jan 1 of the PRODES year),year(integer),deforested_area_km2(numeric, total area of deforestation polygons intersecting the municipality),n_patches(integer, count of distinct deforestation patches), andbiome(character). Metadata:stage = "climate",type = "prodes".If
municipalities = NULL: the raw deforestation polygon sf object as aclimasus_dfwith columnsyear,state,area_km,biome.
PRODES year convention
A PRODES year N covers August 1 of year N-1 through July 31 of year N.
The date column is set to YYYY-01-01 by convention (the publication
year). For time-series analyses, note that most deforestation peaks occur
during the dry season (July–October).
Data source
INPE PRODES via TerraBrasilis WFS. No authentication required.
All biomes accessed via https://terrabrasilis.dpi.inpe.br/geoserver/wfs
Packages required
sf is required for spatial intersection when municipalities is provided.
httr2 and jsonlite are used for WFS downloads (in Suggests).
Examples
if (FALSE) { # \dontrun{
library(geobr)
mt_mun <- read_municipality(code_muni = "MT", year = 2020)
# Annual deforestation for Mato Grosso municipalities, Amazon biome
prodes <- sus_grid_prodes(
years = 2015:2022,
biomes = "Amazon",
uf = "MT",
municipalities = mt_mun,
lang = "pt"
)
sus_meta(prodes, "stage") # "climate"
sus_meta(prodes, "type") # "prodes"
# Raw polygon data (no aggregation)
prodes_raw <- sus_grid_prodes(
years = 2022,
biomes = "Amazon",
uf = "PA",
lang = "en"
)
} # }