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]()
To get set up, first:
pip install csvkit
)npm install
Drop the raw output data in the data/raw
directory (which you'll need to
create), and then run:
make data/rem-customer-model.mbtiles
to make the customer locations data source.make data/rem-output/MODEL_RUN.mbtiles
, where MODEL_RUN
should match up with the name of a top-level subdirectory of data/raw
(e.g. if there's data for a run in data/raw/Vaishali_Run_1
, then you'd do make data/rem-output/Vaishali_Run_1.mbtiles
)make all-models
will attempt to build a model for each subdirectory of data/raw
-- use it like make all-models -j 8
to take advantage of parallelization).This does a few things:
data/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.)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
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.