Skip to content

Add support for bike mtb:scale accessibility - #3048

Merged
karussell merged 8 commits into
graphhopper:masterfrom
ratrun:bikes_mtb_scale
Oct 16, 2024
Merged

karussell merged 8 commits into
graphhopper:masterfrom
ratrun:bikes_mtb_scale

Conversation

@ratrun

@ratrun ratrun commented Sep 7, 2024

Copy link
Copy Markdown
Contributor

Triggered by the discussion in https://community.openstreetmap.org/t/consuming-highway-path-take-2/118175 I detected that currently we do not support the mtb:scale tag for the bicycles yet at all. This PR adds support for the detection of the accessibility. This does make sense in order to increase the safety of the suggested routes.

I was thinking about adding additional support for control of the priority detection, but came to the conclusion that this is not necessary as according to taginfo we are already handling the most often combined tags. Handling the prioritization stuff twice does not make sense.

@karussell

Copy link
Copy Markdown
Member

Why can't we use mtb_rating in the different bike custom models?

@ratrun

ratrun commented Sep 9, 2024

Copy link
Copy Markdown
Contributor Author

Why can't we use mtb_rating in the different bike custom models?

Until now I only de-priorities encoded values and never blocked it. Would total blocking be possible via a custom rule, e.g. by assigning a speed of 0? Additionally the sac_scale is also handled in the parser and for symmetry we should do the same as this avoidance better should be available even without any custom model.

@karussell

Copy link
Copy Markdown
Member

Would total blocking be possible via a custom rule, e.g. by assigning a speed of 0?

Usually via a priority of 0.

Additionally the sac_scale is also handled in the parser and for symmetry we should do the same as this avoidance better should be available even without any custom model.

It would be nice if we can move it out of the parser too as it is already partially. As you can see with the mtb scale, the special handling with + and - needs to be duplicated here again.

@ratrun

ratrun commented Sep 14, 2024

Copy link
Copy Markdown
Contributor Author

It would be nice if we can move it out of the parser too as it is already partially. As you can see with the mtb scale, the special handling with + and - needs to be duplicated here again.

Thank you. OK, I will try it. But what is the best way to test if a modified custom rule actually works as intended? Do I need to find and test this with real world examples?

@karussell

Copy link
Copy Markdown
Member

But what is the best way to test if a modified custom rule actually works as intended? Do I need to find and test this with real world examples?

You can also load and test a custom model in the unit tests - see the utility method GHUtility.loadCustomModelFromJar and where/how it is used in tests (e.g. testHikePrivate).

@ratrun

ratrun commented Sep 14, 2024

Copy link
Copy Markdown
Contributor Author

Now I moved the sac_sale and mtb:scale handling for bicycles to the custom models. The PR therefore became much more complex then before. But now I think I understand what you mean when you say that the long term goal is to move the weighting completely into the custom models.

# Conflicts:
#	web/src/test/java/com/graphhopper/application/resources/RouteResourceCustomModelTest.java
@ratrun

ratrun commented Oct 4, 2024

Copy link
Copy Markdown
Contributor Author

@karussell Did you miss this PR? Usually you responded very fast, but lately a couple of PRs are hanging around. I hope you are doing fine?

@karussell

Copy link
Copy Markdown
Member

Thanks you for your work :)

This looks good, but will need to review it a bit deeper.

Did you already have time to test it for some real world cases? If yes, can you point me to one hike and one mtb case where this PR is important and makes a difference?

@ratrun

ratrun commented Oct 4, 2024 •

Copy link
Copy Markdown
Contributor Author

Did you already have time to test it for some real world cases? If yes, can you point me to one hike and one mtb case where this PR is important and makes a difference?

Yes, for mtb:scale=2, you find the example with screenshots of the result in #3049 . For the sake of completeness here is the example link.

The result for sac_scale should be the same compared to before as only the implementation has changed. Here is an example I found via overpass

@karussell

Copy link
Copy Markdown
Member

Should we really hard exclude those ways for bike? Isn't it the same like for steps that one could get off the bike and push (or even carry) the bike? But probably seldom in practise that a way with mtb:scale is the only path to the destination.

@ratrun

ratrun commented Oct 12, 2024 •

Copy link
Copy Markdown
Contributor Author

Should we really hard exclude those ways for bike? Isn't it the same like for steps that one could get off the bike and push (or even carry) the bike? But probably seldom in practise that a way with mtb:scale is the only path to the destination.

I'm undecided about this. What would you suggest? Is
{ "if": "mtb_rating > 2", "multiply_by": "0.1" },
better?

@karussell

Copy link
Copy Markdown
Member

Yes, something like this. But maybe we keep it as you suggested for now and if there are problems with this fix this according to real world examples?

@ratrun

ratrun commented Oct 15, 2024

Copy link
Copy Markdown
Contributor Author

But maybe we keep it as you suggested for now and if there are problems with this fix this according to real world examples?

Given the long time we didn't consider the tag mtb:scale this might take another 10 years 🥲 , but I'm fine with it.

@karussell karussell added this to the 10.0 milestone Oct 16, 2024
@karussell
karussell merged commit 24df953 into graphhopper:master Oct 16, 2024
@karussell

Copy link
Copy Markdown
Member

Thanks for this change!

yo-han added a commit to climbfinder/graphhopper that referenced this pull request Oct 26, 2026
…ed for bicycles or paved

Ported from the climbfinder fork on 9.x (4bbad2c). Upstream removed sac_scale
from the bike access parsers in graphhopper#3048 and blocks
hike_rating > 1 in its custom models instead. Our exception, a way that carries
any bicycle tag stays open, cannot be written as a custom model condition, so
RacingBikeAccessParser keeps it as an access rule. The probe against the
production jar shows no sac_scale difference left; the remaining differences are
bridleway and bicycle=destination, both upstream changes (see the PR).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants