An open API service indexing awesome lists of open source software.

https://github.com/harmonize-tools/land4health

Extract remote sensing metrics for spatial health analysis 🛰️, integrating vector-borne disease data. Easily compute areal and zonal statistics for infectious disease modelling in spatial epidemiology 🦠🏥
https://github.com/harmonize-tools/land4health

geography geohealth harmonize health-geography innovalab rgee rspatial spatial-epidemiology zonal-statistics

Last synced: 5 months ago
JSON representation

Extract remote sensing metrics for spatial health analysis 🛰️, integrating vector-borne disease data. Easily compute areal and zonal statistics for infectious disease modelling in spatial epidemiology 🦠🏥

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# land4health: Remote Sensing Metrics for Spatial Health Analysis

[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/harmonize-tools/land4health/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/harmonize-tools/land4health/actions/workflows/R-CMD-check.yaml)
[![HTML-Docs](https://img.shields.io/badge/docs-HTML-informational)](https://harmonize-tools.github.io/land4health/)
[![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
[![test-coverage.yaml](https://github.com/harmonize-tools/land4health/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/harmonize-tools/land4health/actions/workflows/test-coverage.yaml)
[![Codecov test coverage](https://codecov.io/gh/harmonize-tools/land4health/graph/badge.svg)](https://app.codecov.io/gh/harmonize-tools/land4health)

Calculate and extract remote sensing metrics for spatial health analysis 🛰️.
This package offers R users a quick and easy way to obtain areal or zonal statistics of key indicators and covariates, ideal for modeling infectious diseases 🦠 within the framework of spatial epidemiology 🏥.

## 1. Installation

You can install the development version with:
```r
# install.packages("pak")
pak::pak("harmonize-tools/land4health")
```

```{r message=FALSE,warning=FALSE}
library(land4health)
l4h_install()
```

```{r message=FALSE,warning=FALSE}
l4h_use_python()
rgee::ee_Initialize(quiet = TRUE)
```

```r
── Welcome to land4health ────────────────────────────────────────────────────
A tool of Harmonize Project to calculate and extract Remote Sensing Metrics
for Spatial Health Analysis. Currently,`land4health` supports metrics in the
following categories:
• Accesibility
• Climate
• Enviroment
• and more!
For a complete list of available metrics, use the `l4h_list_metrics()`
function.

──────────────────────────────────────────────────────────────────────────────
Attaching core land4health packages:
→ rgee v1.1.7
→ sf v1.0.21
```
## 2. List of available metrics

```{r}
l4h_list_metrics()
```

## 3. Example: Calculate Forest Loss in a Custom Region

This example demonstrates how to calculate forest loss between 2005 and 2020 using a custom polygon and Earth Engine.

```{r example, message=FALSE, warning=FALSE}
library(geoidep)

# Downloading the adminstration limits of Loreto provinces
provinces_loreto <- get_provinces(show_progress = FALSE) |>
subset(nombdep == "LORETO")

# Run forest loss calculation
result <- provinces_loreto |>
l4h_forest_loss(from = '2005-01-01', to = '2020-01-01', sf = TRUE)
head(result)
```

```{r area,fig.dpi=300, fig.height= 5,fig.width= 12}
# Visualization with ggplot2
library(ggplot2)
ggplot(data = st_drop_geometry(result), aes(x = date, y = value)) +
geom_area(fill = "#FDE725FF", alpha = 0.8) +
facet_wrap(~nombprov) +
theme_minimal()
```

```{r mapa,fig.dpi=300, fig.height= 14,fig.width= 15}
# Spatial visualization
ggplot(data = result) +
geom_sf(aes(fill = value), color = NA) +
scale_fill_viridis_c(name = "Forest loss mean \n(km²)") +
theme_minimal(base_size = 15) +
facet_wrap(date ~ .)
```

## 4. Example: Extract time series of climate variables

```{r,message=FALSE, warning=FALSE}
etp_ts <- provinces_loreto |>
l4h_sebal_modis(
from = "2005-01-01",
to = "2022-12-31",
by = "month"
)
```

```{r ts,fig.dpi=300, fig.height= 5,fig.width= 12}
etp_ts |>
st_drop_geometry() |>
ggplot(aes(x = date, y = value, col = value)) +
geom_line() +
scale_color_viridis_c("ETP (mm)",option = "viridis") +
theme_minimal() +
facet_wrap(~nombprov, ncol = 4)
```