Logo Lanfrica

Pivot-Madagascar/vatovavy-site-optimization

Domain:

healthcaregeospatial
Creator:
Piv
Host:
Code and data used to identify optimal site placement for communtiy health sites in Vatovavy region # Vatovavy Site Optimisation This repo contains the code needed to run the Community Health Site optimization algorithm developed in Evans et al. (YEAR) for Ifanadiana district and run it for the two new districts that Pivot covers in Vatovavy (Nosy Varika and Mananjary). For each district, it: 1. Creates estimated "catchments" of community health sites equivalent to Voronoi polygons around the Chef Lieu de Fokontany. This is necessary because we do not have polygons that correspond to the updated 2025 fokontany boundaries, and these voronoi polygons then approximate those fokontany boundaries. 2. Combines the data on residential zones and buildings to estimate the number of buildings for each residential zone. 3. Estimates the distance between each residential zone in a fokontany to identify that which is most central to the other residential zones 2. Creates a ranked list of the top 5 options for a community health site in each catchment (e.g. fokontany) based on the distance to building within residential zones in that catchment along the transportation network # Installation ## Requirements - R > v. 4.4 - `docker` ## R Packages Run the following script to install the required R packages. ``` lapply(c("sf", "terra", "dplyr", "osrm", "tidyr), install.packages) ``` ## OSRM Backend We use the osrm-backend found here: github.com. Following recommendations, we use the docker version. To set up the backend server, place the `pbf` file of OSM data into a directory called `osrm`. In the example below, the file is called `osm_mapping_pivot.pbf`. Then run the following code to extract and create the routing files needed. This only needs to be done one time. ``` #start docker from osrm directory cd osrm #run once, creates the files needed docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/foot.lua /data/osm_mapping_pivot.pbf docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/osm_mapping_p …