[Background] For decades, researchers and practitioners typically measure macroscopic traffic flow variables, i.e., density, flow, and speed, using time or space cuts, and then construct the fundamental diagrams of traffic flow. With the advent of large-scale vehicle trajectory datasets, often capturing 100% of vehicle dynamics, Edie’s generalized definitions have become widely recognized as the most appropriate framework for measuring these variables.
[Gap] However, while Edie’s formulation explicitly requires the traffic state within the measurement region to be both stationary and homogeneous, there is little guidance on how to systematically identify such qualified regions and construct the corresponding fundamental diagrams.
[Contribution] To address this gap, this project proposes an Edie’s definition-based method for measuring traffic variables and constructing the fundamental diagrams of traffic flow by automatically identifying stationary traffic states using parallelogram-shaped aggregation regions. An open-source tool is developed and released to support both researchers and practitioners.
[Impact] From now on, we have an automated tool that can generate fundamental diagrams directly from any large-scale time-space diagram of vehicle trajectories, either collected from the real world or generated by simulation such as testing car-following models.
[Preprint] https://arxiv.org/abs/2507.09648
[Video] https://m.youtube.com/watch?v=lJVYIVtsLso
I am proud to have developed the code in both Matlab and Python, and the two versions essentially implement the same functionality. Before running the code, you need to unzip the data and place them into the folder 'trajectory_data'. You may need to modify the ‘root’ path to match your computer settings.
The input file should be in CSV format, with each row corresponds to a trajectory data point. The file contains 4 columns as described below:
Column | Name | Unit | Description |
---|---|---|---|
1 | Vehicle ID | – | Unique ID for each vehicle |
2 | Time | s | Timestamp in seconds |
3 | Location | m | Position along the road in meters |
4 | Speed | km/h | Vehicle speed |
If you find this work useful, please consider citing our paper:
Constructing the fundamental diagrams of traffic flow from large-scale vehicle trajectory data
Zhengbing He, Cathy Wu
arXiv:2507.09648
@article{he2025constructing,
title={Constructing the fundamental diagrams of traffic flow from large-scale vehicle trajectory data},
author={He, Zhengbing and Wu, Cathy},
journal={arXiv preprint arXiv:2507.09648},
year={2025}
}