-
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
Wrong driving time across countries with different speed limits #957
Comments
Please elaborate on what you think is wrong. Perhaps with a couple of examples. |
I prepared all the data with a speed limit for highways of 120 km/h. This is totally fine for a route from Basel to Bern within Switzerland. But as soon as I choose an origin in germany (e.g. Karlsruhe to Basel) I do get wrong driving times, since I am allowed to drive much faster. A speed limit of 130 km/h would be much more appropriate for the part of the route which is in germany. But I don't see the option to prepare data for different countries with distinct speed limits ?! |
See #333. The way you could do it, is to call Postgis from the lua profile for each way, to determine which country it's located it. The downsize is preprocesssing will be slower. |
The blog post The blog post https://www.mapbox.com/blog/osrm-using-external-data/ has as example of querying Postgis from the LUA script. |
"See #333. The way you could do it, is to call Postgis from the lua profile for each way, to determine which country it's located it. The downsize is preprocesssing will be slower." But what about a route between two countries? Imagine a route from A to C via B. B is the border (but I dont know the geo location of the border, since i don't know which route will be the fastest ). So this would mean i need to have a speed limit of 130 kmh for A to B and a speed limit of 120 kmh from B to C. |
I think perhaps you misunderstand how it would be done - you set different max speed for each individual way segment during preprocessing, depending on what country they're located in; some would get 120, others 130 - quite similar to how various tags normally influence the speed of ways. During routing, Postgis would not be accessed. I believe each way is split into individual segments at nodes before processing (true Dennis?), so usually you wouldn't have long segments straddling a border. But if you really wanted to avoid this (I don't think it would be worth it), you could preprocess OSM data to insert nodes wherever a way crosses a border, or do more complicated maxspeed computations in LUA for segments straddling a border. |
i get your point, but this sounds like a lot more pre processing time which will be needed ?! |
The way osrm works is that everything is precomputed, so route queries are fast. |
@dcdieci we allow for country specific |
Hi,
I just prepared new data for an "inter-country" routing between germany and switzerland. Point being is that both countries have different speed limits. So I need to provide two different profiles for data preparation which I did not figure out how to do it.
Please don't bother about creating this ticket as an issue. I am not sure whether it is a feature request but imho the calculated routes are wrong due to this constraint. I would be very happy to hear back from you guys.
Best,
Philip
The text was updated successfully, but these errors were encountered: