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.
Usage
l4h_rural_access_index(
region,
weighted = FALSE,
fun = NULL,
sf = FALSE,
quiet = FALSE,
force = FALSE,
...
)
Arguments
- region
A spatial object defining the region of interest. Can be an
sf
,sfc
object, or aSpatVector
(from the terra package).- weighted
Logical. If
TRUE
, computes a population-weighted RAI (i.e., rural population with access divided by total rural population). IfFALSE
, computes an area-based RAI (i.e., total pixel area with access divided by total rural area). Default isFALSE
.- fun
Character. Summary function to apply to the population raster when
weighted = TRUE
. Common values include"mean"
,"sum"
, etc. Ignored whenweighted = FALSE
. Default is"mean"
.- sf
Logical. If
TRUE
, returns the result as ansf
object. IfFALSE
, returns an Earth Engine object. Default isFALSE
.- quiet
Logical. If TRUE, suppress the progress bar (default FALSE).
- force
Logical. If
TRUE
, skips the representativity check and forces the extraction. Default isFALSE
.- ...
arguments of
ee_extract
ofrgee
packages.
Details
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 roadsprojects/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 km²) with access
divided by the total rural area.
The fun
parameter only applies when weighted = TRUE
. It will be ignored otherwise.
References
GEE Community Catalog: https://gee-community-catalog.org/projects/rai
Frontiers in Remote Sensing (2024): doi:10.3389/frsen.2024.1375476
Examples
if (FALSE) { # \dontrun{
library(land4health)
ee_Initialize()
# Population-weighted RAI
l4h_rural_access_index(region, weighted = TRUE, fun = "sum", sf = TRUE)
# Area-based RAI
l4h_rural_access_index(region, weighted = FALSE, sf = TRUE)
} # }