cyang-kth / fmm

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

Fail to match #161

Closed HajimeSeya closed 3 years ago

HajimeSeya commented 3 years ago

I think the attached shapefile has no problem in terms of geometry. However, the attached GPS dots fail to be matched to the road, and I could not find the reason. Could you kindly suggest the possible reason? testdata.zip The code I used is as follows:

ubodt_gen --network Export_Output_9.shp --output ubodt.txt --delta 0.01 fmm --ubodt ubodt.txt --network Export_Output_9.shp --gps gps2.csv --gps_point -k 8 -r 0.003 -e 0.0005 --output mr.txt

cyang-kth commented 3 years ago

@HajimeSeya

The topology of your network is still not correct. The source code and target code are not in the correct order.

If you also plot the nodes of your network, you will see the error. The geometry order and the source/target node are not correct.

The three edges below 41977, 42149, 33071 should have the same source node, but they have the same target nodes.

image

HajimeSeya commented 3 years ago

Thank you very much.

cyang-kth commented 3 years ago

You may also need to set the parameter of --reverse_tolerance as your GPS data seems to contain small turning back observations, see the issue below as an example https://github.com/cyang-kth/fmm/issues/136

HajimeSeya commented 3 years ago

Dear Can,

I corrected the road network, and now the direction of road geometry is consistent with that of the source to the node. Unfortunately, the same code with the option "--reverse_tolerance 0.01" still does not produce matching results.
I am sorry for taking your time.

testdata2.zip

cyang-kth commented 3 years ago

Where did you find the option value 0.01, please try other values like --reverse_tolerance 0.3?

HajimeSeya commented 3 years ago

Thank you very much for your suggestion. Unfortunately, setting the reverse_tolerance of 0.3 did not solve the issue.

cyang-kth commented 3 years ago

I don't know how you create your network topology, but make sure that every thing is connected correctly. Your edge 34102 and 11881 are not connected with the correct node ID.

Use some standard tools http://docs.pgrouting.org/2.0/en/src/common/doc/functions/create_topology.html or OSMNX

Be sure to have a correct network before you do map matching!

HajimeSeya commented 3 years ago

Thank you very much for your very useful information.

HajimeSeya commented 3 years ago

Dear Can,

Thanks to your kind support, now I succeeded in implementing the map matching. The attached picture shows the result. Because my GPS dots go around the center of the two roads, the obtained result's topographic shape is relatively complex. Do you think it is possible to improve this? The settings I used are as follows, and the data is attached herewith:

ubodt_gen --network network.shp --output ubodt.txt --delta 0.01

fmm --ubodt ubodt.txt --network network.shp --gps gps.csv --gps_point -k 8 -r 0.003 -e 0.0005 --output mr.txt --reverse_tolerance 0.3

I tried to change "e", but it was not enough. Thank you very much. result test.zip