Efficient Methods for Accurate Sparse Trajectory Recovery and Map Matching

Wei Tian, Jieming Shi, Man Lung YiuICDE 2025

Abstract

Real-world GPS data is frequently sparse and noisy, posing significant challenges for location-based services. This paper introduces two integrated methods, MMA (Map MAtching) and TRMMA (Trajectory Recovery with MMA), developed by researchers at Hong Kong Polytechnic University. By framing map matching as a localized classification task and utilizing a dual-transformer architecture for trajectory recovery, these methods achieve state-of-the-art accuracy while being up to 75x faster than existing deep learning solutions.

1. Introduction

High-quality trajectory data is the backbone of modern urban services, from navigation to traffic management. However, raw GPS data often suffers from low sampling rates (points every few minutes) and coordinate drift. Recovering the full path and matching it to the road network—known as map matching and trajectory recovery—is computationally intensive. Existing models often struggle with the vast search space of city-wide road networks. This work proposes a more efficient, localized approach.

2. Problem Definition

The core challenge involves two distinct but related tasks:

  1. Map Matching: Aligning raw, noisy GPS coordinates to the specific road segments in a digital map.
  2. Trajectory Recovery: Reconstructing the complete path between sparse GPS observations.
Illustration of GPS points ($p_i$), map-matched points ($a_i$), and the resulting route ($R$).

As shown in Figure 1, the goal is to transform a sequence of raw points $T = <p_1, p_2, p_3>$ into a precise route $R = <e_1, e_2, e_4, e_6>$ and a set of matched points $T_\epsilon$.

3. Methodology

The authors propose a pipeline that first identifies the route and then recovers the missing details.

3.1 MMA: Localized Map Matching

Instead of evaluating every road in a city, MMA restricts its search to a small set of candidate segments—specifically the top-10 nearest roads. Empirical analysis confirms that the "true" segment is almost always within this small set. MMA uses Node2Vec to encode road network topology and incorporates directional information via cosine similarity between the vehicle's heading and road orientation. This allows the model to treat map matching as a simple classification problem among the candidate set.

3.2 TRMMA: Dual-Transformer Trajectory Recovery

TRMMA builds upon the route identified by MMA. By focusing only on the segments within the identified route, the model drastically reduces the search space for missing points.

The TRMMA architecture featuring a DualFormer encoding stage and a multitask decoding stage.

As illustrated in Figure 4, TRMMA utilizes a Dual-Transformer Encoder. One transformer encodes the sparse GPS sequence, while another encodes the road segments of the route. A cross-attention mechanism fuses these representations to capture the spatial-temporal relationships. The Multitask Decoder then simultaneously predicts the road segment and the exact relative position for every missing point in the trajectory.

4. Evaluation and Results

The models were benchmarked against massive real-world datasets from Porto, Beijing, Xi’an, and Chengdu.

  • Accuracy: TRMMA consistently outperformed competitors like MTrajRec and RNTrajRec. In Xi'an, it achieved a Mean Absolute Error (MAE) of 68.1m, a significant improvement over the 93.1m achieved by the previous best model.
  • Efficiency: The localized approach yielded massive speedups. On the Beijing dataset, TRMMA was 75.9x faster than its closest competitor, processing 1,000 trajectories in just 0.59 seconds.
  • Training: Training time was also drastically reduced; for instance, an epoch on the Xi'an dataset took only 8 minutes, compared to over 150 minutes for competing models.

5. Conclusion

The MMA and TRMMA framework demonstrates that localizing the search space for map matching and trajectory recovery provides a dual benefit of increased accuracy and vastly improved efficiency. While the model's performance is currently tied to the initial accuracy of the MMA step, its ability to handle large-scale, sparse data makes it a powerful tool for real-world urban computing applications.

Summary updated

BibTeX
@inproceedings{tian2025efficient,
  author = {Wei Tian and Jieming Shi and Man Lung Yiu},
  title = {{Efficient Methods for Accurate Sparse Trajectory Recovery and Map Matching}},
  booktitle = {ICDE},
  year = {2025},
}
Figure