Skip to content

bartromgens/climatemaps

Repository files navigation

climatemaps

An interactive web application for visualizing global historical climate data and future climate projections. It show temperature, precipitation, and other climate variables with support for multiple climate scenarios (SSP1-2.6, SSP2-4.5, SSP3-7.0, SSP5-8.5) and time periods (2020-2100).

Precipitation predictions example

Demo

openclimatemap.org

Data

Historic

Projections (predictions)

Other (not used)

Development

Dependencies

GDAL

GDAL is needed for the gdal2tiles.py script that creates map-tiles from a single image (matplotlib plot).

Install GDAL with conda to prevent the need to install a hugh number of system level dependencies:

conda install -c conda-forge gdal==3.11.0
Tippecanoe

WARNING: tippecanoe 1.19.1 is the latest version that produces valid GeoJSON due to issue mapbox/tippecanoe#652

TODO: migrate to active fork https://github.com/felt/tippecanoe

sudo apt install libsqlite3-dev
git clone https://github.com/mapbox/tippecanoe.git
cd tippecanoe
git checkout tags/1.19.1
make -j
make install

tileserver-gl

npm install -g tileserver-gl

Run

Create contour data

Run:

python scrips/create_contour.py

to create contour and raster mbtiles.

Create tileserver config

python scripts/create_tileserver_config.py

to generate the tileserver config.

Run the backend (FastAPI server)

uvicorn api.main:app --reload

Run the tileserver (tileserver-gl)

tileserver-gl --config tileserver_config_dev.json --port 8080

Run the client (Angular)

In ./client run:

ng serve

Or run against the openclimatemap.org API and tileserver:

ng serve --configuration=production-backend

Tests

Run:

pytest

Build and deploy (to openclimatemap.org)

Everything

Build and deploy client and backend:

bash scripts/deploy.sh

TODO: include create tiles, create config and upload tiles

Client

Deploy the client angular app:

bash scripts/deploy_client.sh

API and TileServer

bash scripts/deploy_backend.sh

Upload tiles (optional)

If you have locally created tiles, upload them to the server with:

rsync -avP data/tiles openclimatemap.org:/home/bart/climatemaps/data/

About

Global monthly climate data, historic and predictions, on an interactive map

Topics

Resources

License

Stars

Watchers

Forks