ThinkHazard!

Provides a general view of the hazards, for a given location, that should be considered in project design and implementation to promote disaster and climate resilience.
https://github.com/GFDRR/thinkhazard

Category: Climate Change
Sub Category: Natural Hazard and Storms

Keywords from Contributors

openlayers geomapfish geotools jasperreports ogc reporting corse mapstore geojson

Last synced: about 3 hours ago
JSON representation

Repository metadata

ThinkHazard!

README.md

ThinkHazard

A natural hazard screening tool for disaster risk management project planning. ThinkHazard! is maintained by the Global Facility for Disaster Reduction and Recovery (GFDRR). Provides classified hazard level (very low to high) for any location in the world, and advice on managing disaster risk, plus useful reports and contacts, for 11 natural hazards.

API instructions can be found here: https://github.com/GFDRR/thinkhazard/blob/master/API.md

Getting Started

The following commands assume that the system is Debian/Ubuntu. Commands may need to be adapted when working on a different system.

Build docker images:

make build

Run the composition:

docker compose up -d
make initdb

Now point your browser to http://localhost:8080.

Run checks and automated tests:

make check test

Populate the admin database

Create the required schema and tables and populate the tables in admin database:

GPKG=path_to_geopackage_file make populatedb

Note: this may take a while. If you don’t want to import all the world administrative divisions, you can import only a subset:

GPKG=path_to_geopackage_file make populatedb DATA=turkey

or:

GPKG=path_to_geopackage_file make populatedb DATA=indonesia

Publication of admin database on public site

Publication consist in overwriting the public database with the admin one. This can be done using:

make publish

And this will execute as follow :

  • Lock the public site in maintenance mode.
  • Store a publication date in the admin database.
  • Backup the admin database in archives folder.
  • Create a new fresh public database.
  • Restore the admin backup into public database.
  • Unlock the public site from maintenance mode.

Configure admin username/password

Authentication is based on environment variable HTPASSWORDS which should contain
usernames and passwords using Apache htpasswd file format.

To create an authentification file .htpasswd with admin as the initial user:

htpasswd -c .htpasswd admin

It will prompt for the passwd.

Add or modify username2 in the password file .htpasswd:

htpasswd .htpasswd username2

Then pass the content of the file to environment variable:

environment:
  HTPASSWORDS: |
    admin:admin
    user:user

Analytics

If you want to get some analytics on the website usage (via Google analytics), you can add the tracking code using an analytics variable:

environment:
  ANALYTICS: UA-75301865-1

Feedback

The feedback_form_url can be configured in the production.ini file.

Translations

ThinkHazard! is translated using Transifex.

Workflow

We use lingua to extract translation string from jinja2 templates.

Use the following command to update the gettext template (.pot):

make extract_messages

Note: this should be done from the production instance ONLY in order to have
the up-to-date database strings extracted!
You will have to make sure that the ~/.transifexrc is valid and the
credentials correspond to the correct rights.

Then you can push the translation sources to transifex.

make transifex-push

Once the translations are OK on Transifex it's possible to pull the translations:

make transifex-pull

Don't forget to compile the catalog (ie. convert .po to .mo):

make compile_catalog

Development

There are 3 different ways to translate strings in the templates:

  • translate filter

    This should be used for strings corresponding to enumeration tables in
    database.

    {{ hazard.title | translate }}
    
  • gettext method

    To be used for any UI string.

    {{gettext('Download PDF')}}
    
  • model class method

    Some model classes have specific method to retrive the value from a field
    specific to chosen language.

    {{ division.translated_name(request.locale_name)}}
    

Debugging with VS Code

Copy content of docker-compose.override.sample.yaml to docker-compose.override.yaml.

Then here is an example .vscode/launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Remote Attach Thinkhazard",
            "type": "debugpy",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5678
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "/app"
                }
            ]
        },
        {
            "name": "Python Debugger: Remote Attach Taskrunner",
            "type": "debugpy",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5679
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "/app"
                }
            ]
        },
        {
            "name": "Python Debugger: Remote Attach Tests",
            "type": "debugpy",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5680
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "/app"
                }
            ]
        }
    ]
}

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 8 days ago

Total Commits: 1,303
Total Committers: 18
Avg Commits per committer: 72.389
Development Distribution Score (DDS): 0.672

Commits in past year: 121
Committers in past year: 4
Avg Commits per committer in past year: 30.25
Development Distribution Score (DDS) in past year: 0.504

