In this study, we aim to generate a routable road network from trajectories using a deep learning approach.
If you find our code useful for your research, please cite our paper:
Sijie Ruan, Cheng Long, Jie Bao, Chunyang Li, Zisheng Yu, Ruiyuan Li, Yuxuan Liang, Tianfu He, Yu Zheng. "Learning to Generate Maps from Trajectories". AAAI 2020.
python feature_extraction.py ../data/conf_tdrive_sample.json
python train.py --name t2rnet_tdrive_sample --dataroot ../data/tdrive_sample/learning --lam 0.2 --batch_size 8 --model t2rnet --display_id -1
python test.py --name t2rnet_tdrive_sample --dataroot ../data/tdrive_sample/learning --lam 0.2 --model t2rnet
python region_concatenation.py --tile_path ./results/t2rnet_tdrive_sample/test_latest/images/ --conf_path ../data/conf_tdrive_sample.json --results_path ../data/tdrive_sample/results/
python main.py --phase 1 --conf_path ../data/conf_tdrive_sample.json --results_path ../data/tdrive_sample/results/
python main.py --phase 2 --conf_path ../data/conf_tdrive_sample.json --results_path ../data/tdrive_sample/results/
python main.py --phase 3 --conf_path ../data/conf_tdrive_sample.json --results_path ../data/tdrive_sample/results/
python main.py --phase 4 --conf_path ../data/conf_tdrive_sample.json --results_path ../data/tdrive_sample/results/
DeepMG uses the following dependencies with Python 3.6
- gdal==2.3.2
- opencv==3.3.1
- rtree==0.8.3
- networkx==2.3
- scikit-image==0.16.2
- pytorch==1.1.0
- torchvision==0.3.0
Other packages can be easily installed using conda install
, while the following scripts are recommended for gdal
, opencv
and pytorch
.
conda install -c conda-forge gdal==2.3.2
conda install -c menpo opencv==3.3.1
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch -c defaults -c numba/label/dev
Note that gdal
must be installed first, and a restart might be required after all installation.
-
Trajectory Data
- There are some open-source trajectory datasets, e.g., TDrive.
- Data should be organized as text files. A text file can contain several trajectories (refer to sample.txt.template)
-
Road Network Data
- OpenStreetMap (OSM) is an open-source map data source
- The Shapefile road network format can be generated by osm2rn.