You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Car: Different max speed for inner and outer city #230
Currenty max speed relies on the maxspeed tag in the city or village and often streets do not have such a tag. We need to grab the boundaries of the city and take this into account.
I currently work on this, but I guess city boundaries are not an aedequate solution.
One might could use traffic_sign = city_limit, but it seems that this tag is frequently not set.
For this reason I propose right now, to use the landuse tag and take residential and commercial areas as areas with reduced speed limit.
Thanx Raphael for your input.
My approach is very similar, but to speed up computation I will assign speed limits not exactly on point but within a pixel raster. Do you have an estimate how well landuse boundarys correspond to city_limit areas?
Some comments on this:
It would be good to develop a general solution. Assigning a speed value within city boundaries is only one application. Other (currently unresolved) use cases are:
marking all ways inside an area as unaccessible, e.g. in a military restricted area
applying rules to all ways inside a natural reserve area
applying legal restrictions to all ways inside woods (there are such laws in some German states)
Putting this into a preprocessing step feels like a good idea to me. So it does not weigh down the regular import and may be executed on a different machine. I assume the memory requirements are stiff. Are your solutions based on a database?
A spontaneous idea for optimization is merging the various polygons into a single area first, then matching the ways against the smaller number of merged areas.
it's right now a simple solution, but with future generalization in mind. I hope it's ready beginning of next week for evaluation. Computation time seems to be allright, and only in the order of the current import process.
Currenty max speed relies on the maxspeed tag in the city or village and often streets do not have such a tag
My investigations suggest, that it is not missing maxspeed tags which cause counter intuitive routes, but rather the assumption that both small and larger roads with the same maxspeed also result in the same average speed, neglecting prioritised traffic flow on larger roads.
Therefore in this branch I apply the following heuristic to estimate average travel velocity: the travel speed of ways within defined areas (e.g. residential, commercial, retail) is reduced by different factors on primary, secondary, tertiary roads.
No, I mean it is not sufficient to adjust values where the maxspeed tag is missing, but also to adjust maxspeed values "within" a city by a factor depending on the highway level
All in all this increases travel time by about 10%.
In my opinion this still does not reflect true travel times, but in a second step one might take turn cost and traffic lights into consideration.
(see #334, #75)
I think an optimal solution would take real world travel times into account and would adjust the heuristic to reflect them. But for this one would need an extensive dataset of such travel data. Anyone aware of this?
This branch now only assigns speed values to streets within citys where the maxspeed tag is missing. But this has only a minor effect on traveltimes. Also, the approach to use landuse = residential | industrial | retail to detect city regions, seems to be a bit problematic, because there are citys (e.g. madrid) where large areas are not tagged. (Although for germany it seems OK).
In general this code allows to apply region specific speed limits. So one might could reuse this code to implement country specific speed limits (#175) or for other cases.
@jansoe: Your above referenced branch tree/CitySpeedMerge returns a now "404 Not found". I wanted to take a look on what you did in this branch. Could you provide this work again?
@karussell apologies for nudging an old issue. Is there some guidance or direction (perhaps elsewhere) that you could share for options to help with routing and the associated duration calculations within urban centers? We're finding that we get a lot of routes traversing through urban centers with lots of traffic lights where it's very unlikely that the maxspeed on those ways will be accurate for an average speed approximation when compared to the maxspeed for nearby motorway routing options.
Activity
jansoe commentedon Feb 18, 2015
I currently work on this, but I guess city boundaries are not an aedequate solution.
One might could use
traffic_sign = city_limit, but it seems that this tag is frequently not set.For this reason I propose right now, to use the landuse tag and take
residentialandcommercialareas as areas with reduced speed limit.jansoe commentedon Feb 18, 2015
what do you use as boundary? I think administrative boundaries are too loose (e.g. http://www.openstreetmap.org/relation/66527#map=13/51.2105/7.0547)?
Is it also landuse=residential (http://www.openstreetmap.org/relation/1537220#map=14/51.1898/7.0176)?
jansoe commentedon Feb 19, 2015
Thanx Raphael for your input.
My approach is very similar, but to speed up computation I will assign speed limits not exactly on point but within a pixel raster. Do you have an estimate how well landuse boundarys correspond to
city_limitareas?NopMap commentedon Feb 19, 2015
Some comments on this:
It would be good to develop a general solution. Assigning a speed value within city boundaries is only one application. Other (currently unresolved) use cases are:
Putting this into a preprocessing step feels like a good idea to me. So it does not weigh down the regular import and may be executed on a different machine. I assume the memory requirements are stiff. Are your solutions based on a database?
A spontaneous idea for optimization is merging the various polygons into a single area first, then matching the ways against the smaller number of merged areas.
bye, Nop
karussell commentedon Feb 19, 2015
Other use cases could be "prefer ways for bikes in a forest" etc
But as it is tricky on its own making it generic from the start is overkill. As always: step by step :)
For worldwide we expect roughly 10% more RAM.
A similar approach will be used (a 'simple' grid assigning boolean values)
No. GraphHopper will not depend on an external thing to administrate. An internal java based database might be used for the import though. See #220
jansoe commentedon Feb 19, 2015
it's right now a simple solution, but with future generalization in mind. I hope it's ready beginning of next week for evaluation. Computation time seems to be allright, and only in the order of the current import process.
jansoe commentedon Mar 23, 2015
My investigations suggest, that it is not missing maxspeed tags which cause counter intuitive routes, but rather the assumption that both small and larger roads with the same maxspeed also result in the same average speed, neglecting prioritised traffic flow on larger roads.
Therefore in this branch I apply the following heuristic to estimate average travel velocity: the travel speed of ways within defined areas (e.g. residential, commercial, retail) is reduced by different factors on primary, secondary, tertiary roads.
In my opininon this leads to more intuitive roads
old:


new:
old:


new:
karussell commentedon Mar 23, 2015
You mean that these improvements are possible without the difference of inner and outer city?
jansoe commentedon Mar 23, 2015
No, I mean it is not sufficient to adjust values where the maxspeed tag is missing, but also to adjust maxspeed values "within" a city by a factor depending on the highway level
karussell commentedon Mar 23, 2015
Thanks for clarification & nice! I'll play with it tomorrow!
jansoe commentedon Mar 23, 2015
All in all this increases travel time by about 10%.
In my opinion this still does not reflect true travel times, but in a second step one might take turn cost and traffic lights into consideration.
(see #334, #75)
I think an optimal solution would take real world travel times into account and would adjust the heuristic to reflect them. But for this one would need an extensive dataset of such travel data. Anyone aware of this?
jansoe commentedon Apr 20, 2015
This branch now only assigns speed values to streets within citys where the maxspeed tag is missing. But this has only a minor effect on traveltimes. Also, the approach to use
landuse = residential | industrial | retailto detect city regions, seems to be a bit problematic, because there are citys (e.g. madrid) where large areas are not tagged. (Although for germany it seems OK).In general this code allows to apply region specific speed limits. So one might could reuse this code to implement country specific speed limits (#175) or for other cases.
ratrun commentedon Aug 15, 2015
@jansoe: Your above referenced branch tree/CitySpeedMerge returns a now "404 Not found". I wanted to take a look on what you did in this branch. Could you provide this work again?
karussell commentedon Aug 22, 2015
@ratrun @jansoe the branch would be helpful for me too :)
jansoe commentedon Sep 2, 2015
@ratrun @karussell
sorry for the delayed reaction time, but now the branch is again online. don't hesitate to ask questions, if anything seems unclear
dteirney commentedon Mar 31, 2022
@karussell apologies for nudging an old issue. Is there some guidance or direction (perhaps elsewhere) that you could share for options to help with routing and the associated duration calculations within urban centers? We're finding that we get a lot of routes traversing through urban centers with lots of traffic lights where it's very unlikely that the maxspeed on those ways will be accurate for an average speed approximation when compared to the maxspeed for nearby motorway routing options.
karussell commentedon Mar 31, 2022
See also the recent discussion in #2395. This should be a foundation to improve the ETAs and avoiding city centers.
Longpress handler (graphhopper#230)