Name Email Commits
Pierre GIRAUD p****d@c****m 427
arnaud.morvan@camptocamp.com a****n@c****m 324
Antoine Abt a****e@a****m 208
Éric Lemoine e****e@g****m 121
Tobias Kohr t****r@c****m 41
Ronit Jadhav r****v@c****m 40
François Van Der Biest f****t@c****m 40
Stuart Fraser s****1@g****m 37
Mattia Amadio 4****o 19
marionb m****r@c****m 19
Julien Acroute j****e@c****m 8
Javier Daza j****s@g****m 5
dependabot[bot] 4****] 4
tsauerwein t****n@c****m 4
Mattia Amadio 4****C 3
Marion Baumgartner m****r@i****l 1
Arnaud Morvan a****n@g****m 1
Ariel Núñez i****l@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 14 days ago

Total issues: 73
Total pull requests: 92
Average time to close issues: over 3 years
Average time to close pull requests: 5 months
Total issue authors: 9
Total pull request authors: 8
Average comments per issue: 3.53
Average comments per pull request: 0.59
Merged pull request: 68
Bot issues: 0
Bot pull requests: 8

Past year issues: 23
Past year pull requests: 23
Past year average time to close issues: 6 months
Past year average time to close pull requests: 2 days
Past year issue authors: 2
Past year pull request authors: 4
Past year average comments per issue: 2.65
Past year average comments per pull request: 0.43
Past year merged pull request: 9
Past year bot issues: 0
Past year bot pull requests: 2

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/GFDRR/thinkhazard

Top Issue Authors

  • matamadio (32)
  • stufraser1 (26)
  • vdeparday (5)
  • pzwsk (5)
  • pgiraud (1)
  • martyclark (1)
  • arnaud-morvan (1)
  • ingenieroariel (1)
  • EceOzen (1)

Top Pull Request Authors

  • arnaud-morvan (51)
  • tkohr (15)
  • ronitjadhav (9)
  • dependabot[bot] (8)
  • tonio (5)
  • matamadio (2)
  • stufraser1 (1)
  • pgiraud (1)

Top Issue Labels

  • 1stpriority (17)
  • enhancement (8)
  • 2ndpriority (8)
  • v3 potential (8)
  • 3rdpriority (4)
  • Support (2)
  • data issue (1)
  • bug (1)
  • question (1)

Top Pull Request Labels

  • dependencies (8)
  • javascript (4)

Package metadata

proxy.golang.org: github.com/gfdrr/thinkhazard

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/gfdrr/thinkhazard#section-documentation
  • Licenses: gpl-3.0
  • Latest release: v2.0.10+incompatible (published about 8 years ago)
  • Last Synced: 2026-04-07T02:02:05.520Z (8 days ago)
  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 5.395%
    • Average: 5.576%
    • Dependent repos count: 5.758%
proxy.golang.org: github.com/GFDRR/thinkhazard

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/GFDRR/thinkhazard#section-documentation
  • Licenses: gpl-3.0
  • Latest release: v2.0.10+incompatible (published about 8 years ago)
  • Last Synced: 2026-04-07T02:02:05.948Z (8 days ago)
  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 5.395%
    • Average: 5.576%
    • Dependent repos count: 5.758%

Dependencies

package.json npm
  • bootlint ~0.11.0
  • bootstrap 3.3.7
  • casperjs ~1.1.4
  • d3 ~3.5.16
  • d3-geo-projection ~0.2.16
  • font-awesome ~4.5.0
  • jquery ~3.3.1
  • jshint ~2.5.1
  • leaflet ~0.7.7
  • less ~1.7.5
  • openlayers ~4.0.1
  • topojson ~1.6.24
  • typeahead.js ~0.11.1
requirements-dev.txt pypi
  • WebTest * development
  • coverage * development
  • flake8 * development
  • mock * development
  • nose * development
  • pep8-naming * development
  • pydevd * development
requirements.txt pypi
  • APScheduler *
  • Babel *
  • PyPDF2 *
  • SQLAlchemy *
  • alembic *
  • asyncio *
  • boto3 *
  • celery *
  • colorlog *
  • geoalchemy2 *
  • gunicorn *
  • httplib2 *
  • jinja2 *
  • lingua *
  • markdown *
  • papyrus *
  • passlib *
  • paste *
  • psycopg2 *
  • pyppeteer *
  • pyproj *
  • pyquery *
  • pyramid <2
  • pyramid_debugtoolbar *
  • pyramid_jinja2 *
  • pyramid_tm *
  • python-slugify <2.0.0
  • pytidylib *
  • pyyaml *
  • rasterio *
  • redis *
  • requests *
  • requests_futures *
  • secure <1,>=0.3
  • shapely *
  • simplejson *
  • transaction *
  • transifex-client *
  • waitress *
  • zope.sqlalchemy *
.github/workflows/ci.yaml actions
  • actions/checkout v3 composite
Dockerfile docker
  • base latest build
  • python 3.8-slim-buster build
docker/testdb/Dockerfile docker
  • camptocamp/postgres 12 build
setup.py pypi

Score: -Infinity