How do I find the link of a road network that coordinate is on? (Map Matching)

1.6k Views Asked by At

I am using the osmnx library (python) to extract the road network of a city. I also have a separate data source that corresponds to GPS coordinates being sent by vehicles as they traverse the aforementioned road network. My issue is that I only have the GPS coordinates but I wish to also know which road they correspond to. I.e. I want to input a set of longitude, latitude coordinates and get the corresponding street on which that GPS coordinate lies. I believe the term for this is Map Matching.

What is the best way to do this? Preferably the solution would be using osmnx but other solutions would also be appreciated.

Note that the GPS coordinates may be noisy.

2

There are 2 best solutions below

2
On

You can do map matching with OSMnx. See the nearest_nodes and nearest_edges functions in the OSMnx documentation: https://osmnx.readthedocs.io/

0
On

My suggestion woud be to use the leuvenmapmatching package. You will get the details in the documentation of the package itself.

https://github.com/wannesm/LeuvenMapMatching