Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Matching error for T-Drive data #312

Closed
techGIAN opened this issue Sep 5, 2022 · 8 comments
Closed

Map Matching error for T-Drive data #312

techGIAN opened this issue Sep 5, 2022 · 8 comments

Comments

@techGIAN
Copy link

techGIAN commented Sep 5, 2022

Based from this comment (#292), I used the original T-drive data and converted it to atomic file (but I guess the one in the Google Drive with filename T_DRIVE20150206.zip https://drive.google.com/drive/folders/1g5v2Gq1tkOq8XO0HDCZ9nOTtRpB6-gPe is already in atomic file? so I just downloaded this one for my use for map matching). But I guess when I try doing a map matching task on it using the STMatching, it gives me a value error that the .geo file should include a LineString type? Does the .geo file not include LineStrings? Any kind of resolution I could do so I could be able to map match T-Drive dataset? Thank you.

Traceback (most recent call last):
  File "/home/gcalix/Bigscity-LibCity/run_model.py", line 36, in <module>
    run_model(task=args.task, model_name=args.model, dataset_name=args.dataset,
  File "/home/gcalix/Bigscity-LibCity/libcity/pipeline/pipeline.py", line 46, in run_model
    dataset = get_dataset(config)
  File "/home/gcalix/Bigscity-LibCity/libcity/data/utils.py", line 21, in get_dataset
    return getattr(importlib.import_module('libcity.data.dataset'),
  File "/home/gcalix/Bigscity-LibCity/libcity/data/dataset/map_matching_dataset.py", line 82, in __init__
    self._load_geo_and_rel()
  File "/home/gcalix/Bigscity-LibCity/libcity/data/dataset/map_matching_dataset.py", line 121, in _load_geo_and_rel
    raise ValueError('.geo file should include LineString type in Map Matching task!')
ValueError: .geo file should include LineString type in Map Matching task!
@aptx1231
Copy link
Member

aptx1231 commented Sep 6, 2022

T_DRIVE20150206.zip is also a traffic flow dataset, not a trajectory dataset, the same as T_DRIVE_SMALL.
If you need to match the original T-Drive trajectory data to the road network, you can process orignal T-Drive data into a trajectory atomic file, and then you can use the code in LibCity. A similar dataset can be found in the Seattle, global dataset in the Google drive.

@aptx1231
Copy link
Member

aptx1231 commented Sep 6, 2022

You need to process a geo file containing the latitude and longitude of a road segment of Beijing with type=LineString.
You also need to process a dyna file containing the GPS trajectory of Beijing city, each line is a GPS point.

@aptx1231
Copy link
Member

aptx1231 commented Sep 6, 2022

Details of trajectory atmoic files can be found at https://bigscity-libcity-docs.readthedocs.io/en/latest/user_guide/data/atomic_files.html#detailed-description. You can mimic the format of the Seattle dataset

@techGIAN
Copy link
Author

techGIAN commented Sep 16, 2022

Hi, thanks for the reply. I thought of using another dataset for now instead of T-Drive -- so that I would have to bypass preprocessing to atomic files. I used the Seattle dataset for now as the suggestion in the docs. I am now able to run it but for some reason gets stuck? And does not seem to be able to continue running? Any resolution for it? Thanks

gcalix@tiger:~/Bigscity-LibCity$ python run_model.py --task map_matching --model STMatching --dataset Seattle
2022-09-16 01:28:30,365 - INFO - Log directory: ./libcity/log
2022-09-16 01:28:30,366 - INFO - Begin pipeline, task=map_matching, model_name=STMatching, dataset_name=Seattle, exp_id=52557
2022-09-16 01:28:30,366 - INFO - {'task': 'map_matching', 'model': 'STMatching', 'dataset': 'Seattle', 'saved_model': True, 'train': False, 'seed': 0, 'dataset_class': 'MapMatchingDataset', 'executor': 'MapMatchingExecutor', 'evaluator': 'MapMatchingEvaluator', 'k': 5, 'r': 200, 'mu': 0, 'sigma': 20, 'window_size': 40, 'delta_time': True, 'metrics': ['RMF', 'AN', 'AL'], 'save_modes': ['csv'], 'geo': {'including_types': ['LineString'], 'Point': {}}, 'usr': {'properties': {}}, 'rel': {'including_types': ['geo'], 'geo': {}}, 'dyna': {'including_types': ['trajectory'], 'trajectory': {'entity_id': 'usr_id'}}, 'geo_file': 'Seattle', 'rel_file': 'Seattle', 'usr_file': 'Seattle', 'dyna_file': 'Seattle', 'truth_file': 'Seattle_truth', 'device': device(type='cuda', index=0), 'exp_id': 52557}
2022-09-16 01:32:25,437 - INFO - Loaded file Seattle.geo, num_nodes=895894
2022-09-16 01:32:25,437 - INFO - Loaded file Seattle.rel, num_roads=713020
2022-09-16 01:32:25,517 - INFO - Loaded file Seattle.usr, num_users=1
2022-09-16 01:32:26,594 - INFO - Loaded file Seattle.dyna, num of GPS samples=7531
2022-09-16 01:32:26,719 - INFO - Loaded file Seattle_truth.dyna, route length=1456
2022-09-16 01:32:28,896 - INFO - Saved at ./libcity/cache/dataset_cache/map_matching_Seattle_True.pkl
2022-09-16 01:32:29,034 - INFO - begin map matching, usr_id:0 traj_id:0

@aptx1231
Copy link
Member

Is it possible to continue running after waiting for a while? The data set is relatively large and the algorithm runs slowly.

@techGIAN
Copy link
Author

techGIAN commented Sep 17, 2022

Hi, I've run this already for at least four hours and still the same result. My only concern is that there does not seem to be any progress whatsoever (i.e, stuck at map-matching user id 0 traj id 0, but does not seem to be doing the same for other trajectories or users). Even if it's a very large dataset and slow algorithm, I just thought it should have given me some message at least giving me updates on the progress it has done with map-matching. So I'm not really sure if I have done anything wrong? Or do you know how much time I have to wait at least before I could see some progress?

product: GP102 [GeForce GTX 1080 Ti]
vendor: NVIDIA Corporation

Edit: Now it has run for 12 hours but still the same thing. That's why I was led to believe that it has gotten stuck.

@aptx1231
Copy link
Member

aptx1231 commented Oct 1, 2022

@XBR-1111 你看看这个咋回事呢

@aptx1231
Copy link
Member

aptx1231 commented Oct 2, 2022

I did not encounter this problem in my tests here.
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants