Source code of the ICDE'23: RNTrajRec: Road Network Enhanced Trajectory Recovery with Spatial-Temporal Transformer
Python==3.6
pytorch==1.8.0
rtree==0.9.4
GDAL==2.3.3
networkx==2.3
dgl=0.8.0.post2
seaborn=0.11.2
chinese-calendar=1.6.1
Map from OSM that contains: edgeOSM.txt nodeOSM.txt wayTypeOSM.txt
.
Train data has the following format:
____ ROOT
|____ train
|____ train_input.txt
|____ train_output.txt
|____ valid
|____ valid_input.txt
|____ valid_output.txt
|____ test
|____ test_input.txt
|____ test_output.txt
Note that:
{train/valid/test}_input.txt
contains raw GPS trajectory,{train/valid/test}_output.txt
contains map-matched trajectory.- The sample rate of input and output file for train and valid dataset in both raw GPS trajectory and map-matched trajectory need to be the same, as the downsampling process in done while obtaining training item.
- The sample rate of test input and output file is different, i.e.
test_input.txt
contain low-sample raw GPS trajectories andtest_output.txt
contain high-sample map-matched trajectories. - We provide a toy dataset in Porto under
./data/Porto/
and OSM map for Porto under./data/roadnet/
.
- For training & testing with
$\epsilon_\tau=\epsilon_\rho*8$ in Porto dataset, run the following command:
python -u multi_main.py --city Porto --keep_ratio 0.125 --pro_features_flag \
--tandem_fea_flag --decay_flag
- For training & testing with
$\epsilon_\tau=\epsilon_\rho*16$ in Porto dataset, run the following command:
python -u multi_main.py --city Porto --keep_ratio 0.0625 --pro_features_flag \
--tandem_fea_flag --decay_flag
If you find this repo useful and would like to cite it, citing our paper as the following will be really appropriate:
@article{chen2022rntrajrec,
title={RNTrajRec: Road Network Enhanced Trajectory Recovery with Spatial-Temporal Transformer},
author={Chen, Yuqi and Zhang, Hanyuan and Sun, Weiwei and Zheng, Baihua},
journal={arXiv preprint arXiv:2211.13234},
year={2022}
}