Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.
Mike Fabrikant edited this page Oct 17, 2017 · 66 revisions

Welcome to the Magic Box wiki!

Magic Box serves various kinds of data aggregated by administrative boundaries. In addition to Zika case data by country from Paho, the API also serves population, and mosquito prevalence by the highest admin level available at gadm.org.

Each data value comes with an admin ID. An admin ID points to a specific shape in shapefile that represents an individual country. These shapefiles can all be found at gadm.org.

Screenshot

Here are three shape files for Afghanistan:

For example: bra_33_19_3630_gadm2–8 means the 3630'th admin 2, which belongs to the 19th admin 1, in the thirty third shapefile (one per country) of the gadm2.8 series. The iso code, ‘bra’, is just for spot checking.

General Setup

vm

sudo apt-get update
ssh-keygen -t rsa

Installing GDAL/OGR on Ubuntu

sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
sudo apt-get install gdal-bin

nvm

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

node

nvm install 6

java

sudo add-apt-repository -y ppa:webupd8team/java   
sudo apt-get update
sudo apt-get -y install oracle-java8-installer

Postgres

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install postgis*
sudo -i -u postgres
CREATE USER user_name SUPERUSER;

Download shapefiles from gadm.org and import to postgres.

Downloads, imports, and aggregates country specific population rasters from worldpop.

Need to update all repos below this point.
  • Assigns admin regions to airports
  • by querying an api that takes lat/lon and returns an admin.
  • Airport is then indexed by elasticsearch

Mobility

Clone this wiki locally