
Extract malaria metrics from the Malaria Atlas Project GeoServer
Source:R/l4h_malaria.R
l4h_malaria.RdDownloads 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.
Usage
l4h_malaria(
from,
to,
species = "pf",
measure = "incidence_rate",
region,
stat = "mean",
sf = TRUE,
quiet = FALSE,
force = FALSE,
...
)Arguments
- from
Integer. Start year.
- to
Integer. End year. Must be >=
from.- species
Character. One of
"pf"(Plasmodium falciparum) or"pv"(Plasmodium vivax). Default"pf".- measure
Character. One of
"incidence_rate","incidence_count","parasite_rate","mortality_rate","mortality_count". Default"incidence_rate".- region
Spatial object defining the region of interest. Accepts an
sf,sfc, orSpatVectorobject.- stat
Character. Summary statistic per pixel per year. One of
"mean","median","min","max". Default"mean".- sf
Logical. If
TRUE, returns ansf; ifFALSE, returns atibble. DefaultTRUE.- quiet
Logical. If
TRUE, suppresses progress messages. DefaultFALSE.- force
Logical. If
TRUE, skips the representativity check. DefaultFALSE.- ...
Additional arguments (currently unused).
Value
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 ifsf = TRUE, and any attributes fromregion.
Details
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.
Credits
Pioneering geospatial health analytics and open-science tools. Developed by the Innovalab Team. For more information, send an email to imt.innovlab@oficinas-upch.pe.
Follow us on:
References
Malaria Atlas Project. https://malariaatlas.org/
Examples
# \donttest{
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)
}
# }

