Search code examples
javaandroidgtfs

No idea how to interpret GTFS-realtime data


Sorry to come off as a "help vampire". I'm new to Android and very new to GTFS. I'm trying to read the data from NYC Subway lines from MTA, which is in GTFS-realtime format. Everything works fine; I've established the URL connection and parsed the resulted in Java objects. It's all in order. I just have no idea what it means. The documentation at MTA is horrid, and I have no idea where the stops.txt, stop_times.txt, etc. that I need to even begin to organize the data is.

I know this question is extremely open-ended, and I'm truly very sorry for that. I've been pouring over documentation and SO answers for hours and I've gotten nothing. If someone could help me out with how to get the text files, and then how to use those files to get data for, say, the 1 Line at the 103 St. station, I would really appreciate it.

Thanks in advance :)


Solution

  • For GTFS-realtime data (aka real-time delay information for MTA Subway), check out the docs for TripUpdates at:

    https://developers.google.com/transit/gtfs-realtime/

    Specifically, the NYC GTFS-realtime feed contains a series of TripUpdates (one for each active subway train) that identifies the route associated with the trip (via the TripDescriptor) and provides arrival time information at each stop along the trip (via repeated StopTimeUpdate fields).

    You can link this information up with the static GTFS schedule data for NYC MTA, available at:

    http://web.mta.info/developers/developer-data-terms.html

    Specifically, download the NYCT Subway feed. The stop ids referenced in the GTFS-realtime feed will match up with stop entries defined in the GTFS stops.txt file.