# Zambia HFCA Voronoi Mapping Tool
A Shiny app for creating health-facility catchment area (HFCA) incidence maps
and district-level access-to-care estimates from a facility list. It is set up
for Zambia, with bundled administrative boundaries and access layers; users can
also upload another boundary dataset.
## Run locally
You need R 4.6.0 (the version recorded in `renv.lock`) and the system libraries
required by spatial R packages such as `sf` and `terra`.
```sh
git clone
github.com
cd zambia-hfca-voronoi-app
Rscript -e 'install.packages("renv"); renv::restore()'
Rscript -e 'shiny::runApp(".")'
```
The final command opens the app in a browser. In RStudio, open the project,
allow `renv` to activate, restore packages if prompted, then select **Run App**.
## Using the app
1. On **Data & quality**, select the bundled Zambia boundaries or upload a
boundary file, then upload a CSV or Excel facility list.
2. Confirm the detected column mapping and review the quality checks.
3. On **Map & downloads**, choose a scope and run the tessellation.
4. Download a map, spatial file, RDS, CSV summary, or a ZIP containing all
outputs. The **Access to care** tab creates a district-level walking-time
analysis.
Required facility fields are a unique ID, facility name, longitude, latitude,
total malaria cases, and catchment population. Province, district, and facility
type are optional. Use the app's example-template download for the expected
format.
Uploaded facility data is processed only for the active session and is not
bundled with the app. The example data is synthetic.
## Repository contents
- `app.R` and `R/` — Shiny app and processing code.
- `inst/extdata/` — bundled Zambia boundaries, population and friction layers,
and the synthetic example template.
- `www/` — partner logos.
- `renv.lock` — pinned R package versions.
## Checks
Run the test suite after restoring the project packages:
```sh
Rscript -e 'testtha …