SORTA’s Real-time API Now Available for Developers

Yep. It’s finally here! :-D

Vehicle location feed:
http://developer.go-metro.com/TMGTFSRealTimeWebService/vehicle
Trip update feed:
http://developer.go-metro.com/TMGTFSRealTimeWebService/TripUpdate

The data is structured according to the GTFS real-time specification. I was able to parse it pretty easily in Python by following the instructions on that page. The fields currently included in the feed (many are optional in the specification) are as follows.

VehicleLocation feed sample data:

id: "4001"
vehicle {
  trip {
    trip_id: "940867"
  }
  position {
    latitude: 39.1043395996
    longitude: -84.3908996582
  }
  timestamp: 1421889007
  vehicle {
    label: "4001"
  }
}
...

TripUpdate feed sample data:

id: "938755"
trip_update {
  trip {
    trip_id: "938755"
    start_time: "17:07:00"
    start_date: "20150121"
    route_id: "1"
  }
  stop_time_update {
    stop_sequence: 5
    departure {
      delay: 60
      time: 1421878357
    }
    stop_id: "EZZJOHe"
  }
...
  stop_time_update {
    stop_sequence: 32
    arrival {
      delay: 60
      time: 1421880000
    }
    stop_id: "PAR2610e"
  }
  vehicle {
    label: "1001"
  }
}
...

The feeds update every 30 seconds, which seems a little slow, but oh well.

Right now, my understanding is that these feeds have been tentatively released as-is for developers only, and that SORTA is not ready yet to make a general public announcement that real-time data is available. Tim Harrington at SORTA, who shared the links with us, has politely asked to see the neat stuff that we’re able to develop with this data. I imagine that the sooner someone sends him a link to a decent, working app, the sooner they’ll give us the go-ahead and the sooner we’ll all be able to use this data in every-day situations.

So who’s gonna make an app? There must be a dozen open-source applications that are already designed to work with GTFS-realtime. We probably just need to plug this feed in and maybe make a few localization tweaks. If you or anyone you know has the skills and/or interest to make an app…then for the love of transit, let’s make this happen ASAP!

Comments: 12
Posted in: Data | Events
Tags: | | |

An approximation of service frequency

Here is a rather crude, though I think useful, visualization of service frequency at the stop level. Basically, I used the GTFS data from SORTA and TANK to calculate the number of times a bus stops at each stop every week. Since a week is the basic cycle period of transit(service is bad on Sunday, better on monday), this should give us a an idea of basic average frequency with the huge caveat that there’s enormous variation within each week.

map of the approximate frequency of greater cincinnati transit system

Click the image to get a bigger version. There’s lot’s of interesting detail in there!

You may notice that frequency can appear vary in a single line where it doesn’t seem like it probably should:

Map of Ludlow Avenue in Clifton, Cincinnati

Ludlow Avenue

In most cases, this is simply an artifact of the way I grouped stops that were next to each other and had exactly the same name. At least 2-3,000 stops of the 6,000 stops in the dataset can reasonably be thought of as pairs with one serving each direction of travel.

Comments: 2
Posted in: Analysis | Data | Maps
Tags: | | | | | | | |