11 ms·
MTA Releases Subway Time App
- mrjones 14y agoI was looking at this earlier, there's an API too that seems pretty simple to use: ----- (1) Developer key: http://datamine.mta.info/user/register http://datamine.mta.info/user/register (2) The data is in Protocol Buffer format, so get that: http://code.google.com/p/protobuf/downloads/list http://code.google.com/p/protobuf/downloads/list (3) The proto definition of the GTFS-realtime feed: https://developers.google.com/transit/gtfs-realtime/gtfs-realtime-proto https://developers.google.com/transit/gtfs-realtime/gtfs-rea... (4) Some static data (which has IDs for each station, etc). http://www.mta.info/developers/data/nyct/subway/google_transit.zip http://www.mta.info/developers/data/nyct/subway/google_trans... (5) You can just curl the URL for all the current data (with your developer key): curl http://datamine.mta.info/mta_esi.php?key=<developerkey> -o /tmp/mtafeed (6) And you can decode it using protobuffers (protoc is from 2 & gtfs-realtime.proto is from 3) cat /tmp/mtafeed | /usr/bin/protoc -I /tmp /tmp/gtfs-realtime.proto --decode=transit_realtime.FeedMessage > /tmp/decodedmtafeed (7) Now you have a file full of messages like this: entity { id: "000170" trip_update { trip { trip_id: "078600_4..S44R" start_date: "20121228" route_id: "4" 1001 { 1: "04 1306 WDL/UTI" 2: 1 3: 3 } } [ some data removed ] stop_time_update { arrival { time: 1356720373 } departure { time: 1356720373 } stop_id: "635S" 1001 { 1: "2" } } [ some data removed ] Each "entity" looks like a "trip", i.e. a train. It says where the train is and when it will arrive at various stops. I found more documentation here: https://developers.google.com/transit/gtfs-realtime/reference https://developers.google.com/transit/gtfs-realtime/referenc... and here: http://httqa.mta.info/developers/pdfs/GTFS-Realtime-NYC-Subway.pdf http://httqa.mta.info/developers/pdfs/GTFS-Realtime-NYC-Subw... But still need to parse it all. It seems to be basically like this: In the "entity" - trip_id: "078600_4..S44R" * 078600 is a train id or something * _4.. means it's a 4 train (this is also available on the route_id field) * S means it's heading south * 44R describes the stops this train will make. I'm not entirely sure how to parse this. In the stop_time_update: - stop_id: "635S" * you can find the stop codes in stops.txt from (4). This one is "635S,,14 St - Union Sq,,40.734673,-73.989951,,,0,635" - arrival / time: 1356720373 $ date -d @1356720373 Fri Dec 28 13:46:13 EST 2012 So, I guess there was a Downtown 4 train, scheduled to stop at union square at 1:46:13. (I downloaded this about about 1:30 Eastern, so that seems right).
- memset 14y agoThis app also has a web version: http://apps.mta.info/traintime/ http://apps.mta.info/traintime/ Which means the MTA has unintentionally developed an API: http://advisory.mtanyct.info/Test/gtfs/scraper.php?line=1&station=115 http://advisory.mtanyct.info/Test/gtfs/scraper.php?line=1...
- udfalkso 14y agoThey have a real api: http://datamine.mta.info/ http://datamine.mta.info/
- thrownaway2424 14y agoI doubt it was unintentional. I know some guys at MTA who work on this stuff, and they are all about open data and APIs and robots etc.
- deleted 14y ago[deleted]
- danso 14y ago> “This is what generations of dreamers and futurists have waited for,” said MTA Chairman and CEO Joseph J. Lhota. “The ability to get subway arrival time at street level is here. The breathlessness of the coverage of this app makes me wonder how much money was spent on it? First of all, the main problem for New Yorkers is the lack of this data for all the other train lines (i.e A-Z). Second, the MTA has, to their credit, made this data easy to get as others have posted. And apparently Android maps already use this information...so why build an app except for getting some public goodwill. Not that public gestures are bad, but it depends on the cost (puts 'file information request for app dev contract' on things to do sometime)
- potatolicious 14y ago> " First of all, the main problem for New Yorkers is the lack of this data for all the other train lines (i.e A-Z)." Unfortunately this is not going to be fixed any time soon. BMT/IND trains have a distributed command and control system. Multiple signal towers control train movement within their own sectors of the system - and each signal tower has no information about the rest of the system. This was necessary in the early days, before electronics existed. So to this day there is no centralized snapshot of the entire system state, unlike the numbered lines, and thus no ability to provide an API. This is a great step forward. I look forward to the day we can have a big jumbotron with real time locations of trains.
- jessriedel 14y agoWhat legacy system could possibly prevent one from simply recording the position of every train every few seconds? This is not a particularly difficult problem for a billion-dollar business to solve.
- potatolicious 14y agoOne built in 1904. The control systems of the MTA are purely electromechanical. It goes way beyond what one would normally call a "legacy system". You can't record the position of trains because there is no way to snapshot the whole system. Only the signal tower local to that section of the system is aware of what's going on in its zone. This is a vestige of the design where there was no reasonable way to centralize that amount of signaling over such great distances. To get a snapshot of the whole system you'd have to simultaneously snapshot the state of every signal tower in the system and find some way to collect this information centrally. This sounds reasonable until you realize that the control system, being 50 years pre-computer, is unaware of individual trains. It doesn't detect trains, only presence of at least one car on a section of track (detected by the third rail making contact with the train). To ascertain which train is where you'd have to either have dispatchers identify the train by communicating with operators (hard to poll), or infer the identity of a train by monitoring state. Both are quite difficult when all of your data is spread all over the entirety of NYC in isolated distributed control centers. The IRT trains spent billions centralizing all command and control into a single building in Manhattan, and thus snapshotting state is trivially easy. The BMT/IND segments of the system are substantially bigger, with more stations, than even that. A full modernization to electronic control is necessary, which will cost many billions.
- revelation 14y agoWhy.. why.. is that app pitch black? Thats not the Android style, thats lazy.
- joenathan 14y agoThis is iOS only... But agreed this app is ugly.
- pazimzadeh 14y agoA lot of subway apps are black. I assume it's because most of subway signage is black. Here's a black app that's well designed: http://letsembark.com http://letsembark.com.
- antonioevans 14y agoWon't work in subway. No coverage.
- deleted 14y ago[deleted]
- michael_miller 14y agoNot 100% true - there is cell coverage in a few stations if you have AT&T, and WiFi at a couple as well (mostly along the L line).
- fratis 14y agoThis app isn't meant to be used in the subway – it's meant to used before you go down into the station. All the lines supported in the app have signs in their stations with the same live schedule information.
- jason_adleberg 14y agoExcept that there's never any reception in subway stops, no?
- danso 14y agoSo for the trains on which they have real-time data, there are already LED-boards that show arrival time: http://i.imgur.com/QzgGr.jpg http://i.imgur.com/QzgGr.jpg If you're on the platform, you'll be able to see the time even if your phone isn't working. So the mobile app will be useful if you're en route to the station and need to know how many minutes you have left.
- chimeracoder 14y agoMan, I've heard horror stories of the L, but 25.5 hours is ridiculous.
- josegonzalez 14y agoYou're thinking about the G train.
- chimeracoder 14y agoThe L has its own horror stories too (mostly because it lacks a third track).
- natejenkins 14y agoI was always amazed that the arrival boards are not available at every subway stop. In 1912 I could understand, but in 2012 this seems ridiculous.
- timjahn 14y agoSo the next train comes in an hour, and the one after that comes in a day?! I'll stop complaining the next time the L is a few minutes late. Yeesh.
- MrFoof 14y agoBoston's MBTA has had similar services available for years. About 3 years ago they rolled out tracking for the Orange, Red and Blue lines. Less than 2 years ago, they rolled out GPS tracking for buses. Recently, they started adding arrival time boards for the Orange, Red and Blue Lines as well. * MBTA App Showcase: http://www.mbta.com/rider_tools/apps/ http://www.mbta.com/rider_tools/apps/ * MassDOT Developer Page: http://www.eot.state.ma.us/default.asp?pgid=content/developer&sid=about http://www.eot.state.ma.us/default.asp?pgid=content/develope... Additionally, cellular service has been added to most subway lines and stations for at least the orange line (so you have decent signal while riding and in stations), plus WiFi available on most commuter rail trains.
- eli 14y agoLikewise with DC: http://developer.wmata.com/Application_Gallery http://developer.wmata.com/Application_Gallery
- amasad 14y agoYou can get the exact same times using Google Maps (at least for iOS).
- hammerdr 14y agoI love that Chicago's CTA believes in a much more open development model: http://www.transitchicago.com/apps/ http://www.transitchicago.com/apps/ http://www.transitchicago.com/developers/default.aspx http://www.transitchicago.com/developers/default.aspx More data: https://www.metrochicagodata.org/ https://www.metrochicagodata.org/ https://data.cityofchicago.org/ https://data.cityofchicago.org/ It's all a part of Chicago's OpenGov work and its incredible how much data and work is out there. Here's a list of apps that people made in a city-sponsored competition: http://www.smartchicagocollaborative.org/list-of-apps-for-metro-chicago-applicants/ http://www.smartchicagocollaborative.org/list-of-apps-for-me... And here's a link to one of the meetups that try to do something cool with all that open data from the City: http://www.opencityapps.org/#about http://www.opencityapps.org/#about
- schackbrian 14y ago"The MTA is challenging software developers to use MTA data to create new apps that improve the transit experience of its 8.5 million daily riders." http://mtaappquest.com/ http://mtaappquest.com/ "New York City challenged software developers to create apps that use city data to make NYC better." http://2011.nycbigapps.com/ http://2011.nycbigapps.com/
- crazygringo 14y agoThe fact this information is finally out there is fantastic. But for God's sake, if this is the case: “The existence of this sleek digital interface barely hints at the investment that had to be made in terms of hardware and infrastructure to make this enormous public benefit a reality,” Why is this literally the worst app I've ever used? A weird old pixellated icon, non-retina bitmapped user interface elements, scrolling that doesn't continue and decelerate once you let go... not even any clear indication of which trains are uptown or downtown, no map to more easily pick a station, etc... If they've been spending millions on the infrastructure to make this possible, couldn't they have spent more than what I would guess to be about $500 producing this app? It's like a third-grader wrote it. A bad third-grader.
- inmygarage 14y agoI live in NYC and have been following the city's technology initiatives closely. The silver lining here is that the city has come to terms with the fact that they are le suck at making awesomely designed consumer apps, and releasing the data to the public will be beneficial for all. My favorite part of this post is the "Commitment to Open Data". Someone out there will make something amazing with this data, it's practically inevitable. Speaking of, if you live in NYC you should come to this Reinvent Payphones Hackathon - same sentiment (full disclosure, my startup is helping to organize): http://reinventpayphones.prototypehackday.com/ http://reinventpayphones.prototypehackday.com/
- jrockway 14y agoThe availability of arrival times is just a side effect of the infrastructure upgrades. The real reason for upgrading the infrastructure was to be able to run trains closer together. Also, iPhone development is more difficult in real life than in your imagination. It should be easy to wrap a nice interface around a protobuf, but it's actually a rather tedious process.
- michaelhoffman 14y ago> Why is this literally the worst app I've ever used? I've used apps that have worse interfaces and don't do anything useful.
- qwerkykow 14y agothis reminds me of an app I helped work on for the Denver area RTD https://itunes.apple.com/us/app/denver-rail/id523272854?mt=8 https://itunes.apple.com/us/app/denver-rail/id523272854?mt=8
- llcoolv 14y agoWell, Sofia mass transit has had that for at least 4 and a half years. Funnily, for all modes of transportation, except the subway.
- timjahn 14y agoMaybe I'm missing something here, but Chicago has had this for the CTA for years. What's the big deal? Is it because New York has such an expansive subway system that this is such a big accomplishment?