(DOI:)
This repository contains code required to reproduce results for the paper entitled "Global geo-hazard risk assessment of long-span bridges enhanced with InSAR availability" published in Nature Communications (DOI:)
There are two ways to use/install the repo. The first one is to use uv, and the other is conda.
First, install uv (see the uv documentation for details), for example:
curl -LsSf https://astral.sh/uv/install.sh | shThen use uv to create and install the Python environment with the dependencies specified in pyproject.toml:
# Install all dependencies and create a `.venv` automatically in the project
uv syncBy default, uv sync creates a .venv in the repository root and installs all dependencies there.
To activate this environment:
-
Linux/macOS:
source .venv/bin/activate
The example commands below (e.g. ../.venv/bin/python ...) assume this default layout.
The code also requires osmconvert, AWS CLI, and wget to be installed for downloading and processing the required datasets. Installation instructions can be found here:
- osmconvert installation (note: install in
/usr/bin/osmconvertor updateosm_convert_pathinpredict_PS_for_region.ipynb) - AWS CLI installation
wgetis usually available via your system package manager (for example:sudo apt-get install wgeton Debian/Ubuntu-based systems)
# will create a venv called globalbridge
conda env create -f environment.yml
# activate the environment
conda activate globalbridgeNOTES:
- Still need to download and compile the
osmconvertCLI tool. The code below downloads and compiles the source code, generating the executable in the current directory.
wget -O - http://m.m.i24.cc/osmconvert.c | cc -x c - -lz -O3 -o osmconvert- If you followed the installation procedure for the
osmconvertin here you need to update theosm_convert_pathinpredict_PS_for_region.ipynbfrom/usr/bin/osmconvertto../../osmconvert
- PS predictions
- ps_predictions/predict_PS_dens.ipynb can be used to generate PS predictions for small regions
- the notebook is set up to automatically produce predictions over an area in Southern Poland, but can be modified to another region in the world
- However, as those can be quite time-consuming, subsequent steps make use of already produced PS predictions that can be downloaded from the data repository on Zenodo (Global Geo-hazard Risk Assessment of Long-Span Bridges Enhanced with InSAR Availability - research data)
-
Risk calculations
Note: It requires the long-span bridges database CSV file, available on request from the authors of the associated paper. The dataset should be placed in data/bridge_db. If this is not found, the script will use the example data with a subset of five bridges from the db.
Other required datasets should be downloaded to the data folder from zenodo repository. This can be done with zenodo_get from the command line:
cd data zenodo_get 10.5281/zenodo.15797029 for z in *.zip; do unzip "$z"; done cd ..
- First, the raw bridge database should be processed with risk_assessment/bridges_db/process_bridges_db.py to identify bridge shapes. The processing might take quite a lot of time if run for the full bridges database. However, it can be run with the example dataset
PYTHONPATH=src python -m risk_assessment.bridges_db.process_bridges_db- Then, once the bridge geometries are generated, they should be divided into segments with risk_assessment/bridges_db/divide_into_segments.py
PYTHONPATH=src python -m risk_assessment.bridges_db.divide_into_segments- Next, zonal statistics regarding PS availability, Sentinel availability, hazards, exposure and vulnerability should be generated with:
PYTHONPATH=src python -m risk_assessment.bridges_db.get_zonal_stats_from_bridge_lines- Finally, data can be analysed with the following code to produce final risk scores
PYTHONPATH=src python -m risk_assessment.risk_calculation.lsb_risk_analysis- To get source data for plots, the following should be run:
PYTHONPATH=src python -m risk_assessment.risk_calculation.plots_source_data_generation- Paper figures
To reproduce plots from the paper, one can use the src/plots_for_paper/generate_plots.ipynb notebook. It makes use of the plots' source data published in zenodo repository, but the data can be reproduced with the risk calculation scripts.
This project is funded by the Vidi project InStruct (project number 18912), financed by the Dutch Research Council (NWO).