CivicTechTO / ttc_subway_times

A scraper to grab and publish TTC subway arrival times.
GNU General Public License v3.0
40 stars 30 forks source link

Map `station_char` from API to GTFS `stops` #75

Open radumas opened 4 years ago

radumas commented 4 years ago

From the API we get (see Data Dictionary) station_id and station_char. For comparing with scheduled performance, and doing stuff like mapping station and line locations, it would be useful to have a mapping between GTFS stops and the data from the API.

GTFS can be download from here. Tools for dealing with gtfs data can be found here. I created two sql files to create the structure in sql and process the data:

Looks like the GTFS has at least one row per station-direction, here's a sample.

lineid stop_id stop_code stop_name
1 14457 13863 BLOOR STATION - NORTHBOUND PLATFORM
1 14414 13864 BLOOR STATION - SOUTHBOUND PLATFORM
1 14455 13808 COLLEGE STATION - NORTHBOUND PLATFORM
1 14416 13807 COLLEGE STATION - SOUTHBOUND PLATFORM
1 14461 13797 DAVISVILLE STATION - NORTHBOUND PLATFORM
1 14410 13798 DAVISVILLE STATION - SOUTHBOUND PLATFORM
1 15698 15664 DOWNSVIEW PARK STATION - NORTHBOUND PLATFORM
1 15699 15665 DOWNSVIEW PARK STATION - SOUTHBOUND PLATFORM
1 14454 13809 DUNDAS STATION - NORTHBOUND PLATFORM
1 14417 13810 DUNDAS STATION - SOUTHBOUND PLATFORM
1 14428 13828 DUPONT STATION - NORTHBOUND PLATFORM
1 14443 13827 DUPONT STATION - SOUTHBOUND PLATFORM
1 14462 13796 EGLINTON STATION - NORTHBOUND PLATFORM
1 14409 13795 EGLINTON STATION - SOUTHBOUND PLATFORM