Git Product home page Git Product logo

transit-map's Introduction

transit-map

Generate a schematic map (“metro map”) for a given (transit) network graph using a Mixed Integer Programming approach. Part of the Generating Transit Maps project.

Work in progress, DO NOT USE THIS IN PRODUCTION! See todo.

npm version license chat on gitter

Installation & Requirements

Sadly, for now, you need a valid copy of the commercial Gurobi solver (free academic licenses) in order to run this project. In the near future however, this project will hopefully also support the open CBC solver. Stay tuned.

What you need:

Then, to install the package (for CLI usage), simply run:

npm install -g transit-map

Usage

CLI

You need a JSON graph representation of your transit network that looks like this example for the Berlin Metro (U-Bahn). You can then generate a transit map for the given graph by running:

cat graph.json | transit-map > output.svg

For further information on several CLI options/params, run:

transit-map --help

As a library

The module can be used as a JS library, documentation for this will follow.

Examples

🇩🇪 Berlin (Metro)

Input

Berlin metro network

Output

Berlin metro map

Using this input graph. Running time ≈40sec.

🇦🇹 Vienna (Metro)

Input

Vienna metro network

Output

Vienna metro map

Using this input graph. Running time ≈20sec.

🇸🇪 Stockholm (Metro)

Input

Stockholm metro network

Output

Stockholm metro map

Using this input graph. Running time ≈20sec.

🇵🇹 Lisbon (Metro)

Input

Lisbon metro network

Output

Lisbon metro map

Using this input graph. Running time ≈15sec.

🇫🇷 Nantes (Tram)

Input

Nantes metro network

Output

Nantes metro map

Using this input graph. Running time ≈15sec.

🇫🇷 Montpellier (Tram)

Input

Montpellier tram network

Output

Montpellier tram map

Using this input graph. Running time ≈20sec.

To do

Things I am still working on or someone should work on in the future, roughly in order of perceived importance:

  1. Properly document the current optimization algorithm.
  2. Add an example for full Berlin network (S-Bahn & U-Bahn), debug pre-processing with this (still fails with this network for some reason).
  3. Resolve todo comments in code.
  4. Write tests.
  5. Improve algorithm: “Smoother” edges, higher distance for parallel lines, implement station labels.
  6. Linearize objective function which would allow users to use non-commercial solvers like Cbc.
  7. Enable users to provide an old layout of the same network (or parts of it), the newly generated network should then have as few differences as possible to the older one.
  8. Further explore heuristical approaches to this problem.
  9. Write a paper. 😄

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.

transit-map's People

Contributors

juliuste avatar

Watchers

James Cloos 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.