unicef/magicbox-download-shapefiles

Name: magicbox-download-shapefiles

Owner: unicef

Description: Downloads shapefiles for each country from gadm.org and unzips them.

Created: 2017-10-24 17:35:17.0

Updated: 2018-04-17 18:46:18.0

Pushed: 2018-04-17 18:46:16.0

Homepage: null

Size: 83

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

magicbox-download-shapefiles

Chat on Gitter License

Component of MagicBox

About

MagicBox uses various shapefiles from different datasets to support MagicBox's purpose. This repository downloads all zipped shape files from a primary source, Global Administrative Areas Database (GADM) and unzips them.

If you're using this repo, you likely want to use magicbox-import-shapefiles to import the shapefiles into a PostgreSQL database.

How it works

This downloads zipped shapefiles from GADM to:

./data/zipfiles/

?and unzips them to:

./data/shapefiles/gadm2-8/

Installation

Use Docker to build this image and run the downloader. These steps assume you have a working Docker installation. If not, review the Docker documentation first.

Build image, create volume

Create a config.js file based in config-sample.js

onfig-sample.js config.js

Build this image locally on your machine with this command.

er build -t unicef/download-shapefiles .

This builds the Docker image locally on your machine.

Next, create a volume. A volume is a shared data volume we use across multiple containers. We'll use it again later in the magicbox-import-shapefiles repo.

er volume create --name shapefiles_dbvolume
Run image

Now you can run the image. Start up the image with this command (it will use the volume we created in the previous step to hold the data).

er run --rm -it -v shapefiles_dbvolume:/app/magicbox-download-shapefiles/data:z unicef/download-shapefiles

You should see output like this:

loading AFG
t to write zip to file
 saved.
n store to unzip AFG
...
]
Legal

License

This project is licensed under the BSD 3-Clause License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.