Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🚉 interactive NYC subway map that adjusts distance based on travel time

NotificationsYou must be signed in to change notification settings

nate-parrott/subway

Repository files navigation

Animation

How does it work?

The main page isindex.html, but most of the code is inmap.js.map.js usesd3.js to render the map based on JSON datagenerated by a couple Python scripts.

If you'd like to set this up yourself, you'll need to unzip thegoogle_transit.zip file into this directory, then runpython3 generate_routes_json.py andpython3 gtfs_json.py to generate the requiredsubway.js andgtfs_json.js files.These are required byvirtual_rider.js, which implements Djiksta-like algorithm for simulating a rider's journeyfrom a starting stop throughout the system.virtual_rider.js is invoked bymap.js whenever a stop is clicked,and the results are used to shift the distance of each stop away from the clicked stop.

Adapting to another city

If your city's transit system provides data in the GTFS format, you canprobably get this map working fairly well for it. Here's a rough set of steps, which may be incomplete:

  1. Download and unzip the gtfs data, and place the folder (rename itgoogle_transit if it's not called that already).

  2. Use Python 3 to rungenerate_routes_json.py This generates a file calledsubway.json, which you'll need.

  3. Use Python 3 to rungtfs_json.py — this generates a new copy of theschedules/ folder and its contents.

Feel free to post an issue if you have any questions!

About

🚉 interactive NYC subway map that adjusts distance based on travel time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp