Skip to content
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

User adjustable speed capping #480

Closed
aoles opened this issue Mar 26, 2019 · 4 comments · Fixed by #740
Closed

User adjustable speed capping #480

aoles opened this issue Mar 26, 2019 · 4 comments · Fixed by #740

Comments

@aoles
Copy link
Member

aoles commented Mar 26, 2019

After removing maximum_speed we've received some feedback that in certain scenarios this option has been actually useful.

It might be feasible to still support it even with CALT, but within a limited range such that it only affects high-speed roads, some of which are filtered out by avoid=highways anyway.

@rabidllama
Copy link
Contributor

If we don't want to be going in and affecting the build process (which for now is probably something we shouldn't be doing) and results don't need to be particularly accurate, then one option would be to take the duration returned for segments, calculate the average speed and if that is greater than the maximum speed then we do some simple capping to get a result that is within the time frame of the maximum speed. A very basic concept would be

if ((distance/duration) > maxSpeed) {
  // update duration to be limited by the speed i.e. duration = distance/maxSpeed
} 

That might be enough to update the driving times as it might well be the case that the vehicles will still use the same roads as if they were not limiting speed (motorways normally just limit speed rather than completely restricting access)

@aoles
Copy link
Member Author

aoles commented Mar 26, 2019

Thanks @rabidllama ! My reasoning here is: if we allow the maximum speed to be adjustable not in a arbitrary range but starting only from say, max_speed=80 km/h, than hopefully the amount of roads which allow higher speeds than max_speed will be a relatively low fraction of the whole routable road network and could be integrated into core. Needs to be verified, though.

Personally I'm not convinced by the heuristic of routing on a graph with unaltered speeds and scaling the travel time only afterwards. My concern here is that even though most of the time it would probably yield decent results it would never guarantee to find the optimal route, so not sure how helpful from the user perspective this in the end would be?

@aoles
Copy link
Member Author

aoles commented Apr 4, 2019

I did a very quick and basic analysis on DACH region using the test_maxspeed branch by just dumping speed assignments and binning them with the following R script.

For example, the number of ways with speed > 80 km/h is around 3%. This number already includes most of the highways which according to a former analysis constitute around 1% of the road network. After subtracting these we end up at 2%. By the end of the day it indeed seems feasible to allow dynamic filtering on max_speed > 80 km/h, however, we need to keep in mind that this would roughly double the size of the core.

image

speed <- as.integer(readLines("~/RData/speed.txt"))

tab <- table(speed)

# filter out artifacts
tab <- tab[tab > 1]

plot(tab)

# count the percentage of ways with speed above the given treshold
treshold = 80
sum(tab[as.integer(names(tab)) > treshold]) / sum(tab)

@TimMcCauley
Copy link
Contributor

@aoles nice finding - let's definitely consider this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants