Skip to content

Animate vehicle markers between AVL updates #1555

@bmander

Description

@bmander

At present, vehicle map markers reflect the position at last AVL update. This is an honest policy, but it leaves the user guessing about where the vehicle actually is. Instead, we should show an animated extrapolation of the current vehicle location, given the most recent update. When the user selects the vehicle icon, they can also see the position of the most recent AVL update, and the time since last update.

For the extrapolation model I propose a mixture model of two gamma distributions conditioned on the scheduled speed of a given vehicle. This model is suitable for producing well calibrated confidence intervals and computationally efficient median estimates to be used for extrapolation in real time. This was selected as the best of dozens of potential models, all fit on about million AVL fixes recorded over a day in February 2026 in King County. The results are not surprising: the best expected speed estimate is simply the scheduled speed, and the median speed estimate is slightly slower than that, owing to the skew of the gamma distribution.

For a full writeup of the model, see https://bmander.github.io/extrapolation-science/

A pull request is here: #1554

In addition to animating markers on the main map, this PR also introduces a map companion to the trip list view which shows the current vehicle position inside of a confidence interval, in addition to a raw data view hidden deep in a menu, which I consistently find useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions