GPS Trajectory Analysis

Machine Learning
Introduced by
Yu Zheng
Year
2015
Type
Pipeline for turning raw movement traces into structured mobility information
Family
Movement and trajectory data mining

What does it do?

GPS trajectory analysis turns raw streams of timestamped location fixes into structured mobility information: the stops where a person dwells, the trips between them, the transport modes used, and the network routes actually travelled.

Yu Zheng's 2015 survey, 'Trajectory data mining: an overview', reviews the field from data derivation and preprocessing through trajectory management to mining tasks such as trajectory pattern mining, outlier detection and classification. The four stages described here are one practical arrangement of those steps rather than the survey's own structure. The approach supports activity-space, travel-demand and mobility studies built on smartphone and vehicle tracking data.

The intuition behind the method

A phone or tracker spits out a jittery breadcrumb trail of latitude–longitude points, some of them plainly wrong because a building bounced the signal. Looked at raw, it is just noise; but step back and structure emerges — long clusters of points where someone sat still (home, the office, a café) separated by stretches where the points march steadily along a road. The job of trajectory analysis is to read that trail the way a person would: throw out the impossible jumps, recognize the sitting-still places as stops, recognize the marches as trips, lay each trip onto the actual streets it must have followed, and judge from the speed whether the traveller was walking, cycling, or driving.

History

Trajectory mining developed as location-acquisition and mobile computing techniques produced large volumes of trajectory data; the abstract of Yu Zheng's survey notes that many processing, management and mining techniques were proposed in the decade before 2015. Map matching with hidden Markov models is one common approach within this body of work. Zheng's 2015 overview, 'Trajectory data mining: an overview', published in ACM Transactions on Intelligent Systems and Technology, surveys the field from data derivation and preprocessing through trajectory management to mining tasks such as trajectory pattern mining, outlier detection and classification. It also covers methods that transform trajectories into graphs, matrices and tensors, and it presents public trajectory datasets.

When to use it

Use GPS trajectory analysis whenever the raw material is sequences of location fixes from phones, vehicles, wearables, or fleets and you need to recover where people stopped, how they travelled, and along which routes. It is essential for building activity spaces, estimating travel demand and mode share, mapping congestion, or studying mobility behaviour from passively collected positioning data. It is not the right tool when movement is already known at the activity level (e.g. clean travel diaries), when positioning data are too sparse or coarse to recover stops and routes, or when only aggregate origin–destination flows are needed and individual traces add no value.

Limitations and considerations

  • Output quality is bounded by positioning accuracy, sampling rate, and gaps; sparse or urban-canyon data degrade every stage.
  • Stop detection and mode inference depend on thresholds and features that often need local calibration.
  • Map matching can fail on dense, multi-level, or poorly mapped networks, mis-assigning routes.
  • Continuous tracking raises serious privacy concerns, constraining collection, sharing, and reuse of trajectories.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Recovers behaviour-level information (stops, trips, modes, routes) from location data that are collected passively, without asking respondents to keep travel diaries.
  • Modular pipeline: preprocessing, segmentation, matching and inference can be tuned or replaced independently for different data and questions.
  • Map matching places noisy points on the real network, which is needed for accurate distance, route and exposure estimates.
  • Applies from individual traces to large collections of trajectories, and open-source tools exist for several of its stages.

Applications

  • Detecting home, work, and other significant locations and durations from smartphone traces.
  • Estimating travel mode share and trip patterns for transport planning from passive GPS data.
  • Map-matching fleet or ride-hailing traces to measure travel times, routes, and congestion.
  • Building individual activity spaces and mobility exposures for health and social research.
  • Mining recurrent routes and anomalies for navigation, logistics, and behaviour analytics.

How it works

How it works

1

Raw fixes are noisy: positions drift, signals are lost, and sampling rates vary. Preprocessing cleans the trace in three steps. First, each fix is checked against the speed implied by its neighbours, and points that would require an implausible speed for the travel mode are flagged as spurious. Second, where accuracy metadata are recorded, fixes whose reported accuracy is worse than the study requires are discarded. Third, jitter is smoothed or filtered and, if needed, the trace is resampled to a regular interval. Speed and accuracy cut-offs should be set for the data and study context rather than taken as universal values. The aim is a trajectory faithful enough that segmentation and matching are not corrupted by outliers, while genuine movement is preserved.

2

The cleaned trajectory is split into stops and moves using stay points. A stay point is identified when a run of consecutive fixes remains within a spatial radius r of one another for at least a minimum duration τ, which indicates that the object lingered rather than passed through. Such runs become stops (activity locations), and the movement segments between them become moves (trips). The values of r and τ trade off detecting brief stops against splitting a single visit into several.

Formula
\text{stay point} \iff \operatorname{dist}(p_i, p_j) \le r \;\text{and}\; (t_j - t_i) \ge \tau
3

GPS points rarely fall exactly on a road, so map matching snaps the trajectory onto the underlying network. In a common hidden Markov formulation, true road segments are treated as hidden states and the observed points as noisy emissions. The segment sequence chosen is the one that maximises the likelihood of the observations together with the plausibility of transitions between consecutive segments, as the mechanics formula expresses. The output is a route along real streets or rails rather than a floating line of points.

Formula
\hat{R} = \arg\max_{R} \prod_{k} P(o_k \mid r_k)\,P(r_k \mid r_{k-1})
4

Behaviour is then inferred from the structured trajectory. Transport mode is classified from kinematic features such as speed, acceleration and stop frequency, which help separate walking, cycling, bus and car travel. Trajectory classification is one of the mining tasks reviewed by Zheng (2015), alongside trajectory pattern mining and outlier detection; across many trajectories, these tasks extract recurrent behaviour from individual traces. A mode classifier must be trained and validated on labelled trips from the target population and study area, and its accuracy should be reported separately for each mode.

Formula
\hat{m} = \arg\max_{m} P(m \mid v, a, \dots)

Common pitfalls

  • Skipping preprocessing, so a single spurious jump fix creates a phantom high-speed trip or a false stop.
  • Setting the stay-point radius and duration without calibration, either merging distinct visits or splitting one stay into many.
  • Trusting map-matched routes on sparse traces, where the most likely path may diverge from the one actually taken.
  • Inferring mode from speed alone, confusing a slow-moving car in traffic with a cyclist or a stationary bus with a stop.

Frequently asked questions

What is a stay point and how is it detected?

A stay point is a location where the moving object lingered rather than passed through, such as a home, workplace or shop. It is detected by scanning the trajectory for a run of consecutive fixes that remain within a spatial radius r of one another for at least a minimum duration τ. The run is then represented by a single stay point, and the movement segments between stay points become trips.

Why is map matching necessary?

GPS positions carry error and almost never fall exactly on a road, so a raw trajectory is a line of off-network points that cannot be tied to specific streets. Map matching snaps the trace onto the network; a hidden Markov model is a common way to do this, balancing how close each point is to candidate segments against how plausible the transitions between segments are. The result is the route actually travelled, which is required for accurate distances, travel times and route analysis.

How is transport mode inferred from a trajectory?

Mode is inferred from kinematic features computed along the trajectory, such as average and peak speed, acceleration, the frequency and length of stops, and sometimes proximity to transit lines. A classifier learns to map these features to modes such as walking, cycling, bus or car, since each has a characteristic signature. Features can be combined, and network and timetable context can help disambiguate cases, for example a bus from a car in similar traffic. Because the classifier must be trained and validated on labelled trips from the target population and study area, its accuracy should be reported separately for each mode.

Related methods

Sources

  1. Zheng, Y. (2015). Trajectory data mining: an overview. ACM Transactions on Intelligent Systems and Technology, 6(3), 1–41.

    Open DOI reference