cyang-kth / fmm

Fast map matching, an open source framework in C++
https://fmm-wiki.github.io/
Apache License 2.0
878 stars 205 forks source link

Problem map matching with stmatch #170

Closed mapperosm closed 3 years ago

mapperosm commented 3 years ago

Hello,

I have downloaded a graph file: edges.shp via the osm_mapmatching repository python code. The edges seem to be fine and can be visualized correctly.

Now I wanted to mapmatch a GPS trajectory via following command:

stmatch --network network-new/edges.shp --gps gpstrajectories.csv -k 4 -r 0.4 -e 0.5 --output mr.txt

I receive following error:

[info][stmatch_algorithm.cpp:28 ] reverse_tolerance 0
[info][stmatch_app_config.cpp:86 ] Log level 2-info
[info][stmatch_app_config.cpp:87 ] Step 100
[info][stmatch_app_config.cpp:88 ] Use omp false
[info][stmatch_app_config.cpp:89 ] ---- Print configuration done ----
[info][network.cpp:72 ] Read network from file network-new/edges.shp
[critical][network.cpp:97 ] Field not found: id index -1, source index -1, target index -1
terminate called after throwing an instance of 'std::runtime_error'
  what():  Field not found: id index -1, source index -1, target index -1

Could you tell me what could be the problem?

Thank you very much.

cyang-kth commented 3 years ago

Check this link https://github.com/cyang-kth/fmm/tree/master/example/osmnx_example

You need to add --network_id fid --source u --target v

mapperosm commented 3 years ago

No I face the problem of an uncorrect gps.csv file. stmatch --network network-new/edges.shp --network_id fid --source u --target v --gps gpstrajectories.csv -k 4 -r 0.4 -e 0.5 --output mr.txt

I use following csv format as provided here: https://github.com/cyang-kth/fmm/blob/master/example/data/gps.csv

id;x;y;timestamp
0;lat1;lon1
0;lat2;lon2
...
mapperosm commented 3 years ago

This issue was caused by the wrong access rights of the csv. Unfortunately the fitting does not work pretty well with the standard configuration. Is there a standard way how to visualize the receveived mr.txt? I have for example qgis but i cannot import the mr.txt directly. thx