Skip to content

Commit

Permalink
update pipe to add/del input data on run, add some additions to docum…
Browse files Browse the repository at this point in the history
…entation
  • Loading branch information
maxgrossman committed Sep 26, 2017
1 parent 2bba1a3 commit e45bc22
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ a pipeline to take vietnam admin unit shapefiles and insert them as postgis tabl

### install

#### node packages
`$ yarn install`

### configuration
#### s3 cli
`$ pip install awscli`

### docker
[mac](https://docs.docker.com/docker-for-mac/install/#where-to-go-next)
[pc](https://docs.docker.com/docker-for-windows/install/)

#### data

create a folder `./data/input` and add in the necessary `vietnam-communes.shp` file and its related files
create a folder `./data/input`. the pipeline handles downloading data from s3.

#### database

add a a file `./db/local/index.js` of the following spec
add a file `./db/local/index.js` of the following spec

```javascript
module.exports = {
Expand All @@ -25,6 +31,10 @@ module.exports = {
}
```

#### adding an additional processing module

TBA

# run

`yarn run start`
14 changes: 10 additions & 4 deletions admin-tables-pipe.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Synopysis: links a set of I/O geoprocessing scripts that transform a commune level shapefile of Vietnam admin areas
########### into three postgis tables at commune, district, and province levels/

# copy input shapefiles from the s3 bucket in which they live
echo --- downloading input boundaries from s3 ---
aws s3 cp s3://openroads-vn-boundaries ./data/input --recursive

# input directory that holds to which the initial shapefiles are downloaded from s3
INPUT_DIR=./data/input
# output directory that holds the final output of linked processes
OUT_DIR=./data/output
# the base processing directory that includes sub directories that I/O data for each process
Expand All @@ -19,6 +18,12 @@ rm -rf ${PROCESSING_BASE_DIR}
# make handoff and process directories for current pipeline run
mkdir ${PROCESSING_BASE_DIR}
mkdir ${HNDF_DIR}
mkdir ${INPUT_DIR}

# copy input shapefiles from the s3 bucket in which they live
echo --- downloading input boundaries from s3 ---
aws s3 cp s3://openroads-vn-boundaries ${INPUT_DIR} --recursive


# make directories in ${PROCESSING_BASE_DIR} for each process's I/O these process scripts live in ./processing
for FILE in ./processing/*
Expand Down Expand Up @@ -69,4 +74,5 @@ done
# clean up temp directories and remove the input data
rm -rf ${HNDF_DIR}
rm -rf ${PROCESSING_BASE_DIR}
rm -f ./data/input/*
rm -R ${INPUT_DIR}

0 comments on commit e45bc22

Please sign in to comment.