For the last few months I’ve been scraping SORTA’s real-time GTFS data for vehicle positions. I don’t really have any plans for what to do with all of it, but it’s easy for me to collect and I figure someone else may have a use for it somewhere down the road. This could eventually be a very interesting dataset for looking at e.g. changes in on-time performance, traffic congestion, bunching, etc.
Essentially, for each vehicle in operation at a given moment, I’ve been storing its:
vehicle_id: vehicle ID given by the API
trip_id: trip_id given by the API. I believe this corresponds to the trip_id in the GTFS package for the corresponding period.
report_time: the timestamp field, per vehicle, given by the API. This is stored as Greenwich time, without a time zone, so you need to subtract a few hours to get to local time.
location: I’ve been storing everything in a PostGIS database, and the location datatype in this case is geometry(POINT,4326). Postres dumps this as a hexadecimal string.
The API updates all vehicle locations every 30 seconds and I’ve been requesting updates every 25 seconds and ignoring duplicates, so I should have all of the data on vehicle positions that have been made publicly available. I’ve tried to keep my script running steadily, but there have inevitably been a few interruptions as the postgresql server has been restarted, etc, so there may be some big gaps. Where there is any data, it should be complete; It just may skip out for a day or two. The earliest date I have is 2017-05-16 17:59:36.
Anyway, here is the script I’ve been using along with ancillary files:
Headsigns are trimmed and included. There is still some more cleaning to do though. Headsigns are quite inconsistent and I’m trying to just pull out prominent destinations.
Heading arrows have been dimmed and placed behind the text headings. These only show up after all of the shapes have loaded. Clearly, there are some legibility issues right now, but I think the positioning is the way I like it and legibility can maybe be resolved with color changes.
I’ve removed the randomly placed ‘vehicle locations’ that I’d been playing with. For now ;-)
Thoughts and comments much appreciated! If you follow the link above, you’ll be taken to a page where you can select stops. Pick one or a few and hit the button that says ‘use selected stops’. Then wait for something to go wrong and then tell me about it.
Design and development of the real-time arrival displays has finally begun!1
Wireframe showing basic layout of the display (draft)
And while that is ongoing, we are seeking early adopters to sign up to get a display for their business. The deal, in a nutshell, is this: we’re subsidizing the purchase of tablet computers set up to run a localised real-time transit display. Businesses will be responsible for somewhere between $20 and $40 of the cost of the tablet and will be responsible for maintaining it in a prominent location, with a source of electric power and a good wifi signal. We will help to supply mounting hardware, if needed, appropriate to the location. Businesses must be located on a fairly major transit line, preferably in a business district or an area with a lot of foot traffic. We’re imagining that tablets will either be placed in side-walk facing windows or placed prominently inside the business such as behind a bar.
If you’re interested in getting a display for your business, please email Daniel Schleith. He’ll get your information, answer any questions, and let you know when we’ve selected the lucky winners/trendsetters who will receive tablets.
(Please note that once the app is ready, you’ll also be able to run it in any computer with an internet browser, not just on these tablets.)
I think I’ve finally perfected my method for linking real-time data with scheduled stops. This is a comparison of the average (weekly) scheduled speeds to the observed average speed for each stop->stop segment. Results that look roughly as expected are what we all hope for.
Note that each classification is broken into eight equal sized quantiles
There is a lot of information in that little gif! More than I can explain here. More to come…
Higher resolution here by the way. It’s interesting to look at even if you don’t know Toronto. Also, the line widths are determined by the number of trips scheduled for each segment.
Just a little update on and reminder of an earlier post:
Come on down to the Macaron Bar tonight for Final Friday! My friend Ivan and I are having our first little gallery show! It’s a collaborative project, mapping out the abstract space defined by the ghostlike threads of 300+ transit GPS transponders as they trace their way around the city for a single day.
A quick and dirty cell-phone capture of a really nice looking piece.
Some of the smaller pieces start at $20 and could make a lovely little souvenir. We hope you’ll come by tonight (and I also strongly recommend the Minumentals show at the AAC tonight [and their open bar]), but the pieces should also be hanging for the next few weeks, so you can come by later if you don’t make it.