kartoza / geocris-inasafe-fba

Next generation of InaSAFE that includes support for forecast based action
MIT License
1 stars 1 forks source link

Add changes for boundary and population ingester #38

Closed lucernae closed 3 years ago

lucernae commented 4 years ago

Work in Progress

We are attempting to ingests data from GeoCRIS table or features for admin boundaries and population automatically

List of todos:

lucernae commented 4 years ago

Setup steps to test new changes:

Use hardcoded CDEMA boundaries

In deployment/env fill in option:

DEFAULT_INITIAL_MAP_BOUNDS=[[-6.656216214,-107.546395306],[42.506191841,-46.020831507]]

Generate mapfile

from deployment

make down up mapserver-generate-mapfile

Apply db changes

from deployment

make backend-schema-test backend-populate-test-data

If you need to retrieve GeoCRIS GeoJSON collections

Must be done in order:

From mapserver dir:

make up django-shell
# or if you are in dev mode
make up django-dev-shell

From inside the container, run management command:

./manage.py ingest_boundary_data
./manage.py ingest_building_data
./manage.py ingest_road_data

Each of the management command might take some time to complete, so it's better if you use separate terminal for each. At least boundary needs to be fetched first. Building and road can be in parallel.

Fetch latest hazard

From mapserver dir:

make up django-shell
# or if you are in dev mode
make up django-dev-shell

From inside the container, run management command:

./manage.py ingest_hazard_data

If the hurricane is not in our test area, move the hurricane using QGIS for testing the intersections.

From the db (psql shell), run:

select kartoza_calculate_impact()

to redo the calculations.

lucernae commented 3 years ago

It's done and I'm going to merge it.