Giter Site home page Giter Site logo

tokyo-metro-data's Introduction

GitHub last commit GitHub contributors GitHub watchers GitHub stars

Tokyo Metro Data

Data detailing Tokyo's Metro network, derived from the line plan and signs as well as tokyometro.jp.

You can help by improving it!

Data formats

JSON based data

Stations.json contains all currently known information. This includes the stations names in english and japanese as well all connections departing a station. Distances are in kilometers (float) and durations in seconds (int).

The following should explain stations.json:

{
    "lines": {
        ...
        "A": {
            "name_en": "Asakusa Line",
            "name_jp": "浅草線"
        },
        "C": {
            "name_en": "Chiyoda Line",
            "name_jp": "千代田線"
        },
        ...
    },
    "stations": {
        ...
        "E27": {
            "connections": [
                {
                    "distance": 0.6,
                    "duration": -1,
                    "target_id": "E26",
                    "type": "ride",
                    "type_id": 1
                },
                {
                    "distance": 0.8,
                    "duration": -1,
                    "target_id": "E28",
                    "type": "ride",
                    "type_id": 1
                },
                {
                    "distance": 0.0,
                    "duration": -1,
                    "target_id": "E01",
                    "type": "walk",
                    "type_id": 0
                },
                {
                    "distance": 0.0,
                    "duration": -1,
                    "target_id": "S01",
                    "type": "walk",
                    "type_id": 0
                },
                {
                    "distance": 0.0,
                    "duration": -1,
                    "target_id": "M08",
                    "type": "walk",
                    "type_id": 0
                }
            ],
            "name_en": "Shinjuku",
            "name_jp": "新宿"
        },
        ...
    },
    "transition_types": {
        "0": "walk",
        "1": "ride",
        "2": "ground"
    }
}

Matrix based format

Other then Stations.json you can also use matrix_dist.csv or matrix_time.csv. These can easily be used with python. Here is a quick example:

import pandas as pd

# Load csv file
matrix_dist = pd.read_csv('matrix_dist.csv', index_col=0)

# Show distance from A05 to A06 in km
print(matrix_dist["A05"]["A06"])
>>> 0.7

Regenerate data files

You'll want to update Stations.json, matrix_dist.csv and matrix_time.csv after doing changes to the data directory. To update Stations.json simply run the following within the repo:

$ generator.py

To update the matrix files, run the following:

$ generator.py -m

For verbose output use

$ generator.py -m -v

Things to do

As of yet there are a few things missing:

  • Adding all japanese station names to stations_jap.csv
  • Replace duration with distance
  • Add distance (listed on wikipedia)
  • Add a transition like file for duration
  • General code cleanup in generator.py (maybe some progress output?)
  • Add real durations to trasitions.csv and lines.csv
  • Adding connections to non-metro transport systems (e.g. train stations or airports)

Contributors

You can add yourself here after contributing something!

Projects using this data

Feel free to add your project!

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org/

tokyo-metro-data's People

Contributors

sternenseemann avatar stonelabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.