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
166 stars 51 forks source link

offline-mapmatching error #39

Closed Easonguo198 closed 3 years ago

Easonguo198 commented 4 years ago

Hello, I am a fan of the plugin. However, when i try to have a map matching with file i send u, ei. test.zip the computer freezed and tell nothing about errors. Can you help me to finger out what is wrong my work. By the way, i used the "model3" to reduce network.

jagodki commented 4 years ago

Hello,

Thank you for your kind words. It is always nice to hear, that the plugin is useful for other people around the world :)

I will have a look on your data during the next days and will write you my conclusion.

Sincerely, Christoph

jagodki commented 4 years ago

Hello,

the problem is, that your data has geographic coordinates (EPSG:4326). Try to reproject your data in a metric CRS. I reprojected your data into EPSG:32654 and it works like a charm:

Bildschirmfoto 2020-07-06 um 21 19 38

Two hints after looking on your data:

  1. your network has multigeometries. When you start the plugin via the toolbox, it is no problem. But if your start it from the vector menu, only layers with single geometries will be usable.
  2. Try to reduce the density of your trajectory (via preprocessing - reduce trajectory density). Try an equidistance of 50 metres for example, it will speed up the calculations a lot.

Sincerely, Christoph

Easonguo198 commented 4 years ago

Thank you for your kind explanation. But I still get stacked at the final step. Here is my error info. erro info.pdf Could u finger out what was wrong in my work. And show me a correct prossece? By the way i tried to reduce the density of my trajectory to 50 by using ur program in the mapmatching plugin, but only two point left then i give up that. I think I did a wrong operation, could u tell me about it more in detail either. Greatly thank you.

jagodki commented 4 years ago

It looks like there are too many transitions to calculate. Mostly this happens if something is not correct with the data or the search distance is too big. I created a processing model with some preprocessing steps and the final map matching: OMM Preprocessing and Matching.model3.zip

Please use your data you provided in this issue when you start the model. In the model you can see all the values I used for the parameters. The model runs approximately 2 minutes on my machine.

Easonguo198 commented 4 years ago

Hey,

Thanks for your model, I think i made it. It is so amazing! image

By the way, can i use this model on other cities mapmatching? or i should change the EPSG? such as 32655 or 653 in your model by editing them?

And if i want to measure the distance after the map matching, is there any clue in the profile table of "matched trajectory" . Since i did not find any relations between original trajectory and map matched trajectory.

Sorry about too many questions.

jagodki commented 4 years ago

Nice to hear that it works :)

You can use this model also for other cities if they are covered by the given coordinate system. But if you want a map matching e.g. in Warsaw, than you should change the EPSG in the model.

To get the total length of the matched trajectory, you have to do the following steps:

  1. call the function "Add geometry attributes" to calculate the length of all linestrings in the result layer Bildschirmfoto 2020-07-12 um 20 57 32
  2. call the function "Basic statistics or fields" to sum up the lengths of the linestrings Bildschirmfoto 2020-07-12 um 20 58 03

If you want to join your trajectory with the map matching result, please look on the fields "observation_id_start" and "observation_id_end" of the resulting table. These are the trajectory fid's corresponding to the start/end vertex of the matched linestrings. If you want to calculate the distance between the trajectory points and the matched points, you should first extract the start and end vertices of each linestring of the matched trajectory. After this you can create a join and calculate the distance between the two features.

Let me know if you have more questions, I try to help you as fast as possible :)

jagodki commented 3 years ago

closed because of inactivity, please reopen this issue if necessary