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

can you provide a more detailed usage info? #20

Closed burryxie closed 4 years ago

burryxie commented 5 years ago

Hello, I am new to QGIS and first use this plugin. I have two shp files, one is the steet network and the other is the gps track layer. I already open this two layers in QGIS and installed this plugin. but I can not select the network-layer in the input. while the trajectory layer can be detected automatically. I am really new to GIS. So I am wondering can you provide a more specific explanation for this plugin? Thank you.

jagodki commented 5 years ago

Hi,

please check the geometry type of your network. The plugin does not work with multigeometries, i.e. if your network has the geometry type MULTILINESTRING, it will not be available in the specific combo box. If your network has the geometry type LINESTRING, than it should be available. You can read this fact in the README on GitHub (last point of the chapter "Hints for usage") or in the help directly in the plugin: Bildschirmfoto 2019-06-20 um 19 24 30

If you have a MULTILINESTRING network, convert it to single geometries using e.g. the multipart to single part function, located in the vector menu: Bildschirmfoto 2019-06-20 um 19 27 20

Please let me know if this solves your problem.

Sincerely, Christoph

jagodki commented 5 years ago

@burryxie: does it work with my description now or do you have problems anymore?

Matthias84 commented 4 years ago

Thanks for the plugin and docs, but I struggle to get it working on a (IMHO) simple setup:

The cropping tool doesn't work (Output not found) and the processing stalls for ever, if I start it without any preprocessing while calc the propabilities (as in #21).

I guess giving it a try on a small city-range is a pretty common first sandbox, if people try the plugin. Maybe we can support it with a bit more details on the OSM preprocessing, so they could avoid any struggles?

jagodki commented 4 years ago

Hi @Matthias84,

Have you got any error message from the preprocessing? I am wondering, that it does not work. It is just a simple buffer generation, followed by a clipping function. Not more, but helpful for people which are not rather familiar with GIS functionalities, so that they do not have to use this functions manually.

Your trajectory data seams to be quite big. I am not a fan of time controlled trajectories because they are often really big but without more information than a way controlled one. Especially standing times are a big problem. Is it possible for you to filter your trajectory for reducing the count of points? An equidistance of 50 or 100 meters would increase the computations, I think. You could also send me the data if possible for you, than I can have a look on it on my machine (especially for the preprocessing problem).

A preprocessing function to filter/reduce the trajectory is planned, but I actually do not have the time for it :(

Sincerely, Christoph

Matthias84 commented 4 years ago

Sorry but I need to reconstruct my project again, so I can provide a step by step description:

  • 2019-11-01T09:33:32 WARNING Ungültige Algorithmuskennung für Menü: qgis:polygonstolines 2019-11-01T09:39:02 INFO Ergebnisse: {'OUTPUT': 'path_bb190387_dcd1_429d_9d75_8451167464f3'} 2019-11-01T09:39:02 INFO Ergebnisse: {'OUTPUT': 'buffer_6001b649_6798_4aca_b26e_0aad332bcdbb'} 2019-11-01T09:39:05 INFO Ergebnisse: {'OUTPUT': 'clip_6ec18998_495f_4c8a_885a_a1e5989746c8'} 2019-11-01T09:39:05 INFO Ergebnisse: {'OUTPUT': 'omm_clipped_network_58394f78_4eea_484b_b015_f66997aebe32'}
  • 2019-11-01T09:39:16 CRITICAL Fehler beim Laden des Ergebnislayers: Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python/plugins\processing\gui\Postprocessing.py", line 99, in handleAlgorithmResults outValue = parameters[out.name()] KeyError: 'OUTPUT'

If I startup the main mapmatching processing, it stalls after creating candidate graph (~5mins) when calc propabilities and never finishes.

I created a bundle of my source files: https://cloud.plattform31.de/index.php/s/RW9JXnHnsz5YYH6

jagodki commented 4 years ago

Mh, the plugin does not use the function Polygon to Lines, which seems to be the problem. All outputs in the message from 09:33 seem okay. Does the message from 09:39 have got any relation to the usage of my plugin?

I will debug the problem using your provided data during the next days and write you, when I have some results.

jagodki commented 4 years ago

I think I found two problems.

  1. your data has the CRS EPSG:4326, i.e. it has geographic coordinates. The value for the buffer radius will be interpreted using the CRS of the trajectory layer. If your trajectory has coordinates with degrees, the provided value will be used as degrees. So please reproject your data (trajectory and network!) into a metric/projected coordinate system (e.g. EPSG:25833, EPSG:25832 or EPSG:3035 should work well for your data). The preprocessing should now work.

  2. your trajectory has a lot of features. The plugin is written completely in python, without the usage of any external modules. This makes the installation very easy, but the computation time is quite long (longer than in C++ or Java...). This is a big problem for big trajectories... I started the work on a second preprocessing algorithm to reduce the density of the trajectory. The new function will allow you to the set a minimum distance between two consecutive points of the trajectory. It is not so much work, but now I have to debug it. I hope I can provide you a new version of the plugin with the new function until the weekend.

jagodki commented 4 years ago

Hi @Matthias84,

I uploaded a new version of the plugin (v2.4.0). It provides a new function to reduce the trajectory density. The function is located in the submenu „Preprocessing“. Please update the plugin and try this new function before the map matching. The computation time will increase.

Sincerely, Christoph

Matthias84 commented 4 years ago

Thank you very much! While keeping the SRS to a metric one, I managed to simplify my dataset. But unfortunatly the processing takes > 45mins for my 15min track. I will keep on playing and maybe report my learnings at a new ticket.

Anyway, thanks for your plugin and working on it :smiley: