-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to draw the corresponding vehicle track #24
Comments
Hi, I am not sure if I understand your question correctly. Do you want to draw the GPS trajectory on the map (the road network)? This is the main functionality of my plugin and is described in the README on GitHub, also in a nutshell directly in the GUI of the plugin and in the paper I published (link at the end of the README, but just in german ^^). If your data has coordinates with lon/lat, does it mean, that the data has the CRS EPSG:4326? Than you should project it in a metric CRS (e.g. with UTM coordinates). If you are not familiar with QGIS and you need help to do it, please tell me exactly what do you want to do and what do you not know to reach your goals. Sincerely, |
Hello, |
Thank you for the attachment. I will have a look on it, but I need some days to find the time for it (the plugin is a free time project and my free time is currently very rare, sorry ^^). I will inform you, when I find something out. Sincerely, |
Ok, thank you very much for your reply!I look forward to your answers to my questions. |
You can read in the QGIS log, that the input parameter NETWORK is not correct. You did not provide a network layer with the geometry type LINESTRING. Such a layer is mandatory for the plugin, because the trajectory will be mapped on this network layer. Your OSM-background map cannot be used for the map matching. Try to get the road network of this area from a public service, from OSM or something else and then try tu run the plugin again with this network layer. |
For the next version (maybe in autumn or at the end of this year) I will implement a better error handling if parameters are not given by the user. |
Thank you very much for your reply!Do you mean I need to add another network layer?As a beginner, I don't know how to add a network layer. I don't understand how to" get the road network of this area from a public service, from OSM or something else."Add a network layer as shown below? What's more, my QGIS software seems to fail to respond all of a sudden.Just like this. Do you know why? |
Hi, I do not know why your QGIS freezes. On my machine it sometimes happens too. A GIS (not important which specific) is a very complex software, so it does not wonder me, that such big and special software freezes from time to time. I did not know, that you are a GIS-beginner, my fault :) My plugin needs two vector layers: a trajectory and a network layer. The network layer contains datasets/features for the edges of a road network. You can get such data e.g. from OpenStreetMap. You can download them via the plugins QuickOSM or OSMDownloader. I downloaded a network for you: Some information about this network I attached: Enough text at the moment 😸 Sincerely, |
If you start the plugin from the toolbox, a result layer will be created every time, also when the calculations will fail (thats the reason why the result layer is empty). There was a problem with the calculations of the transition probabilities. The calculations failed, if the network contained a street, that is not connected to the other streets of the network. I recently uploaded a new version of the plugin (version 2.2.2). Please upload the plugin via the plugin download manager and try it again. I would expect, that the result layer will not be empty anymore. Let's see if it works now 😸 |
Same here. I think that instead of stopping the algorithm and showing the error message regarding the transition probabilities, it remains stuck |
@love-freedom777 @CateDeku The plugin does not freeze or stuck or fail, but it calculates the transition probabilities anymore. This step can take a huge amount of time. If you start the plugin via the toolbox, the progress bar indicates only the processing steps described in the help text and in the QGIS log. It does not indicates the progress of the calculations during the individual processing steps. The control over the progress bar of the toolbox is very limited for a developer. Maybe I can improve it in a future version. If you want more information about the process of each processing step, than you have to use the main GUI of the plugin via vector menu - Offline-MapMatching. But if you start the calculations via the main GUI, you cannot use QGIS until the processing finished. @love-freedom777 I think the problem is, that your trajectory is very noisy compared to the density of roads in the network. That means that you have to choose a high maximum search distance to find at least one candidate on the network per trajectory point. The high search distance will produce a lot of candidates. And a lot of candidates result in a lot of transitions. For each transition the dijkstra algorithm will be calculated. This is the bottleneck of the plugin. Today I reduced your network more and after an half of an hour, the plugin finished with a non empty result layer 😄 Please download this file:
All described parameters has to be inserted after starting the model. To load the model, first open the graphic modeler: A lot of text ^^ Now please try it and let me know, if the map matching now works. Remember, it takes a lot of time (30 minutes on my machine). Sincerely, |
Ok, good to know. Thank you for your answers and your patience! :D |
OK,thank you very much!Do you mean to download the zip pack you sent, then follow your steps to generate a new reduced network layer, then use this network layer to run your map matching plug-in, and finally generate the expected matching path?Maybe my computer is not well configured, it will still get stuck and run for a long time without any result.Later I will switch to a better configured computer to run it.What does it look like when you run it? Can you take a look at it?Thanks again for your reply. |
Yes, that is the way you should use the zip pack. I will post a screenshot of the successful map matching on my machine during the next days. |
OK,thank you very much! |
Sorry, I forgot to send you the screenshot and I have no access to the machine I tested your data on until monday :( |
That's OK.:) |
I will describe my detailed operation process. Could you please help me see which step is wrong with me?First add the trace data set |
Hi, excuse me for my late respond. I was on the countryside during the last days with a very very poor internet access ^^ You are right, a big network results in a long computation time. The “problem” is, that the plugin calculates possible points on each dataset of the network in the range of the maximum search distance for each trajectory point, i.e. (count of trajectory points) x (possible points on the network). This results in a big number And i think, that the computation time increases exponentially with an increase of this number. Because of this I recommend to reduce the network (and/or preprocess the trajectory, but this is more complicated). I had the same experience like you when I used big datasets. The plugin freezes because it runs in the main thread of the QGIS application. During the calculations, the user interface will not be updated on every second, but after a calculation step. If the calculations need a lot of time, the user interface freezes for a long time... On your screenshots I do not see a difference between the basic and the reduced network (after using the model I provided). Did you used the default buffer distance from the model? If yes, please reduce this value to get a difference between the basic network and the reduced one. My reduced network is the result of this model. If the adjustment of the buffer radius does not result in a smaller network, than please open the QGIS log and run it again. Errors should be logged there. Sincerely, |
Really strange 🤔 Maybe I am wrong, but something on your last screenshot is not correct in my opinion. Your QGIS project has the CRS EPSG:32651, i.e. a CRS with metric coordinates. But the field with the coordinates of your cursor seems like it shows geographic coordinates. I will check your trajectory the next days, maybe my guess is wrong... |
Hi, first please update the plugin. I released a new version with the model I sent you before is integrated as a preprocessing function. The network data I provide at GitHub as a test data is downloaded via the QuickOSM plugin and is processed in PostGIS/pgRouting for getting a clean node-edge-network. But this task is not necessary. The differences between your and my network are just the attributes. But the attributes of the network will not be used by my plugin. I tested again your data. I downloaded the whole network of your city that I uploaded in this thread and I downloaded your track data too. Now my processing steps:
"field_2" LIKE '2007-02-20 00:1%' OR "field_2" LIKE '2007-02-20 00:0%'
After ca. 1 minute (on my 8-9 years old laptop ^^) I got a result: Please use this data with my settings above for reproducing my results: I hope you can reproduce my results... Sincerely, |
Oh, I am sorry. I copied the wrong file into the zip ^^ Now the complete test data: |
Hello!Using your data can actually generate the trajectory I want.I think I have solved the problem of road network data, but it seems that the data of track points always go wrong.I want to ask you what you did to the GPS track of TXT file I sent to you?Because I looked at the track data that you processed it seems to have a few more columns of key-value pairs, like "fid": 1, "timestamp": "2007/02/20" are these two added by you?And a key pair like this' coordinates' : [354337.172447311808355, 3462929.829346186015755] has it gone through a coordinate projection?How is it generated?Because when I open up my data, it's still the same latitude and longitude.Thanks again for your answer! |
That are good news, because now we come closer to the problem :) The column fid is inserted automatically by QGIS after saving your trajectory in the geopackage file type. It is an internal id for the features. The timestamp column was a try to convert the timestamps of the original trajectory into a Date/Time format for a better filtering. Both columns can be ignored and will not be used by the plugin. I just imported the trajectory into QGIS as a csv file and exported it to geopackage and added the filter. Not more. The coordinates looks a bit strange. But at the moment I am in holidays and have no QGIS or laptop here. Maybe in one or two weeks I can have a closer look on it. |
Congratulations, great to hear :) I am happy if my plugin can help some people around the world 😺 |
This issue is very helpful to me. Thank you very much! |
Hello, I am a graduate student. I would like to ask you how to draw the corresponding vehicle track on the map according to the existing GPS data set of vehicles (including longitude and latitude).Thank you. Looking forward to your reply.
Originally posted by @love-freedom777 in #22 (comment)
The text was updated successfully, but these errors were encountered: