-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Support for road id #1605
Comments
The typical way to do this is to encode the ID in the "name" value here: and then parse the ID out of the name field when you display the data for the user. The problem with explicitly adding an ID to the internal data structure is that it will increase memory usage quite a lot. |
That sure does help when parsing the output of OSRM, your tip will indeed help me. Thanks! But how do you differentiate overlapping streets on an input? |
What do you mean by that? Can you point to an example in OSM? |
Here it is: Via Elevada Engenheiro Freyssinet (Elevated Way Engineer Freyssinnet) runs above Avenida Paulo de Frontin (Paulo de Frontin Avenue). The difference in their position isn't expressed in terms of lng, lat, but height. Here is a view of it on Google Street View: |
Visually those roads may overlap, but in OSM, they're modeled as separate ways, so there will be no problem routing on them or getting them confused. |
I understand that there is no problem in routing through them. My point is than given a (lng, lat) of them as origin/destination, OSRM might choose to select any of the two roads to use as origin/destination, since the (lng, lat) pair isn't enough to tell them apart. Does that make sense? |
OSRM uses a "nearest neighbor" method to find the closest spot to the requested routing point. There is no good linear referencing method for OSM right now, and even if there was one, it would be difficult for the user to enter the data properly when compared to dropping a location marker. Practically, it's not easy to draw ways directly one on top of the other, so you'll probably find that you will be able to get the pin on the correct road with a little bit of adjusting. OSRM also has a "map-matching" plug in which uses a Hidden-Markov model to match a GPS trace to the most likely route. If you're trying to snap location coordinates to the correct road, you should use the map-matching plugin, it does a pretty good job of selecting the real route if you give it enough points to work with. |
Alright, thanks. |
When querying for a route, sometimes the origin or destination is in a location that has multiple streets running above each other going to different places. If known, It would be very useful to be able to inform OSRM which one the vehicle is in.
Maybe we could inform osm_ids to complement the coordinates?
The text was updated successfully, but these errors were encountered: