Skip to content

Refine OSMGetOffBikeParser - #2389

Merged
karussell merged 2 commits into
masterfrom
unknown repository
Sep 22, 2021
Merged

karussell merged 2 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Sep 20, 2021

Copy link
Copy Markdown
  • No need to get off bike on paths
  • Adding bicycle/official and bicycle/permissive for riding

Please read our contributing guide and note that also your contribution falls under the Apache License 2.0 as outlined there.

Your first contribution should include a change where you add yourself to the CONTRIBUTORS.md file.

@karussell

Copy link
Copy Markdown
Member

Thanks @OlafFlebbeBosch this looks good! This would need a review from @ratrun :) as I'm unsure why we had getting of the bike for paths.

@boldtrn

boldtrn commented Sep 20, 2021

Copy link
Copy Markdown
Member

I'm unsure why we had getting of the bike for paths

I always thought that the idea was that most paths are narrow and might require to get off the bike if you are an insecure rider or if there is traffic coming the opposite way - a bit like "you might have to get off the bike".

I would be in favour of removing path here :)

@karussell

karussell commented Sep 20, 2021 •

Copy link
Copy Markdown
Member

Yes, although the wiki even explicitly states: "highway=path | A generic multi-use path open to non-motorized vehicles, implicitly allowed for pedestrians, cyclists, …"

if a path has foot=designated and no bicycle tags we should still mark get_off_bike as true (i.e. the default access is a bit tricky for path?)

@boldtrn

boldtrn commented Sep 20, 2021

Copy link
Copy Markdown
Member

if a path has foot=designated and no bicycle tags we should still mark get_off_bike as true (i.e. the default access is a bit tricky for path?)

Yes, probably you are right, as this would be identical to a highway=footway with no bicycles tags?

@ghost

ghost commented Sep 20, 2021

Copy link
Copy Markdown
Author

@boldtrn @karussell : As I understand the code already works the way you are proposing ? Should I add explicit tests for the scenarios at hand ?

@ratrun

ratrun commented Sep 20, 2021

Copy link
Copy Markdown
Contributor

I didn't know that the default accessibility for highway=path implicitly allows bicycles. Here in Austria most small ways in the forest are tagged like this, but accesss for bikes is usually forbidden unlike it is explicitely allowed. So this was a localisation issue - see https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions#Austria.

@karussell

Copy link
Copy Markdown
Member

I didn't know that the default accessibility for highway=path implicitly allows bicycles

Ah, ok. So this PR is fine for you?

Should I add explicit tests for the scenarios at hand ?

Yes, if I understand it correctly, it would be good to have something like this:

way = new ReaderWay(1);
way.setTag("highway", "path");
assertFalse(isGetOffBike(way));

way.setTag("footway", "yes");
assertTrue(isGetOffBike(way));

@otbutz

otbutz commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

Sounds like this would be a better fit for CountryRules to be honest.

@ghost

ghost commented Sep 21, 2021

Copy link
Copy Markdown
Author

Thanks @ratrun for the insights into Austria specific rules. I wasn't aware of these!

I will update to reinstantiate the "path" in the get off bike sections again and will see into looking the proposal of @otbutz in an follow-up PR.

@ghost

ghost commented Sep 21, 2021

Copy link
Copy Markdown
Author

Revoked the change to "path" for now. Adding a bit more tests. Hope it was ok to squash the changes

@ratrun

ratrun commented Sep 21, 2021

Copy link
Copy Markdown
Contributor

@OlafFlebbeBosch
Thanks for changing the code for path again. I believe that the correct global default is implemented and therefore I'm fine with this PR now.
@karussell Thanks for asking!

@karussell

Copy link
Copy Markdown
Member

I believe that the correct global default is implemented

How do you think should it behave without bicycle tags?

I do not think this works in this PR:

way.setTag("highway", "path");
way.setTag("footway", "yes");
assertTrue(isGetOffBike(way));

@boldtrn

boldtrn commented Sep 22, 2021

Copy link
Copy Markdown
Member

way.setTag("footway", "yes");

Do you mean foot=designated or highway=footway?

@karussell

Copy link
Copy Markdown
Member

Ah, yes "foot=designated" is probably what I meant - and if this works already then I'm fine :)

  * Adding bicycle/official and bicycle/permissive for riding
@ghost

ghost commented Sep 22, 2021

Copy link
Copy Markdown
Author

Hi, I am adding @karussell proposed test explicitly.
Sorry something went wrong while pushing the previous update. The change should be in merge-able state now.

@karussell karussell added this to the 4.0 milestone Sep 22, 2021
@karussell

Copy link
Copy Markdown
Member

Thanks @OlafFlebbeBosch !

@karussell
karussell merged commit 2e0016d into graphhopper:master Sep 22, 2021
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.

4 participants