Skip to content

Improve bike handling for highway=living_street - #3032

Merged
karussell merged 6 commits into
graphhopper:masterfrom
ratrun:bike_living_street
Dec 4, 2024
Merged

karussell merged 6 commits into
graphhopper:masterfrom
ratrun:bike_living_street

Conversation

@ratrun

@ratrun ratrun commented Jun 28, 2024

Copy link
Copy Markdown
Contributor

This fixes #3029 and improves the bicycle handling for highway=living_street.

Comment on lines +122 to +123
if (way.getTag("highway", "").equals("living_street"))
return !isValidSpeed(maxSpeed) ? highwaySpeeds.get("living_street") : maxSpeed <= highwaySpeeds.get("cycleway") ? maxSpeed : highwaySpeeds.get("cycleway");

@karussell karussell Jul 6, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ratrun ratrun Jul 6, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@ratrun ratrun Jul 18, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karussell May I ask you to look at the last questions, it looks as you missed it. Thanks in advance!

@karussell karussell Nov 26, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

ratrun added 5 commits July 7, 2024 07:00
# 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
@karussell karussell added this to the 11.0 milestone Dec 4, 2024
@karussell
karussell merged commit 261fd2f into graphhopper:master Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

living_street for bike is avoided

2 participants