Small world. I did this on behalf of BlirpIt for UVM back in 2009 or so. We had trackers on each bus, and they would report location on a certain interval, or whenever the speed changed by a certain threshold from the speed at last report. We had server-side geofences on each bus stop, and defined a "route" that was just a chain of stops, and then we stored a moving average of time between each pair of stops and that was about it. One of the more fun projects I was doing back at that time!