-
Notifications
You must be signed in to change notification settings - Fork 44
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 Can I get the matched nodes? #28
Comments
Depends on the previous code on how you developed your map_con. Could you please share that? |
I had the same question, and it seems that the results of matcher.path_pred_onlynodes is not the matched points, instead of the starting nodes of the matched roads. I wonder how to get the matched points and are the points projected orthogonally onto the road network? |
Yes, there was something wrong with the |
I had the same thoughts previously while I found that this requirement cannot be fulfilled by using this package only (Maybe could but I do not know how to achieve it). Thus, I firstly use this package to match the trajectory points into the road and get the instance of "matched road", then use the "Near" principle to match origin trajectory points with the matched road. |
Setting The You can also get access to the detailed mapping by looking at |
I'm glad that my solution idea is quite similar to yours, I first applied this package to get the road geometry information, such as 'osmid' and length of every road segment. Then, I used 'Arcpy' package in Pycharm for nearest neighbor search to orthogonally project the trajectory points to the matched road. So what tools did you use to process the "Near" principle? : ) |
To clarify, you do not necessarily need an additional package to find the nearest matching point since the matching is doing this already (otherwise a package like ArcPy is a good choice). For example for the first matched point (thus with index 0), you can do:
|
Hi Wannes, Thanks for your response. It really helped. I have a query regarding the plotting of the matched points. It seems that the underlying code assumes that the matched OSM ways are straight lines, and therefore the matched GPS points seem to be not superimposed on the underlying road network when one single OSM way has some curvature. While this does not impact the map matching at all, but I would still like to get hold of the matched points on the road network. Before I dive into writing my own code for this, I was hoping if the it is possible to account for the curvature (inside the package itself)? I have attached some code and images for your reference.
The relevant code block is as follows: |
If you observe straight lines, this is probably caused by how you generate the graph that is given to the toolbox. Assuming you also use osmnx, you have to tell osmnx not to simplify curved lines into straight lines (see also issue #34):
|
Thanks. That was really helpful. One more question. Does this affect the performance of map matching? I could not notice any change between the map matching performance while using the simplified vs un-simplified graphs? Only that the un-simplified graph map matching takes longer. |
I have tested several times that if I set "use_latlon=True" then the matching will be perfect, however, "matcher.path_pred_onlynodes" will return an empty list, which means that I cannot extract the matched points and output.
What is interesting is that if I set "use_latlon=False", I can get the nodes list while the matching result is not so good.
I am wondering how this could happen and how to address it.
The text was updated successfully, but these errors were encountered: