jagodki / Offline-MapMatching

a QGIS-plugin for matching a trajectory with a network using a Hidden Markov Model and Viterbi algorithm
GNU General Public License v3.0
167 stars 51 forks source link

Matching on junction #27

Closed brunoeducsantos closed 5 years ago

brunoeducsantos commented 5 years ago

Hi @jagodki , The matching on junctions is not working very well. map_matchingjunction Legend:

brunoeducsantos commented 5 years ago

I found out that smoothing GPS with Kalman Filter helps

jagodki commented 5 years ago

Hi,

Junctions are a known problem in the field of map matching. It is not easy to avoid a wrong turn to the left or right of the trajectory with a following go back (so called u-turns). To avoid u-turns I introduced the Parameter transition weight in the plugin. But it is not easy to find the right value for it...

Smoothing the trajectory is a good idea and I will provide a possibility for preprocess the trajectory in a future version (at the moment I prepare a preprocessing of the network). Could you tell me how did you smooth your trajectory? Did you used another software, or do you have script for the Kalmen Filter (maybe open source)?

Another way could be to reduce the density of your trajectory. It looks very dense, which is a problem for the computation time. When you reduce the density you could smooth your trajectory with a statistical approach to remove outliers in the same step.

Sincerely, Christoph

brunoeducsantos commented 5 years ago

Hi, Could you refer the parameter in the code please? Is it my ?

For smoothing the trajectory I used a script from the this package.

Thanks for the feedback.

Regards,

Bruno

jagodki commented 5 years ago

Hi,

the parameter will be used in the file transition.py to calculate the routing probability (function setRoutingProbability, the parameter beta is the transition weight). Please have a look on Newson & Krumm (2009) (chapter 3.2) to get a description of this parameter. As I mentioned before, this parameter is difficult to understand and to set up, but can improve the matching results a lot. Newson & Krumm provide a formula to calculate this value. This should be implemented in the plugin, but at the moment, I do not have the time for it...

Sincerely, Christoph

brunoeducsantos commented 5 years ago

Hi @jagodki ,

Thanks for the reference. It looks a very good resource. I might try to implement later the beta formula. I will keep you posted.

Regards, Bruno