-
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
use different profiles for different areas #333
Comments
renamed for clarity |
Another exampe: trunk roads are cycleable by default in UK, but not in Denmark. |
another use case: different default values per country, for example for max speed for various way types. |
It could be done by calling Postgis from the lua profile for each way, to determine which country it's located it. The downsize is preprocesssing will be slower. Could OSRM provide an faster/easier way to determine which country each way is located in? |
@TheMarex and I were discussing this in the context of turn profiles (left/right bias, depending on country). It would also be useful to do this on an even-more-granular level, like state/province/city. One example for this is "right-turn-on-red", which is permitted in many north american locations, but is illegal in New York City, unless permitted by a sign. The same applies to Montréal. The traffic-light turn penalty should be lower where right-turn-on-red is permitted. |
I would like to implement this on a lua-level similar to how we implemented the raster feature.
Blocked by:
|
We might want to expose this country information alongside with country specific information in the response. This includes:
/cc @1ec5 |
I started sketching out support for this in this PR: #4167 The aim here would be to supply a GeoJSON file with polygons defining the boundaries of the regions you're interested in, then the |
Using location-dependent data is now possible in the profiles: Also see |
@emiltin @danpat maybe you can help me out on a specific issue I am trying to solve. Given a polygon, e.g. Paris or London, am I able to decrease the OSM speeds by X percent with this location dependent data logic? The OSM speeds make total sense for more rural areas, however diving in to metropolitan regions and comparing them to proprietary services they are too optimistic (which obviously makes sense). I think a factor would do most of the job; I'm just trying to figure out the best approach (I also looked into the traffic data options, however this is already going a step further and if I understood it correctly this will update to absolute values given in the CSV). |
Leaving this information here for anybody trying to achieve the same. In your lua file you can add this snippet after the maxspeed etc. handling.
And then just provide a (multi)polygon with something like
|
in our region there's a number of municipality, who each have specific way to organize bike traffic. they often want this reflected in how the routes works in their area. some want to put a high a priority on cycleways, others don't.
the differences only get bigger when you route across countries. one example would be left/right side driving and turn restrictions.
so it might be useful to be able to change/override speedprofile/lua parameters depending on the area you're extracting.
The text was updated successfully, but these errors were encountered: