Skip to content
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

Error during calculation of transition probabilities #21

Closed
CateDeku opened this issue Jun 27, 2019 · 11 comments
Closed

Error during calculation of transition probabilities #21

CateDeku opened this issue Jun 27, 2019 · 11 comments
Labels
question Further information is requested

Comments

@CateDeku
Copy link

Hi, i'm trying to use this plugin, but i keep getting error message.
I have as a network layer an Open Street Map exported from their web site, and a series of GPS points as track layer.
The tool start map matching, but then suddenly stops, giving me this error: "Error during calculation of transition probabilities".
Any suggestion?

@jagodki
Copy link
Owner

jagodki commented Jun 27, 2019

Hi,

this error will be raised during the calculations of the transitions, where the direction between the two candidates (the start end end point of the transition) on the network will be compared to the direction between corresponding trajectory points. Also the distance on the network between the candidates and the the euclidean distance of the trajectory points are calculated and compared.

It can be, that the routing between the candidates is not successful, because they are not connected on the network. If the trajectory is not at the boundary of the network, you could try to decrease the maximum search distance. It could be possible, that at the boundary of the network are some line strings, that are not properly connected to the rest of the network.

You can also provide me the data, if possible and allowed, so that I can try to figure out the problem and debug the plugin with you data. Or you could share a screenshot of you trajectory and network in this issue to get some feeling for your data and possible problems.

Sincerely,
Christoph

@jagodki jagodki added the question Further information is requested label Jun 27, 2019
@CateDeku
Copy link
Author

CateDeku commented Jul 22, 2019

20190722043818-56173-data.zip
2019-05-09 1244 polo mep__20190509_1244.zip

Thank you for your answer. These are the data.
I have selected the first one as network layer, and "polo mep" as the trajectory to be matched.
I noticed that the error occur when the selected network layer has more than one "trkseg" tag

@jagodki
Copy link
Owner

jagodki commented Jul 22, 2019

Hi,

thank you for providing the data. The next days I will have a look on it. I hope I can find an answer for your problem until the weekend.

Sincerely,
Christoph

@jagodki
Copy link
Owner

jagodki commented Jul 23, 2019

Hi,

your data has the CRS EPSG:4326, i.e. the coordinates are in degrees. My plugin calculates distances , so a metric CRS is recommended. Your data is localized in Somalia and I do not know, which CRS is recommended for this region.

First I tried to reproject the data into EPSG:20538. I do not know why, but my QGIS has some problems with this CRS. It does not recognize it correctly if I import data with this CRS into a blank project. And the plugin stopped in the middle of the calculations, as you wrote.

Second I tried the CRS EPSG:32638. Now it works without problems:
matching_result

I think the selected CRS could be the problem. I am not familiar with CRS outside of Europe, so I cannot give you an explanation why the map matching will stop with EPSG:20538.

Please try to use another CRS and report your results.

Sincerely,
Christoph

P.S. The given network does not contain edges along the trajectory, i.e. the result could be a bit strange (as you can see in the screenshot above)

@CateDeku
Copy link
Author

Hi Christoph,
thank you very much for your answer. I tried to do what you suggested, but doesn't work for me. I have reprojected all the vector in QGIS, but i still got the error message.
I will try with another network layer. How can i get in QGIS a clean network graph starting from osm data? Do you have any routine to suggest?

@jagodki
Copy link
Owner

jagodki commented Jul 27, 2019

How did you reproject your layers? Using the save to-function or via the retroject-function in the toolbox. I am not sure if there are differences for the reprojection, but it could be a good idea to avoid mistakes. I used the function from the toolbox.

To create a clean network, I am using the PostGIS-function createTopology(...), i.e. you need a PostgreSQL-/PostGIS-installation. I do not know any similar function in QGIS. But I asked in the QGIS-mailing list about it. I hope somebody knows the solution 😄

@jagodki
Copy link
Owner

jagodki commented Aug 8, 2019

I got answers from the mailing list. But no plugin or build-in function mentioned in there has the same functionality like the described PostGIS function, sorry 😿

But it is really strange that the same network is working for me, but not for you...

@CateDeku
Copy link
Author

Yes, it is strange. Basically i have the same problem of @love-freedom777: with the update of the plugin now i don't receive an error message anymore, but the calculation stuck and qgis freeze and crash.

I notice that i have no problem if the network is composed of an unique line with just one segment, like this:
Screenshot (80)

while the data downloaded directly from OSM have multiple segments, and this in my case creates problems:

Screenshot (101)

@jagodki
Copy link
Owner

jagodki commented Aug 24, 2019

Hi,

Please see my last commend in issue #24. I also think, that this is the same problem. The plugin searches possible points (so called candidates) on the network for each feature/dataset/edge of the network for each trajectory point. If your network contains just one single line, the plugin finds only one candidate for each trajectory point. These candidates will be the vertices of the matched trajectory. With such a network, the computation will be fast, but the result will not be very good. Please download the processing model I provided in issue #24 to reduce your network. A description of this model is provided in #issue24.

Sincerely,
Christoph

@jagodki
Copy link
Owner

jagodki commented Sep 1, 2019

I released a new version of the plugin. Now it offers a new function to reduce your network by buffering the trajectory and clip the network using this buffer. With a reduced network the calculations should be faster. Maybe this helps you...

Sincerely,
Christoph

@jagodki
Copy link
Owner

jagodki commented Jul 1, 2021

closed because of inactivity, please reopen this issue if necessary

@jagodki jagodki closed this as completed Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants