Repository navigation
Improve bike handling for highway=living_street - #3032
Conversation
| if (way.getTag("highway", "").equals("living_street")) | ||
| return !isValidSpeed(maxSpeed) ? highwaySpeeds.get("living_street") : maxSpeed <= highwaySpeeds.get("cycleway") ? maxSpeed : highwaySpeeds.get("cycleway"); |
There was a problem hiding this comment.
We should either avoid this or make it consistent for other highway types like service. IMO it is inconsistent because the following test currently fails:
way.setTag("maxspeed", "20");
way.setTag("highway", "service");
assertPriorityAndSpeed(PREFER, 18, way);
I'm in favour of removing this to keep it simple and rely on the highway type and tracktype/surface alone to define the speed and use maxspeed only to decrease it.
Handling higher defaults speeds for living_street should be done elsewhere.
There was a problem hiding this comment.
We should either avoid this or make it consistent for other highway types like service.
I checked other highway types for which we assume a smaller speed compared to the 18km/h for cycleway. You are right. For service, path, track, pedestrian, and footway the combination with presence of the maxspeed tag seems to make sense in most cases. I checked this with overpass. For the few steps these must be tagging errors, but they are so few that these cases can be ignored.
I'm in favour of removing this to keep it simple and rely on the highway type and tracktype/surface alone to define the speed and use maxspeed only to decrease it.
Now that I saw in overpass how many cases these are I prefer the little more complex, but I believe better and generic solution. This solution should work that same way as I tried for the living_street, but irrespective of the highway type, and also taking the limitation of the tracktype/surface/smoothness into account so that these limits never get overwritten. Or do you think that this would become too complex?
There was a problem hiding this comment.
Please see 52f4496. If you agree with this I will change the title of this PR into "Run bicycles at tagged maxspeed if allowed and possible"
There was a problem hiding this comment.
I think this change is too heavy and I'm not convinced that it improves the bike routing. Because afterwards roads with a max_speed tag will be very likely preferred which is not what we want. The main criteria for bike routing should stay the highway and surface/tracktype tags. The chance to make the routing do unexpected things increases when we consider more tags or make more tags higher priority. Do you know what I mean?
There was a problem hiding this comment.
Do you know what I mean?
Sorry, but I cannot quite follow your concerns. The modifications change the behavior only for ways for which we assume a lower highway speed compared to the tagged maxspeed . So the change is effective only for living_street, service, path, track, pedestrian , road and footway. steps are excluded in the code.
Because afterwards roads with a max_speed tag will be very likely preferred which is not what we want.
As you choose the term "roads" in plural here I believe that you thought the other more car centric highway types might also be covered. I don't think that this is the case. Or did you mean the road highway type only?
Would it be possible to name a situation by which you can illustrate your concerns more specifically? Maybe by an additional test?
The main criteria for bike routing should stay the highway and surface/tracktype tags.
Agreed, but I think that this is still the case. And we are already considering the maxspeed as an upper limit.
There was a problem hiding this comment.
@karussell May I ask you to look at the last questions, it looks as you missed it. Thanks in advance!
There was a problem hiding this comment.
The problem I see is that the maxspeed does not say anything about the possible speed. And so it could be that if we increase the speed due to the maxspeed we introduce more problems than we expected and would have to reduce the speed again due to bad surface or similar.
I.e. it seems to be atm unnecessary complex to fix such a small problem (the problem does not seem to be too widespread?). And then I would rather avoid a substantial change like this.
Couldn't we increase the speed for living_street to 6km/h and keep the rest unchanged to improve the general unnecessary avoidance of living_street due to slow speed?
There was a problem hiding this comment.
Couldn't we increase the speed for living_street to 6km/h and keep the rest unchanged to improve the general unnecessary avoidance of living_street due to slow speed?
OK, even tough I consider this more a hack I changed the code according to this proposal. Please check again.
# Conflicts: # core/src/main/java/com/graphhopper/routing/util/parsers/BikeCommonAverageSpeedParser.java # core/src/test/java/com/graphhopper/GraphHopperTest.java
…hway speed to 6 for bicycles as suggested in review
This fixes #3029 and improves the bicycle handling for
highway=living_street.