nate-parrott / subway

🚉 interactive NYC subway map that adjusts distance based on travel time
http://subway.nateparrott.com
130 stars 22 forks source link

Fork for own city #1

Open janpio opened 6 years ago

janpio commented 6 years ago

I am looking into forking this for my city (Berlin).

I found an equivalent to what you have in google_transit.zip (although I have to filter it down as it also contains busses, trams, regional trains, ...).

What about schedules/?

Anything else missing besides running the commands you listed in README?

PS: Nice project by the way!

nate-parrott commented 6 years ago

Hi there! /schedules is actually generated by gtfs_json.py. You might need to modify the paths in that file a bit, but it shouldn't need to many changes!

nate-parrott commented 6 years ago

(make sure to unzip your google_transit.zip file in the directory before running the script)

janpio commented 6 years ago

Thanks! Will do and let you know how it goes.

janpio commented 6 years ago

Finally got to it.

This is my data source: http://www.vbb.de/de/download/GTFS.zip Some information about it: https://transitfeeds.com/p/verkehrsverbund-berlin-brandenburg/213

generate_routes_json.py:

I also had to edit line 178 to this:

    if not xfer['min_transfer_time'] == "":
        time = float(xfer['min_transfer_time'])
    else:
        time = float(0)

Seems some min_transfer_time are missing in my dataset.

gtfs_json.py:

I would be happy with part of the data, but don't know how to filter the dataset locally: https://transitfeeds.com/p/verkehrsverbund-berlin-brandenburg/213/latest/routes?type=400

Any pointers or ideas to any of my issues?

janpio commented 6 years ago

Ok, found a way to filter/extract some stations: https://gis.stackexchange.com/a/219398/111548 http://developer.onebusaway.org/modules/onebusaway-gtfs-modules/current-SNAPSHOT/onebusaway-gtfs-transformer-cli.html

janpio commented 6 years ago

Generating the schedules still doesn't really work, but the other files look good.

Let's try if it can render something:

Whee I see something!

janpio commented 6 years ago

So I got it working for the default loading state: https://janpio.github.io/subway/

Compare this to Google Maps: https://www.google.de/maps/@52.5183954,13.4724959,10.56z/data=!5m1!1e2 (only the green lines are in the data set right now)

See my commit for the changes that were necessary: https://github.com/janpio/subway/commits/master And some notes and research at the end of the README: https://github.com/janpio/subway/commits

Now on to fix the schedule stuff...