Skip to content

SafeStruct/GlobalRiskBridge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Global Geo-hazard Risk Assessment of Long-Span Bridges Enhanced with InSAR Availability

(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:)

Installation

There are two ways to use/install the repo. The first one is to use uv, and the other is conda.

With UV

First, install uv (see the uv documentation for details), for example:

curl -LsSf https://astral.sh/uv/install.sh | sh

Then 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 sync

By 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/osmconvert or update osm_convert_path in predict_PS_for_region.ipynb)
  • AWS CLI installation
  • wget is usually available via your system package manager (for example: sudo apt-get install wget on Debian/Ubuntu-based systems)

With Conda

# will create a venv called globalbridge
conda env create -f environment.yml
# activate  the environment
conda activate globalbridge

NOTES:

  • Still need to download and compile the osmconvert CLI 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 osmconvert in here you need to update the osm_convert_path in predict_PS_for_region.ipynb from /usr/bin/osmconvert to ../../osmconvert

Usage

  1. PS predictions
  1. 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
  1. 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.

License

MIT

Acknowledgements

This project is funded by the Vidi project InStruct (project number 18912), financed by the Dutch Research Council (NWO).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 95.7%
  • Python 4.3%