Git Product home page Git Product logo

rem-web-demo's Introduction

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:

  • Install tippecanoe
  • Install csvkit (pip install csvkit)
  • Install Node (v4 or higher)
  • Clone this repo and run npm install

Processing the data

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)
  • (Alternatively, 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:

  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.

rem-web-demo's People

Contributors

anandthakker avatar ricardoduplos avatar danielfdsilva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.