| Title: | Remote Sensing Metrics for Spatial Health Analysis |
|---|---|
| Description: | Calculate and extract remote sensing metrics for spatial analysis in the field of health. The package offers R users a quick and straightforward way to obtain areal or zonal statistics of key environmental indicators, covariates, and vector-borne disease data ideal for modeling infectious diseases within the framework of spatial epidemiology. |
| Authors: | Antony Barja [aut, cph] (ORCID: <https://orcid.org/0000-0001-5921-2858>), Yomali Ferreyra [cre] (ORCID: <https://orcid.org/0000-0002-5184-9595>), Diego Villa [ctb], Gabriel Carrasco-Escobar [aut] (ORCID: <https://orcid.org/0000-0002-6945-0419>) |
| Maintainer: | Yomali Ferreyra <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.2 |
| Built: | 2026-10-19 20:22:01 UTC |
| Source: | https://github.com/harmonize-tools/land4health |
Extracts CHIRPS v3 precipitation estimates for a user-defined region and time range from the Earth Engine dataset UCSB-CHC/CHIRPS/V3/DAILY_SAT (IMERG-based) or UCSB-CHC/CHIRPS/V3/DAILY_RNL (ERA5-based). The function supports daily, monthly, and annual temporal aggregation. Monthly and annual values are computed as sums of daily precipitation (mm), which is the standard in hydrology and vector-borne disease modelling.
CHIRPS v3 (Climate Hazards Center InfraRed Precipitation with Stations version 3) is a quasi-global (60°S–60°N), high-resolution (0.05°) gridded rainfall dataset from 1981 to near-present, combining satellite thermal infrared estimates with in-situ station observations.
l4h_chirps( from, to, by = "month", product = "sat", region, scale = 5566, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_chirps( from, to, by = "month", product = "sat", region, scale = 5566, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character or Date. Start date ( |
to |
Character or Date. End date ( |
by |
Character. Temporal aggregation frequency. Options:
|
product |
Character. CHIRPS v3 daily product used for disaggregation. Options:
|
region |
Spatial object defining the region of interest.
Accepts an |
scale |
Numeric. Reducer scale in meters. Default |
stat |
Character. Summary statistic per image per region. One of
|
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Additional arguments passed to the extraction backend. |
An sf or tibble with columns:
date (Date — first day of the period),
variable (character — "precipitation"),
value (numeric — mm in the corresponding time unit),
plus geometry if sf = TRUE, and any attributes from region.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Funk, C., Peterson, P., Harrison, L. et al. (2026). The Climate Hazards Center Infrared Precipitation with Stations, Version 3. Scientific Data, 13, 718. doi:10.1038/s41597-026-07096-4
if (interactive()) { library(land4health) rgee::ee_Initialize() # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # 1. Monthly precipitation (mm/month) 2020, SAT product out_monthly <- l4h_chirps( from = "2020-01-01", to = "2020-12-31", by = "month", product = "sat", region = region, stat = "mean" ) head(out_monthly) # 2. Annual precipitation (mm/year) 2015-2020, RNL product out_annual <- l4h_chirps( from = "2015-01-01", to = "2020-12-31", by = "annual", product = "rnl", region = region, stat = "mean" ) head(out_annual) # 3. Daily precipitation (mm/day) for one month out_daily <- l4h_chirps( from = "2020-06-01", to = "2020-06-30", by = "daily", product = "sat", region = region, stat = "mean" ) head(out_daily) }if (interactive()) { library(land4health) rgee::ee_Initialize() # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # 1. Monthly precipitation (mm/month) 2020, SAT product out_monthly <- l4h_chirps( from = "2020-01-01", to = "2020-12-31", by = "month", product = "sat", region = region, stat = "mean" ) head(out_monthly) # 2. Annual precipitation (mm/year) 2015-2020, RNL product out_annual <- l4h_chirps( from = "2015-01-01", to = "2020-12-31", by = "annual", product = "rnl", region = region, stat = "mean" ) head(out_annual) # 3. Daily precipitation (mm/day) for one month out_daily <- l4h_chirps( from = "2020-06-01", to = "2020-06-30", by = "daily", product = "sat", region = region, stat = "mean" ) head(out_daily) }
Retrieves the CO column number density (mol/m2) for a user-defined region and date range from the Sentinel-5P TROPOMI OFFLINE L3 CO dataset.
l4h_co_column( from, to, region, stat = "mean", scale = 1113, sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_co_column( from, to, region, stat = "mean", scale = 1113, sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character. Start date in |
to |
Character. End date in |
region |
A spatial object ( |
stat |
Character. Summary statistic to apply ( |
scale |
Numeric. Nominal scale in meters. Default is |
sf |
Logical. Return result as |
quiet |
Logical. Suppress progress messages? Default is |
force |
Logical. Force extract without spatial check? Default is |
... |
Arguments passed to the extraction backend. |
The function uses the Earth Engine dataset COPERNICUS/S5P/OFFL/L3_CO and selects only the
"CO_column_number_density" band. Images are composited to daily means before
extraction to avoid exceeding the 5000-band limit on toBands().
An sf or tibble containing CO column density (mol/m2) by date and geometry.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
COPERNICUS/S5P/OFFL/L3_CO. Sentinel-5P Offline L3 Carbon Monoxide. European Union / ESA / Copernicus. https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S5P_OFFL_L3_CO
if (interactive()) { library(land4health) ee_Initialize() # Define region as a bounding box polygon region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326) ) # Run CO column calculation co_data <- l4h_co_column( from = "2022-01-01", to = "2022-12-31", region = region, stat = "mean" ) head(co_data) }if (interactive()) { library(land4health) ee_Initialize() # Define region as a bounding box polygon region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326) ) # Run CO column calculation co_data <- l4h_co_column( from = "2022-01-01", to = "2022-12-31", region = region, stat = "mean" ) head(co_data) }
Downloads dengue case counts from the OpenDengue Project, a harmonized, open-access repository of dengue surveillance data from national ministries of health. The function supports national, spatial, and temporal extracts filtered by WHO region and country for a specified date range.
l4h_dengue( from, to, data_type = c("temporal", "spatial", "national"), region = NULL, country = "Peru", cache = TRUE, quiet = FALSE )l4h_dengue( from, to, data_type = c("temporal", "spatial", "national"), region = NULL, country = "Peru", cache = TRUE, quiet = FALSE )
from |
Character or Date. Start date ( |
to |
Character or Date. End date ( |
data_type |
Character. One of |
region |
Character. WHO region code or full name
(case-insensitive). Codes: |
country |
Character. Country name (case-insensitive),
matched against |
cache |
Logical. If |
quiet |
Logical. If |
A tibble with columns: date_start, date_end, cases,
state, area, plus other fields from the source data.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Data from the OpenDengue Project.
Morales, I. et al. (2024). OpenDengue: Harmonized dengue surveillance data for Latin America.
if (interactive()) { # National extract for Peru in 2019 df_nat <- l4h_dengue( from = "2019-01-01", to = "2019-12-31", data_type = "national", region = "paho", country = "peru", cache = TRUE, quiet = TRUE ) head(df_nat) # Spatial extract for Brazil df_spat <- l4h_dengue( from = "2021-01-01", to = "2021-12-31", data_type = "spatial", region = "Pan-American Region", country = "brazil", cache = TRUE, quiet = TRUE ) head(df_spat) # Temporal extract for Argentina df_temp <- l4h_dengue( from = "2020-01-01", to = "2020-12-31", data_type = "temporal", region = "PAHO", country = "Argentina", cache = TRUE, quiet = TRUE ) head(df_temp) }if (interactive()) { # National extract for Peru in 2019 df_nat <- l4h_dengue( from = "2019-01-01", to = "2019-12-31", data_type = "national", region = "paho", country = "peru", cache = TRUE, quiet = TRUE ) head(df_nat) # Spatial extract for Brazil df_spat <- l4h_dengue( from = "2021-01-01", to = "2021-12-31", data_type = "spatial", region = "Pan-American Region", country = "brazil", cache = TRUE, quiet = TRUE ) head(df_spat) # Temporal extract for Argentina df_temp <- l4h_dengue( from = "2020-01-01", to = "2020-12-31", data_type = "temporal", region = "PAHO", country = "Argentina", cache = TRUE, quiet = TRUE ) head(df_temp) }
Extracts ERA5-Land climate variables for a user-defined region
and time range from the Earth Engine datasets
ECMWF/ERA5_LAND/DAILY_AGGR (by = "daily") or
ECMWF/ERA5_LAND/MONTHLY_AGGR (by = "month"), plus
ECMWF/ERA5_LAND/HOURLY for the diurnal bands "rh_day"/"rh_night".
Each image is summarized over the region using a chosen
statistic (e.g., mean/median), values are converted to conventional
units (degrees Celsius, mm, volume fraction), and the function
returns an sf or tibble.
ERA5-Land is the land-component replay of the ECMWF ERA5 climate
reanalysis (Copernicus Climate Data Store), with global coverage
from 1950 to near-present at ~9 km (0.1 degrees) resolution.
It complements l4h_chirps() (finer precipitation) and
l4h_terra_climate() (finer monthly climatology) by providing
daily exposure windows and soil-moisture variables that are
key for vector-borne disease modelling (temperature/precipitation lags).
l4h_era5land( from, to, by = "month", band = "t2m", region, scale = 11132, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_era5land( from, to, by = "month", band = "t2m", region, scale = 11132, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character or Date. Start date ( |
to |
Character or Date. End date ( |
by |
Character. Temporal resolution. Options:
|
band |
Character vector. One or more ERA5-Land variables to extract. Supported codes:
|
region |
Spatial object defining the region of interest.
Accepts an |
scale |
Numeric. Reducer scale in meters. Default |
stat |
Character. Summary statistic per image per region. One of
|
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Additional arguments passed to the extraction backend. |
Relative humidity (band = "rh") is derived server-side in Earth Engine
from the bands the function already uses (temperature_2m and
dewpoint_temperature_2m), following the Magnus formula for saturation
vapour pressure (Wright 1997 coefficients, same as the EU operational
product derived from ERA5-Land):
with T (air temperature) and Td (dewpoint) in degrees C, converted
from Kelvin inside Earth Engine (- 273.15). The ratio simplifies to
100 * exp(b*c*(Td - T) / ((c + T) * (c + Td))) with b = 17.502 and
c = 240.97. Values are clamped to 0–100%.
Note the aggregation order: DAILY_AGGR/MONTHLY_AGGR already store
time-averaged T/Td, so rh is the humidity of the averaged
temperatures, not the average of instantaneous humidity. This is the
standard practice (same as the EU ERA5-Land product). Below 0 °C the
water-saturation form is kept (no ice correction), which is acceptable
for vector-borne disease modelling but documented here as a limitation.
Day and night are defined in Peru time (PET, UTC-5, no daylight saving):
day is 06:00-18:00 PET and night is 18:00-06:00 PET. Since
ECMWF/ERA5_LAND/HOURLY timestamps are UTC, "rh_day" averages the UTC
hours 11-22 and "rh_night" the UTC hours 23, 00-10. Each hourly image
is converted to RH with the same Magnus formula above and then averaged
(mean of hourly means with equal weights). Diurnal bands therefore cannot
be combined with "rh" or native bands in one call: they come from
different collections with different time bases.
An sf or tibble with columns:
date (Date — first day of the period),
variable (character — band code, e.g. "t2m", "rh"),
value (numeric — degrees C, percent, mm, or volume fraction),
plus geometry if sf = TRUE, and any attributes from region.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Muñoz Sabater, J. (2019): ERA5-Land monthly averaged data from 1950 to present. Copernicus Climate Change Service (C3S) Climate Data Store (CDS). doi:10.24381/cds.68d2bb30
Bolton, D. (1980). The computation of equivalent potential temperature. Monthly Weather Review, 108, 1046-1053.
Alduchov, O. A., & Eskridge, R. E. (1996). Improved Magnus form approximation of saturation vapor pressure. Journal of Applied Meteorology, 35, 601-609.
if (interactive()) { library(land4health) rgee::ee_Initialize() # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # 1. Monthly 2m temperature (degrees C) 2020 out_monthly <- l4h_era5land( from = "2020-01-01", to = "2020-12-31", by = "month", band = "t2m", region = region, stat = "mean" ) head(out_monthly) # 2. Daily relative humidity (%) + precipitation (mm), one month out_daily <- l4h_era5land( from = "2020-06-01", to = "2020-06-30", by = "daily", band = c("rh", "pr"), region = region, stat = "mean" ) head(out_daily) # 3. Daytime vs nighttime relative humidity (%), one week (Peru time) out_diurnal <- l4h_era5land( from = "2020-06-01", to = "2020-06-07", by = "daily", band = c("rh_day", "rh_night"), region = region, stat = "mean" ) head(out_diurnal) }if (interactive()) { library(land4health) rgee::ee_Initialize() # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # 1. Monthly 2m temperature (degrees C) 2020 out_monthly <- l4h_era5land( from = "2020-01-01", to = "2020-12-31", by = "month", band = "t2m", region = region, stat = "mean" ) head(out_monthly) # 2. Daily relative humidity (%) + precipitation (mm), one month out_daily <- l4h_era5land( from = "2020-06-01", to = "2020-06-30", by = "daily", band = c("rh", "pr"), region = region, stat = "mean" ) head(out_daily) # 3. Daytime vs nighttime relative humidity (%), one week (Peru time) out_diurnal <- l4h_era5land( from = "2020-06-01", to = "2020-06-07", by = "daily", band = c("rh_day", "rh_night"), region = region, stat = "mean" ) head(out_diurnal) }
Calculates forest loss within a user-defined region for a specified year range. Forest loss is defined as a stand-replacement disturbance, or a change from forest to non-forest state.
l4h_forest_loss(from, to, region, sf = TRUE, quiet = FALSE, force = FALSE, ...)l4h_forest_loss(from, to, region, sf = TRUE, quiet = FALSE, force = FALSE, ...)
from |
Character. Start date in |
to |
Character. End date in |
region |
A spatial object defining the region of interest. Accepts an |
sf |
Logical. Return result as an |
quiet |
Logical. If |
force |
Logical. Force request extract. |
... |
arguments of |
Forest loss is derived from the Hansen Global Forest Change dataset.
The lossyear band encodes the year of forest cover loss as follows:
Values range from 1 to n, where 1 corresponds to the year 2001 and n to the year 2000 + n.
A value of 0 indicates no forest loss detected.
A sf or tibble object with forest loss per year in square kilometers.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Hansen, M. C., Potapov, P. V., Moore, R., Hancher, M., Turubanova, S. A., Tyukavina, A., ... & Townshend, J. R. G. (2013). High-Resolution Global Maps of 21st-Century Forest Cover Change. Science, 342(6160), 850–853. DOI: doi:10.1126/science.1244693
if (interactive()) { library(land4health) ee_Initialize() # Define region as a bounding box polygon region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Run forest loss calculation result <- l4h_forest_loss( from = '2005-01-01', to = '2007-01-01', region = region) head(result) }if (interactive()) { library(land4health) ee_Initialize() # Define region as a bounding box polygon region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Run forest loss calculation result <- l4h_forest_loss( from = '2005-01-01', to = '2007-01-01', region = region) head(result) }
Retrieves total built‑up surface area (in m2 per 100m grid cell) from the GHSL Built-Up Surface dataset (GHS‑BUILT‑S R2023A), over a user-defined region and date range. The dataset is provided in 5‑year epochs (1975–2030) at ~100m resolution.
l4h_human_built( from, to, region, scale = 100, sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_human_built( from, to, region, scale = 100, sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character. Start date in "YYYY-MM-DD" format (only the year is used). |
to |
Character. End date in "YYYY-MM-DD" format (only the year is used). |
region |
Spatial object ( |
scale |
Numeric. Resolution in meters (default = 100). |
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Arguments passed to |
A sf or tibble with columns date, variable, and built_surface_m2.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Pesaresi, M. & Politis, P. (2023). GHS‑BUILT‑S R2023A: Red de superficie construida de GHS, derivada de la composición de Sentinel-2 y Landsat, multitemporal (1975–2030). European Commission, Joint Research Centre (JRC). doi:10.2905/9F06F36F-4B11-47EC-ABB0-4F8B7B1D72EA.
Pesaresi, M., Schiavina, M., Politis, P., Freire, S., Krasnodebska, K., Uhl, J.H., Carioli, A., et al. (2024). Avances en la capa de asentamientos humanos globales a través de la evaluación conjunta de datos de observación de la Tierra y encuestas demográficas. International Journal of Digital Earth, 17(1). doi:10.1080/17538947.2024.2390454
Dataset on Google Earth Engine: https://developers.google.com/earth-engine/datasets/catalog/JRC_GHSL_P2023A_GHS_BUILT_S
if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region in Ucayali, Peru region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Extract built-up surface area from 2000 to 2020 built_area <- l4h_human_built( from = "2000-01-01", to = "2020-12-31", region = region, scale = 100, stat = "sum" ) head(built_area) # Example using as tibble built_tbl <- l4h_human_built( from = "1990-01-01", to = "2015-12-31", region = region, sf = FALSE, stat = "mean" ) dplyr::glimpse(built_tbl) }if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region in Ucayali, Peru region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Extract built-up surface area from 2000 to 2020 built_area <- l4h_human_built( from = "2000-01-01", to = "2020-12-31", region = region, scale = 100, stat = "sum" ) head(built_area) # Example using as tibble built_tbl <- l4h_human_built( from = "1990-01-01", to = "2015-12-31", region = region, sf = FALSE, stat = "mean" ) dplyr::glimpse(built_tbl) }
Installs required Python packages (earthengine-api and numpy).
By default uses uv when available (much faster downloads with a live
progress bar in the console) and falls back to pip via
reticulate::py_install() otherwise.
l4h_install( pip = TRUE, system = FALSE, force = FALSE, restart = TRUE, backend = c("auto", "uv", "pip"), ... )l4h_install( pip = TRUE, system = FALSE, force = FALSE, restart = TRUE, backend = c("auto", "uv", "pip"), ... )
pip |
Logical. If TRUE (default), uses pip for installation. Set to FALSE if specifying a different installation method. |
system |
Logical. If TRUE, uses system pip directly via system() call. |
force |
Logical. If TRUE, forces reinstallation/upgrade of packages. |
restart |
Logical. If TRUE, automatically restarts R session after installation. Default TRUE. |
backend |
Character. Installation backend: |
... |
Additional arguments passed to reticulate::py_install(), such as:
|
Invisibly returns NULL
# Installation is intentionally not run in examples because it modifies # the Python environment and may be slow. # See the installation vignette for instructions: vignette("land4health-setup", package = "land4health")# Installation is intentionally not run in examples because it modifies # the Python environment and may be slow. # See the installation vignette for instructions: vignette("land4health-setup", package = "land4health")
Returns a tibble with the metadata of every metric shipped with
land4health. You can optionally filter by thematic category, metric
short name, or provider.
If open_in_browser = TRUE, all matching URLs are opened in your default
browser; for safety you must supply at least one filter, and—if more than
five tabs would open—you are asked to confirm in interactive sessions.
l4h_list_metrics( category = NULL, metric = NULL, provider = NULL, open_in_browser = FALSE )l4h_list_metrics( category = NULL, metric = NULL, provider = NULL, open_in_browser = FALSE )
category |
Optional single string. Filter by thematic category. |
metric |
Optional single string. Filter by metric short name. |
provider |
Optional single string. Filter by the |
open_in_browser |
Logical; open the matching URLs in your browser?
Defaults to |
A tibble (returned invisibly). When open_in_browser = FALSE
a compact preview (max 10 rows) is printed before the tibble is
returned.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
## All examples keep `open_in_browser = FALSE` to avoid side-effects ## during automated checks. ## 1 Show the full inventory (truncated to 10 rows). l4h_list_metrics() ## 2 Filter by category (“Human intervention”). l4h_list_metrics(category = "Human intervention") ## 3 Filter by provider (“WorldPop”) and store the result. worldpop_tbl <- l4h_list_metrics(provider = "WorldPop") head(worldpop_tbl)## All examples keep `open_in_browser = FALSE` to avoid side-effects ## during automated checks. ## 1 Show the full inventory (truncated to 10 rows). l4h_list_metrics() ## 2 Filter by category (“Human intervention”). l4h_list_metrics(category = "Human intervention") ## 3 Filter by provider (“WorldPop”) and store the result. worldpop_tbl <- l4h_list_metrics(provider = "WorldPop") head(worldpop_tbl)
Downloads modeled malaria raster surfaces from the Malaria Atlas Project
(MAP) GeoServer via WCS 2.0.1, extracts zonal statistics for a user-defined
region and time range, and returns an sf or tibble.
Available species: Plasmodium falciparum ("pf") and
Plasmodium vivax ("pv").
Available measures: "incidence_rate", "incidence_count",
"parasite_rate", "mortality_rate", "mortality_count".
The function automatically selects the latest release available on the
server for the requested species + measure combination.
l4h_malaria( from, to, species = "pf", measure = "incidence_rate", region, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_malaria( from, to, species = "pf", measure = "incidence_rate", region, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Integer. Start year. |
to |
Integer. End year. Must be >= |
species |
Character. One of |
measure |
Character. One of |
region |
Spatial object defining the region of interest.
Accepts an |
stat |
Character. Summary statistic per pixel per year. One of
|
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Additional arguments (currently unused). |
The MAP GeoServer provides modeled global raster surfaces at ~5 km resolution.
Rates are expressed per person (0-1 scale for parasite rate, per 1,000 for
incidence), and counts are absolute numbers. The function connects to the
GeoServer via ows4R::WCSClient, downloads the coverage clipped to the
region bounding box, and uses terra::extract() for zonal statistics.
An sf or tibble with columns:
date (Date, first day of year),
species (character, "pf" or "pv"),
measure (character, the requested measure),
value (numeric, in native units),
plus geometry if sf = TRUE, and any attributes from region.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Malaria Atlas Project. https://malariaatlas.org/
if (interactive()) { library(land4health) # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # Pf incidence rate 2015-2020 out <- l4h_malaria( from = 2015, to = 2020, species = "pf", measure = "incidence_rate", region = region ) head(out) # Pv parasite rate out_pv <- l4h_malaria( from = 2020, to = 2022, species = "pv", measure = "parasite_rate", region = region, sf = FALSE ) head(out_pv) }if (interactive()) { library(land4health) # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # Pf incidence rate 2015-2020 out <- l4h_malaria( from = 2015, to = 2020, species = "pf", measure = "incidence_rate", region = region ) head(out) # Pv parasite rate out_pv <- l4h_malaria( from = 2020, to = 2022, species = "pv", measure = "parasite_rate", region = region, sf = FALSE ) head(out_pv) }
Retrieves annual night‑time light radiance (average radiance, nanoWatt/sr/cm²) from the Harmonized Global Night Time Lights dataset for a user-defined region and time range. The dataset harmonizes DMSP-OLS (1992‑2013) with VIIRS‑like data (2014‑2021), ensuring consistent long-term time series at ~1km resolution.
l4h_night_lights( from, to, region, stat = "mean", scale = 1000, sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_night_lights( from, to, region, stat = "mean", scale = 1000, sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character. Start date in |
to |
Character. End date in |
region |
A spatial object ( |
stat |
Character. Summary statistic to apply per year per region (e.g. |
scale |
Numeric. Nominal scale in meters (default |
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Additional arguments passed to |
A sf or tibble with annual night‑time light statistics per region and date.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region in Ucayali, Peru region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Extract only DMSP-OLS data (1998–2010) ntl_dmsp <- l4h_night_lights( from = "1998-01-01", to = "2010-12-31", region = region, stat = "mean" ) head(ntl_dmsp) # Extract only VIIRS data (2016–2021) ntl_viirs <- l4h_night_lights( from = "2016-01-01", to = "2021-12-31", region = region, stat = "mean" ) head(ntl_viirs) # Extract both DMSP and VIIRS (2008–2020) ntl_mixed <- l4h_night_lights( from = "2008-01-01", to = "2020-12-31", region = region, stat = "mean" ) head(ntl_mixed) }if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region in Ucayali, Peru region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Extract only DMSP-OLS data (1998–2010) ntl_dmsp <- l4h_night_lights( from = "1998-01-01", to = "2010-12-31", region = region, stat = "mean" ) head(ntl_dmsp) # Extract only VIIRS data (2016–2021) ntl_viirs <- l4h_night_lights( from = "2016-01-01", to = "2021-12-31", region = region, stat = "mean" ) head(ntl_viirs) # Extract both DMSP and VIIRS (2008–2020) ntl_mixed <- l4h_night_lights( from = "2008-01-01", to = "2020-12-31", region = region, stat = "mean" ) head(ntl_mixed) }
List all land4health packages
l4h_packages(include_self = TRUE)l4h_packages(include_self = TRUE)
include_self |
default |
A character vector of package names included in the "land4health" meta-package.
l4h_packages()l4h_packages()
Extracts monthly PM2.5 concentrations for a user-defined region
and time range from the Earth Engine Community Catalog dataset
Global PM2.5 (V6GL02 CNN). Each monthly image is summarized over the
region using a selected statistic (e.g., mean/median). The function returns
either an sf or a tibble, with dates normalized to the first day
of each month.
l4h_pm2_5( from, to, region, scale = 1000, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_pm2_5( from, to, region, scale = 1000, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character or Date. Start date ( |
to |
Character or Date. End date ( |
region |
Spatial object defining the region of interest.
Accepts an |
scale |
Numeric. Reducer scale in meters. Default |
stat |
Character. Summary statistic per image per region. One of
|
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Additional arguments passed to the extraction backend. |
This function queries the Global PM2.5 monthly product (V6GL02, CNN‐based fusion)
from the GEE Community Catalog and aggregates it over the provided region and dates.
The dataset provides monthly surface PM2.5 concentrations (µg/m).
Values are returned in native units (no extra scale factor is applied here).
Notes
Dates are validated (YYYY-MM-DD) and constrained to the dataset range used
in this package (default: 2000–2019).
Output dates are normalized to the first day of each month found in the bands.
The function expects a reasonable scale relative to the dataset resolution
to avoid oversampling or excessive smoothing.
An sf or tibble with columns:
date (Date) — first day of the month,
variable (character) — fixed as "pm2.5",
value (numeric) — PM2.5 in µg/m,
plus geometry if sf = TRUE, and any attributes from region.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
GEE Community Catalog – Global PM2.5 (V6GL02 CNN). https://gee-community-catalog.org/projects/global_pm25/
if (interactive()) { library(land4health) rgee::ee_Initialize() # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # Monthly PM2.5 (ug/m^3) for 2010, spatial mean out_pm <- l4h_pm2_5( from = "2010-01-01", to = "2010-12-31", band = "b1", # ignored (single band) region = region, stat = "mean", scale = 3000 ) head(out_pm) }if (interactive()) { library(land4health) rgee::ee_Initialize() # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # Monthly PM2.5 (ug/m^3) for 2010, spatial mean out_pm <- l4h_pm2_5( from = "2010-01-01", to = "2010-12-31", band = "b1", # ignored (single band) region = region, stat = "mean", scale = 3000 ) head(out_pm) }
Calculates the Rural Access Index (RAI) for a given region using datasets from the GEE Community Catalog. The RAI represents the proportion of the rural population living within 2 km of an all-season road, aligning with SDG indicator 9.1.1.
l4h_rural_access_index( region, weighted = FALSE, fun = NULL, sf = FALSE, quiet = FALSE, force = FALSE, ... )l4h_rural_access_index( region, weighted = FALSE, fun = NULL, sf = FALSE, quiet = FALSE, force = FALSE, ... )
region |
A spatial object defining the region of interest.
Can be an |
weighted |
Logical. If |
fun |
Character. Summary function to apply to the population raster when |
sf |
Logical. If |
quiet |
Logical. If TRUE, suppress the progress bar (default FALSE). |
force |
Logical. If |
... |
arguments of |
This function uses the following datasets from the GEE Community Catalog:
projects/sat-io/open-datasets/RAI/ruralpopaccess/ – raster of rural population with access to all-season roads
projects/sat-io/open-datasets/RAI/inaccessibilityindex/ – binary raster indicating access areas (1 = access, 0 = no access)
When weighted = TRUE, the RAI is calculated as the sum (or chosen summary via fun) of the accessible rural population
divided by the total rural population within the specified region.
When weighted = FALSE, the RAI is calculated as the ratio of pixel areas: the total area (in in km^2) with access
divided by the total rural area.
The fun parameter only applies when weighted = TRUE. It will be ignored otherwise.
A spatial object containing the computed RAI value for the region in an
sf or tibble object.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
GEE Community Catalog: https://gee-community-catalog.org/projects/rai/
Frontiers in Remote Sensing (2024): doi:10.3389/frsen.2024.1375476
if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region in Ucayali, Peru region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Population-weighted RAI rai_w <- l4h_rural_access_index( region = region, weighted = TRUE, fun = "sum", sf = TRUE) head(rai_w) # Area-based RAI rai <- l4h_rural_access_index( region = region, weighted = FALSE, sf = TRUE) head(rai) }if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region in Ucayali, Peru region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Population-weighted RAI rai_w <- l4h_rural_access_index( region = region, weighted = TRUE, fun = "sum", sf = TRUE) head(rai_w) # Area-based RAI rai <- l4h_rural_access_index( region = region, weighted = FALSE, sf = TRUE) head(rai) }
This function accesses the geeSEBAL-MODIS collection published by the ET-Brasil project,
extracts the etp band (daily evapotranspiration in mm/day), and allows temporal aggregation
by 8-day images or monthly or yearly composites period. Optionally, results can be returned
as sf/tibble objects in R.
l4h_sebal_modis( from, to, by = "8 days", region, fun = "mean", sf = TRUE, force = FALSE, quiet = FALSE, ... )l4h_sebal_modis( from, to, by = "8 days", region, fun = "mean", sf = TRUE, force = FALSE, quiet = FALSE, ... )
from |
Start date in |
to |
End date in |
by |
Temporal aggregation frequency. Options: |
region |
A spatial object defining the region of interest. Accepts |
fun |
Aggregation function when |
sf |
Logical. Return result as an |
force |
Logical. If |
quiet |
Logical. If TRUE, suppress the progress bar (default FALSE). |
... |
arguments of |
A sf or tibble object with etp values.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Comini,B., Ruhoff,A., Laipelt,L., Fleischmann,A., Huntington,J., Morton,C., Melton,F., Erickson,T., Roberti,D., Souza,V., Biudes,M., Machado,N., Santos,C. & Cosio,E. (2023). geeSEBAL‑MODIS: Continental‑scale evapotranspiration based on the surface energy balance for South America. Preprint. DOI: 10.13140/RG.2.2.17579.11041
geeSEBAL‑MODIS v0‑02 dataset. Licensed under the Creative Commons Attribution 4.0 International (CC‑BY‑4.0) license.
if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region in Ucayali, Peru region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # 1. Eight-day composites (8 days) # 2020-01-01 → 2020-12-31, reducer = "mean" sebal_8d <- l4h_sebal_modis( from = "2020-01-01", to = "2020-12-31", region = region ) # 2. Monthly means # Same period, but aggregated to calendar months sebal_month <- l4h_sebal_modis( from = "2020-01-01", to = "2020-12-31", by = "month", region = region ) # 3. Annual evapotranspiration # 2015 → 2022, one value per year sebal_annual <- l4h_sebal_modis( from = "2015-01-01", to = "2022-12-31", by = "annual", fun = "sum", region = region, sf = FALSE ) }if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region in Ucayali, Peru region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # 1. Eight-day composites (8 days) # 2020-01-01 → 2020-12-31, reducer = "mean" sebal_8d <- l4h_sebal_modis( from = "2020-01-01", to = "2020-12-31", region = region ) # 2. Monthly means # Same period, but aggregated to calendar months sebal_month <- l4h_sebal_modis( from = "2020-01-01", to = "2020-12-31", by = "month", region = region ) # 3. Annual evapotranspiration # 2015 → 2022, one value per year sebal_annual <- l4h_sebal_modis( from = "2015-01-01", to = "2022-12-31", by = "annual", fun = "sum", region = region, sf = FALSE ) }
Extracts daytime or nighttime Land Surface Temperature (LST) for a user-defined region and time range using the MODIS MOD11A1.061 product. The function supports summarizing the temperature data over each date (or each month) using a selected statistic (e.g., mean or median).
l4h_surface_temp( from, to, region, band = "day", level = "strict", by = "day", scale = 1000, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_surface_temp( from, to, region, band = "day", level = "strict", by = "day", scale = 1000, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character or Date. Start date of the analysis (e.g., |
to |
Character or Date. End date of the analysis (e.g., |
region |
A spatial object defining the region of interest. Accepts an |
band |
Character. LST type to extract: |
level |
Character. Quality filter level to apply to MODIS LST pixels.
Use |
by |
Character. Temporal resolution of the output. One of |
scale |
Numeric. Spatial resolution in meters. Default is |
stat |
Character. Summary statistic to apply. One of |
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Additional arguments passed to |
The MODIS MOD11A1.061 product provides daily Land Surface Temperature and quality information.
This function filters out low-quality or cloud-contaminated pixels based on the QC_Day or QC_Night band.
When by = "month", for each calendar month in [from, to] the function:
Filters the daily collection to that month.
Applies the same quality mask used for daily extraction to every image.
Reduces the masked images to a single monthly image using the reducer implied by stat.
Because masking happens before reducing, a cloudy day never drags the monthly value down or up — it simply does not contribute a pixel to that month's calculation.
LST values are originally stored as Kelvin multiplied by 0.02. This function automatically
converts them to degrees Celsius using the formula: LST = (value x 0.02) - 273.15.
A sf or tibble object with LST values (in degrees Celsius) extracted from MODIS MOD11A1,
at daily or monthly resolution depending on by.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Wan, Z., Hook, S., & Hulley, G. (2015). MOD11A1 MODIS/Terra Land Surface Temperature and Emissivity Daily L3 Global 1km SIN Grid V006 (Version 6.1). NASA EOSDIS Land Processes DAAC. doi:10.5067/MODIS/MOD11A1.061
MODIS MOD11A1.061 - Google Earth Engine Dataset Catalog. https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD11A1
if (interactive()) { library(land4health) ee_Initialize() region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Daily (unchanged default behaviour) lst_day <- l4h_surface_temp( from = "2020-01-01", to = "2020-12-31", region = region, band = "day", stat = "mean") # Monthly lst_month <- l4h_surface_temp( from = "2020-01-01", to = "2020-12-31", region = region, band = "day", stat = "mean", by = "month") head(lst_month) }if (interactive()) { library(land4health) ee_Initialize() region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Daily (unchanged default behaviour) lst_day <- l4h_surface_temp( from = "2020-01-01", to = "2020-12-31", region = region, band = "day", stat = "mean") # Monthly lst_month <- l4h_surface_temp( from = "2020-01-01", to = "2020-12-31", region = region, band = "day", stat = "mean", by = "month") head(lst_month) }
Extracts one or more TerraClimate variables for a user-defined region
and time range from the Earth Engine dataset IDAHO_EPSCOR/TERRACLIMATE.
The function summarizes each monthly image over the region using a chosen
statistic (e.g., mean/median), applies the appropriate scale factors to
return values in native units, and returns an sf or tibble.
l4h_terra_climate( from, to, band, region, scale = 1000, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_terra_climate( from, to, band, region, scale = 1000, stat = "mean", sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character or Date. Start date ( |
to |
Character or Date. End date ( |
band |
Character vector. One or more TerraClimate variables to extract.
Supported codes:
|
region |
Spatial object defining the region of interest.
Accepts an |
scale |
Numeric. Reducer scale in meters. Default |
stat |
Character. Summary statistic per image per region. One of
|
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Additional arguments passed to the extraction backend. |
An sf or tibble with columns:
date (Date, first day of the month),
variable (character, TerraClimate code),
value (numeric, in native units with scale factors applied),
plus geometry if sf = TRUE, and any attributes from region.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Abatzoglou, J. T., Dobrowski, S. Z., Parks, S. A., & Hegewisch, K. C. (2018). TerraClimate, a high-resolution global dataset of monthly climate and climatic water balance from 1958–2015. Scientific Data, 5, 170191. doi:10.1038/sdata.2017.191
if (interactive()) { library(land4health) rgee::ee_Initialize() # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # Monthly precipitation (mm) 2020, spatial mean out_pr <- l4h_terra_climate( from = "2020-01-01", to = "2020-12-31", band = "pr", region = region, stat = "mean", scale = 5000 ) head(out_pr) # Multiple variables: Tmax (C) + VPD (kPa) out_multi <- l4h_terra_climate( from = "2019-01-01", to = "2019-12-31", band = c("tmmx","vpd"), region = region, stat = "median", scale = 5000 ) }if (interactive()) { library(land4health) rgee::ee_Initialize() # ROI simple (EPSG:4326) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326)) # Monthly precipitation (mm) 2020, spatial mean out_pr <- l4h_terra_climate( from = "2020-01-01", to = "2020-12-31", band = "pr", region = region, stat = "mean", scale = 5000 ) head(out_pr) # Multiple variables: Tmax (C) + VPD (kPa) out_multi <- l4h_terra_climate( from = "2019-01-01", to = "2019-12-31", band = c("tmmx","vpd"), region = region, stat = "median", scale = 5000 ) }
Retrieves the travel time raster (in minutes) to the nearest healthcare facility or populated city, based on the Oxford Global Map of Accessibility datasets.
l4h_travel_time( region, destination = "cities", transport_mode = "all", fun = "mean", sf = FALSE, quiet = FALSE, force = FALSE, ... )l4h_travel_time( region, destination = "cities", transport_mode = "all", fun = "mean", sf = FALSE, quiet = FALSE, force = FALSE, ... )
region |
A spatial object defining the region of interest.
Can be an |
destination |
Character. Target destination for travel time.
Use |
transport_mode |
Character. Mode of transportation.
Use |
fun |
Character. Summary function to apply. Values include |
sf |
Logical. If |
quiet |
Logical. If TRUE, suppress the progress bar (default FALSE). |
force |
Logical. If |
... |
arguments of |
A spatial object containing the computed RAI value for the region in an
sf or tibble object.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
Weiss, D.J. et al. (2018). A global map of travel time to cities to assess inequalities in accessibility in 2015. Nature, 553(7688), 333–336. DOI: 10.1038/nature25181
Weiss, D.J. et al. (2020). Global maps of travel time to healthcare facilities. Nature Medicine, 26, 1835–1838. DOI: 10.1038/s41591-020-1059-1
if (interactive()) { library(land4health) ee_Initialize() # Define a bounding-box region in Ucayali, Peru region <- st_as_sf( st_sfc( st_polygon(list(matrix( c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE ))) ), crs = 4326 ) # Travel time to nearest healthcare facility (all modes) result_hosp_all <- l4h_travel_time(region = region) head(result_hosp_all) # Travel time to nearest healthcare facility (walking only) result_hosp_walk <- l4h_travel_time( region = region, destination = "healthcare", transport_mode = "walking_only") head(result_hosp_walk) # Mean travel time to nearest cities (mixed modes) result_city_mean <- l4h_travel_time( region = region, destination = "cities", fun = "mean") head(result_city_mean) # Sum of travel time to nearest cities result_city_sum <- l4h_travel_time( region = region, destination = "cities", fun = "sum") head(result_city_sum) }if (interactive()) { library(land4health) ee_Initialize() # Define a bounding-box region in Ucayali, Peru region <- st_as_sf( st_sfc( st_polygon(list(matrix( c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE ))) ), crs = 4326 ) # Travel time to nearest healthcare facility (all modes) result_hosp_all <- l4h_travel_time(region = region) head(result_hosp_all) # Travel time to nearest healthcare facility (walking only) result_hosp_walk <- l4h_travel_time( region = region, destination = "healthcare", transport_mode = "walking_only") head(result_hosp_walk) # Mean travel time to nearest cities (mixed modes) result_city_mean <- l4h_travel_time( region = region, destination = "cities", fun = "mean") head(result_city_mean) # Sum of travel time to nearest cities result_city_sum <- l4h_travel_time( region = region, destination = "cities", fun = "sum") head(result_city_sum) }
Computes the SUHI (Surface Urban Heat Island) index as the difference between the mean land surface temperature (LST) in urban and rural areas for each date in a user-defined region and time range.
l4h_urban_heat_index( from, to, region, band = "day", level = "strict", stat = "max", scale = 1000, sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_urban_heat_index( from, to, region, band = "day", level = "strict", stat = "max", scale = 1000, sf = TRUE, quiet = FALSE, force = FALSE, ... )
from |
Character or Date. Start date (format: |
to |
Character or Date. End date (format: |
region |
Spatial object ( |
band |
Character. |
level |
Character. |
stat |
Character. Aggregation statistic, e.g. |
scale |
Numeric. Resolution in meters. Default is |
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Extra arguments passed to |
A tibble or sf object with columns: date, variable = "SUHI", and value (°C).
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region (Ucayali, Peru) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Calculate SUHI using daytime LST (mean temperature difference) suhi_day <- l4h_urban_heat_index( from = "2020-01-01", to = "2020-12-31", region = region, band = "day", stat = "mean" ) head(suhi_day) # Calculate SUHI using nighttime LST (max difference) suhi_night <- l4h_urban_heat_index( from = "2020-01-01", to = "2020-12-31", region = region, band = "night", stat = "max" ) head(suhi_night) }if (interactive()) { library(land4health) ee_Initialize() # Define a bounding box region (Ucayali, Peru) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Calculate SUHI using daytime LST (mean temperature difference) suhi_day <- l4h_urban_heat_index( from = "2020-01-01", to = "2020-12-31", region = region, band = "day", stat = "mean" ) head(suhi_day) # Calculate SUHI using nighttime LST (max difference) suhi_night <- l4h_urban_heat_index( from = "2020-01-01", to = "2020-12-31", region = region, band = "night", stat = "max" ) head(suhi_night) }
Calculates the surface area (in km2) of urban, rural, or all settlement classes every 5 years between 1985 and 2030 using the GHS-SMOD R2023A dataset. This product applies the Degree of Urbanization methodology (Stage I) to the GHS-POP R2023A and GHS-BUILT-S R2023A layers. The function summarizes areas by category and year over the specified region.
l4h_urban_rural_area( region, category = "all", scale = 1000, sf = TRUE, quiet = FALSE, force = FALSE, ... )l4h_urban_rural_area( region, category = "all", scale = 1000, sf = TRUE, quiet = FALSE, force = FALSE, ... )
region |
An |
category |
Character. Settlement category to extract: |
scale |
Numeric. Spatial resolution (in meters) to use for area calculation (e.g., |
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
... |
Additional arguments passed to |
A tibble with estimated settlement area (in km2) by year and category.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
European Commission, Joint Research Centre (JRC). GHS Settlement Grid R2023A (1975–2030). Available at: https://data.jrc.ec.europa.eu/dataset/a0df7a6f-49de-46ea-9bde-563437a6e2ba#dataaccess
if (interactive()) { library(land4health) ee_Initialize() # Define region as a bounding box (Ucayali, Peru) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Extract surface area of urban category (in km2) urban_area <- l4h_urban_rural_area( category = "urban", region = region) head(urban_area) # Extract surface area of rural category (in km2) rural_area <- l4h_urban_rural_area( category = "rural", region = region) head(rural_area) # Extract total surface area (urban + rural) (in km2) all_area <- l4h_urban_rural_area( category = "all", region = region) head(all_area) }if (interactive()) { library(land4health) ee_Initialize() # Define region as a bounding box (Ucayali, Peru) region <- st_as_sf(st_sfc( st_polygon(list(matrix(c( -74.1, -4.4, -74.1, -3.7, -73.2, -3.7, -73.2, -4.4, -74.1, -4.4 ), ncol = 2, byrow = TRUE))), crs = 4326 )) # Extract surface area of urban category (in km2) urban_area <- l4h_urban_rural_area( category = "urban", region = region) head(urban_area) # Extract surface area of rural category (in km2) rural_area <- l4h_urban_rural_area( category = "rural", region = region) head(rural_area) # Extract total surface area (urban + rural) (in km2) all_area <- l4h_urban_rural_area( category = "all", region = region) head(all_area) }
Sets up the Python environment automatically based on installation.
l4h_use_python(envname = NULL, method = NULL, quiet = FALSE)l4h_use_python(envname = NULL, method = NULL, quiet = FALSE)
envname |
Character. Name of the Python environment. If NULL, uses saved config. |
method |
Character. Method to use ("auto", "virtualenv", "conda"). If NULL, uses saved config. |
quiet |
Logical. Suppress messages? Default FALSE. |
Invisibly returns NULL
if (interactive()) { l4h_use_python() l4h_use_python("r-land4health", "virtualenv") }if (interactive()) { l4h_use_python() l4h_use_python("r-land4health", "virtualenv") }
Computes monthly or annual areal statistics of vegetation indices
(NDVI, EVI, or SAVI) from MODIS MOD13A1 (500 m, 16-day composite)
for a given spatial region, applying quality filtering via the
DetailedQA bitmask.
l4h_vegetation( region, from, to, band = c("NDVI", "EVI", "SAVI"), by = c("month", "year"), fun = c("mean", "max", "min", "median", "sum", "sd", "first"), scale = 500, sf = FALSE, quiet = FALSE, force = FALSE )l4h_vegetation( region, from, to, band = c("NDVI", "EVI", "SAVI"), by = c("month", "year"), fun = c("mean", "max", "min", "median", "sum", "sd", "first"), scale = 500, sf = FALSE, quiet = FALSE, force = FALSE )
region |
An |
from |
Character. Start date in |
to |
Character. End date in |
band |
Character. Vegetation index to extract. One of |
by |
Character. Temporal aggregation unit. One of |
fun |
Character. Zonal statistic to compute over the region. One of
|
scale |
Numeric. Nominal scale in metres for the GEE projection.
Default: |
sf |
Logical. If |
quiet |
Logical. If |
force |
Logical. If |
MODIS MOD13A1 produces one composite every 16 days. This function aggregates those composites into a coarser temporal unit:
by = "month": All 16-day images within each calendar month
are reduced to a single image using max() (maximum value
composite), yielding one value per region per month.
by = "year": All 16-day images within each calendar year
are reduced to a single image using max(), yielding one value
per region per year.
The fun argument controls the spatial (zonal) statistic applied
over each region polygon, and is independent of the temporal aggregation.
Applied through the DetailedQA bitmask of MODIS/061/MOD13A1:
Bits 0-1: VI quality (value 2 = not produced/cloudy, excluded).
Bit 14: Adjacent cloud detected (excluded).
Bit 15: Possible shadow (excluded).
NDVI and EVI: multiplied by 0.0001.
SAVI: computed on-the-fly from surface reflectance bands
sur_refl_b01 (red) and sur_refl_b02 (NIR), L = 0.5.
A tibble (or sf tibble if sf = TRUE) in long format:
<id_cols>Original attribute columns from region.
dateDate object. First day of each month
(by = "month") or first day of each year (by = "year").
variableName of the vegetation index (e.g. "NDVI").
valueComputed zonal statistic for that region and period.
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to [email protected].
Follow us on:
if (interactive()) { library(land4health) library(geoidep) rgee::ee_Initialize(quiet = TRUE) provinces <- get_provinces(show_progress = FALSE) |> subset(nombdep == "LORETO") # Monthly mean NDVI result_monthly <- provinces |> l4h_vegetation( from = "2010-01-01", to = "2012-12-31", band = "NDVI", by = "month", fun = "mean", sf = TRUE ) head(result_monthly) # Annual mean NDVI result_annual <- provinces |> l4h_vegetation( from = "2010-01-01", to = "2020-12-31", band = "NDVI", by = "year", fun = "mean", sf = TRUE ) str(result_annual) }if (interactive()) { library(land4health) library(geoidep) rgee::ee_Initialize(quiet = TRUE) provinces <- get_provinces(show_progress = FALSE) |> subset(nombdep == "LORETO") # Monthly mean NDVI result_monthly <- provinces |> l4h_vegetation( from = "2010-01-01", to = "2012-12-31", band = "NDVI", by = "month", fun = "mean", sf = TRUE ) head(result_monthly) # Annual mean NDVI result_annual <- provinces |> l4h_vegetation( from = "2010-01-01", to = "2020-12-31", band = "NDVI", by = "year", fun = "mean", sf = TRUE ) str(result_annual) }