developmentseed / rem-web-demo

Demo visualiztion of REM model developed at MIT Tata center
http://developmentseed.github.io/rem-web-demo
MIT License
1 stars 5 forks source link

REM model interactive web map demo

This repo is intended as an example/demo of taking the output from the REM model developed at MIT Tata center and quickly visualizing those results on an interactive web map.

[Working demo]()

Installation

To get set up, first:

Processing the data

Drop the raw output data in the data/raw directory (which you'll need to create), and then run:

This does a few things:

  1. Converts the shapefiles to geojson (in data/geojson)
  2. Merges each "type" of data into a single geojson: Customers, Generator, Network, Transformer. The features from each individual file are given two new properties: voltage and network_type, which are inferred from the original file names. (This step can easily be replaced if a different scheme is used later.)
  3. Use tippecanoe to slice this data up into Mapbox Vector Tiles.

Now you can do:

# You'll need a Mapbox API token with uploads:write scope granted
export MapboxAccessToken=YOUR_TOKEN
make upload-model-runs MB_ACCOUNT=your_mapbox_account

Building & deploying the frontend

Configure the Mapbox account details and specific tilesets (data sources) by editing app/config.js

Then, to build, just run npm run bundle, which updates the the bundled javascript file in dist/, and then commit the change to github.