This project provides interactive data visualisations of risk analysis results.
The tool presents the infrastructure systems and hazards considered in the analysis, then presents results as modelled for the whole system at a fine scale.
See an overview of infrastructure networks:
Other functionality:
This README covers requirements and steps through how to prepare data for visualisation and how to run the tool.
The visualisation tool runs using prepared versions of analysis data and results:
See ./etl
directory for details.
Running the application requires several (local) server processes: the vector and raster tileservers, the app backend, and the app frontend.
The build and run steps use node.js - this provides the
npm
command.
Install required packages. Run from the project root:
npm install
Install the raster tileserver - Terracotta
For example, installing using conda:
conda create --name infrariskvis python=3.8 numpy rasterio shapely crick
conda activate infrariskvis
pip install terracotta[recommended]
Run the tileserver directly (from the root of the project):
npm run vector
Prepare the raster tileserver database:
npm run raster-init
Run the raster tileserver:
npm run raster
docker run \
--rm \
-it \
--workdir / \
--mount type=bind,source="$(pwd)"/tileserver/raster/data,target=/data \
jamaica-raster-tileserver:latest \
terracotta ingest "/data/{type}__rp_{rp}__rcp_{rcp}__epoch_{epoch}__conf_{confidence}.tif" -o /data/terracotta.sqlite
Two options here.
Without docker, follow the notes in ./backend/README.md
to setup a development
environment for python.
Set up a postgres database and add connection details in ./backend/.env
.
Run the api server:
cd ./backend
pipenv run uvicorn backend.app.main:app --host localhost --port 8888
Alternatively, run docker-compose
to run the API server in one container and
postgres in another.
docker compose -f docker-compose.dev.yml up db -d
PGPORT=25432 \
PGHOST=localhost \
PGUSER=docker \
PGPASSWORD=docker \
PGDATABASE=jamaica \
pg_restore -cC -j 8 -d jamaica ./archive/jamaicadev_2023-05-16.dump
Start the app server:
npm start
This should automatically open a browser tab. If not, open:
firefox http://localhost:3000/
See ./deploy
directory for details.
This tool has been developed through several projects.