QGIS Co-traveler Plugin

Co-traveler problems are generally concerned with discovering a set of objects which travel together from among a collection of moving objects. The data is in the form of timestamped locations, along with an identifier of the object that the timestamped locations belong to. The data is grouped according to these identifiers into tracks, where each track is a collection of timestamped locations. The cotravel plugin computes distances (scores) between tracks. Here is a simple example.

tracks A and B

The distance between these two tracks "A" and "B" above is calculated by averaging the 5 sampled distances (an oversimplification for now, a more accurate explanation later), marked in the image below with dotted lines,

scoring track pair (A,B)

resulting in a score of (4+3+2+2+3)/5 = 3 grid units. How these samples were chosen is determined by the parameter time bin size, to be further explained later below. (Here time bin size was set to 1 hour.) Here are some definitions:

Note that the distances between tracks "A" and "B" were computed only for the time period where both tracks existed. In this example, tracks "A" and "B" overlapped during the time period from 4:00 to 8:00. The algorithm returns the following information for the track pair (A, B).

For contrast, if we change the timestamps of track "A" and call the new track "C", the score between tracks "C" and "B" below would be "nonexistent" because the two tracks do not overlap in time.

tracks C and B

For applications where we are interested in vehicles that are near each other only part-time, we can also set the minimum part-time window parameter. This score is the best (smallest) distance averaged over all possible time windows of at least this size. For example, using the example of tracks "A" and "B" above,

Quick explanation of algorithm and time bin size

The most important parameter is the time bin size. The algorithm converts each track to a track of quantized pings (qpings), with one qping per time bin. (A qping of a time bin is calculated as the centroid of the track within that time bin; but that's not important here.) These converted tracks of qpings are what allows the algorithm to compute various scores quickly. Here are some example results of the track "A" with various time bin sizes.

tracks A with time bin size = 60 minutes

An optimal choice of time bin size depends on the nature of the data, and properties such as density,speed, and quality. A reasonable first try is to choose a time bin size so as to get approximately 100 time bins. An alternate to choosing the time bin size is to choose the number of time bins; the default option is to choose 100 time bins. A begnning user of this plugin can simply use this default option.

Calculate co-traveler scores

Co-travel analysis begins by selecting Plugins->Co-travel tools->Calculate co-traveler scores from the QGIS menu or by clicking on this icon on the toolbar Toolbar co-travel icon.

Co-traveler plugin

Once launched this dialog box is displayed.

Co-travel scores algorithm

This algorithm processes a point vector layer that contains pings that have a timestamp and unique identifier representing the same object traveling in space and time. The unique identifier groups are called tracks and the pings are sorted in the track by their timestamp. The algorithm output is a table that gives scores to pairs of tracks which best match the criteria that they are near each other in both time and space. After the scores are calculated the Analyze co-travelers tool will be displayed to examine co-travel pairs.

The following are the plugin parameters necessary to run the algorithm. Some are mandatory and some are optional.

Mandatory input parameters

Important parameters, though defaults values may be used.

FILTERS (Advanced Parameters)

Analyze co-travelers

This tool is automatically enabled and populated when the Calculate co-traveler scores algorithm is finished, but it can also be launched from the Co-travel plugin menu or from the toolbar.

Analyze co-travelers

QGIS Time Date Controller support

If the QGIS Time Date Controller (QTDC) plugin has been installed, then Analyze co-travelers has additional functionality to interact with that controller. The only parameter is to select the time attribute that was used in the original data when the scores were processed. Clicking on Show QTDC will display the controller. If the QTDC plugin has not been installer, then these extra capabilities will not be displayed.