Quantifying and mapping population exposure to risks in Gaza
This repository contains the R workflows used to build the Gaza spatial geodatabase and related analytical outputs. The current focus is Output 1: a GeoPackage-based geodatabase that combines gridded population estimates, UNOSAT layers, and OCHA reference layers. All required inputs are first copied into the local wd/in tree so the analysis scripts do not depend on mutable source paths.
src/00_stage_inputs.R: stages only the required input files intowd/inand refreshes that curated manifestsrc/10_geodatabase.R: builds the geodatabase GeoPackagesrc/10_helpers.R: shared helper functions for the geodatabase workflowsrc/20_flood_affected.R: example (draft) downstream analysis for flood-affected population summariesrequired.R: R package installation helperrequired.sh: Linux system dependency helperexample_env: template for the local.envfileLICENSE: GPL-3 license text
The main geodatabase build script assembles a single GeoPackage containing:
- NowPop rasters for multiple dates
- UNOSAT tent mapping point layers
- UNOSAT damage, flood risk, and storm surge layers
- OCHA governorate, municipality, neighbourhood, and exclusion zone layers
- A
data_cataloguelayer with metadata for each delivered layer
- Create a local
.envfile based onexample_envand setwdto a working directory on your machine. - Run
src/00_stage_inputs.Rto copy the required source data intofile.path(wd, "in"). The script only stages the files needed by the geodatabase build. - Install R packages from
required.Rand the system libraries listed inrequired.sh.
A typical workflow is:
source("required.R")and, on Linux, install the system packages listed in required.sh before running the scripts.
Run src/10_geodatabase.R to build the deliverable GeoPackage. The script writes the output to:
out/geodatabase/gaza_geodatabase.gpkg
The script starts from a clean output file each time it runs and reads only from the staged wd/in tree.
- Layer names are source-first, for example
unocha_...,unosat_..., andrealgood_.... - The local input tree is organized by source under
wd/in(for exampleNowPop,Gazatents,OCHA, andUNOSAT) and is refreshed from a manifest of required files. - Catalogue rows record
layer_name,reference_date,data_type,source,sensitivity_classification,classification_scheme, andsource_url. - Raster layers are written as GeoPackage raster subdatasets with a float32 data type and a fixed no-data value.
src/20_flood_affected.R shows the next-stage workflow for extracting totals and ratios from gridded population and shelter surfaces over administrative boundaries. It is not part of the geodatabase build itself, but it uses the same local data conventions.
Copyright (c) 2026 Real Good Research Ltd.
This project is licensed under the GNU General Public License v3.0. See LICENSE.