Skip to content

Fix for #2980, block highway=cycleway with access=no - #2981

Merged
karussell merged 16 commits into
graphhopper:masterfrom
ratrun:issue2980
Jun 14, 2024
Merged

karussell merged 16 commits into
graphhopper:masterfrom
ratrun:issue2980

Conversation

@ratrun

@ratrun ratrun commented Apr 21, 2024 •

Copy link
Copy Markdown
Contributor

@karussell

Copy link
Copy Markdown
Member

Why do we treat cycleway as special? Shouldn't we allow vehicle=no for all highway values? And reduce to walking speed.

ratrun added 4 commits April 21, 2024 17:27
# Conflicts:
#	core/src/test/java/com/graphhopper/routing/util/parsers/BikeTagParserTest.java
#	core/src/test/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParserTest.java
@ratrun

ratrun commented Apr 21, 2024

Copy link
Copy Markdown
Contributor Author

Why do we treat cycleway as special? Shouldn't we allow vehicle=no for all highway values?

Yes, you are right. Thanks! I'll update.

Reduction to walking speed is included now

@ratrun

ratrun commented Apr 21, 2024

Copy link
Copy Markdown
Contributor Author

Please recheck. I think that all requested improvements are included now.

@zidel

zidel commented Apr 21, 2024

Copy link
Copy Markdown

bicycle=no should probably also be included in the fallback to pushing. Not sure how often it occurs, but should that fallback branch check if walking is allowed?

@ratrun

ratrun commented Apr 21, 2024

Copy link
Copy Markdown
Contributor Author

bicycle=no should probably also be included in the fallback to pushing. Not sure how often it occurs, but should that fallback branch check if walking is allowed?

No, I think that this would be too controversial as it would allow bicycles also on highway=path, highway=footway or highway=path in combination with bicycle=no. This would allow bicycles basically everywhere where foot is allowed.

@ratrun

ratrun commented Apr 22, 2024 •

Copy link
Copy Markdown
Contributor Author

Why do we treat cycleway as special? Shouldn't we allow vehicle=no for all highway values?

Yes, you are right. Thanks! I'll update.

Looking at the details of this change I found out that it would also modify the access result for the tag combination highway=track or highway=path with vehicle=no. Currently we are blocking this combination and we would allow it afterwards. As this combination is often used in forest areas and most people don't get off their bikes there I'm not sure if this is what we really want. I just verified that komoot allows this combination, but there are many discussions about it even in Germany (Stichwort "Bundeswaldgesetz") and in Austria it is currently clearly forbidden according to the "Forstgesetz".

So I'm not sure if this change is really a good idea.

@otbutz

otbutz commented Apr 22, 2024

Copy link
Copy Markdown
Contributor

No, I think that this would be too controversial as it would allow bicycles also on highway=path, highway=footway or highway=path in combination with bicycle=no. This would allow bicycles basically everywhere where foot is allowed.

In Germany, at least, that's fine as long as you're pushing your bike. But that means we have to assume walking speed and display a dismount warning.

@ratrun

ratrun commented Apr 22, 2024

Copy link
Copy Markdown
Contributor Author

But that means we have to assume walking speed and display a dismount warning.

I forgot about this recent cool feature. With this functionality my previous concerns are not valid any more. Therefore I'm setting the getOffBikeEnc now and I verified that the dismount warning is displayed correctly for the tag combinations highway!=cycleway together with vehicle=no. I should have covered all comments, please re-check.

@karussell

Copy link
Copy Markdown
Member

Partly you are right @ratrun because e.g. on openstreetmap.org there are no route hints and most mappers probably use this. Could we further avoid this? Maybe e.g. avoid the cases where get_off_bike==true in the custom model bike.json?

bicycle=no should probably also be included in the fallback to pushing.

yes, could be. @ratrun (?)

Not sure how often it occurs, but should that fallback branch check if walking is allowed?

Yes, this would be important if the mapping is a bit strange e.g. for vehicle=no and foot=no instead of access=no.

@ratrun

ratrun commented Apr 23, 2024

Copy link
Copy Markdown
Contributor Author

Could we further avoid this? Maybe e.g. avoid the cases where get_off_bike==true in the custom model bike.json?

I think that this would require to change the BooleanEncodedValue of GetOffBike into an IntEncodedValue or an EnumEncodedValue such that it becomes possible to define in the custom model somehow to use bicycle=dismount but block the combination of highway!=cycleway with vehicle=no. This way it would also become possible to define a separate value encoded value for the bicycle=no case and cover the case for the Openstreetmap.org website, where no route hints are available.

@otbutz

otbutz commented Apr 23, 2024

Copy link
Copy Markdown
Contributor

e.g. on openstreetmap.org there are no route hints and most mappers probably use this. Could we further avoid this?

A bit of a slippery slope, isn't it? Following that line of reasoning, we'd have to block off all sections of road marked for dismounts or carrying other important routing information. Or to put it another way, this problem needs to be solved in the right place, which IMHO is the OSM website.

I think that this would require to change the BooleanEncodedValue of GetOffBike into an IntEncodedValue or an EnumEncodedValue

That sounds like a good idea. Being told to get off the bike by a traffic sign and voluntarily switching to pedestrian are two different things and should be treated as such.

@ratrun

ratrun commented Apr 24, 2024

Copy link
Copy Markdown
Contributor Author

Being told to get off the bike by a traffic sign and voluntarily switching to pedestrian are two different things and should be treated as such.

I'm not sure if we can support such a distinction. My suggestion for this new GetOffBike EnumEncodedValue is:

  • FALSE (current false value)
  • TRUE_WAY_TYPE (covering not suitable highway types and railway=platform)
  • TRUE_BICYCLE_NO (covering tag bicycle=no, but allowed for foot)
  • TRUE_OTHER (covering all other cases like bicycle=dismount, vehicle=no)

@otbutz

otbutz commented Apr 24, 2024

Copy link
Copy Markdown
Contributor
  • NO
  • IMPLICIT -> acting as a pedestrian
  • TRAFFIC_SIGN -> bicycle=dismount, vehicle=no
  • TRUE_BICYCLE_NO (covering tag bicycle=no, but allowed for foot)

If we're not allowed to use the road either way, we can also keep FALSE/NO.

@ratrun

ratrun commented Apr 27, 2024

Copy link
Copy Markdown
Contributor Author

@otbutz

NO
IMPLICIT -> acting as a pedestrian
TRAFFIC_SIGN -> bicycle=dismount, vehicle=no

OK.

If we're not allowed to use the road either way, we can also keep FALSE/NO.

I'm not sure if I understood this one. Using the value NO for a GetOffBike value does not sound very logical in this case. I would interpret the NO value as I don't need to get off the bike here and may keep on cycling. The NO value is used for a example on a road tagged as highway=cycleway without any access restrictions, which is pretty much the opposite in terms of suitability for bicycles. Or do you mean this is OK because we have the bike_access encoded value anyway in addition and this has higher importance?

@karussell What do you think about the idea of changing the current BooleanEncodedValue into a EnumEncodedValue ? If you agree on such a change, shall I extend this PR here our would you like a separate PR for that? I think that I should be able to also provide a corresponding PR for the graphhopper-maps project as well.

@otbutz

otbutz commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

Or do you mean this is OK because we have the bike_access encoded value anyway in addition and this has higher importance?

Exactly. If access is prohibited, there's no point in duplicating this information in a GetOffBike enum value.

@karussell

karussell commented May 13, 2024 •

Copy link
Copy Markdown
Member

IMPLICIT -> acting as a pedestrian

isn't this accessibility information already available via foot_access && !bike_access?

@karussell What do you think about the idea of changing the current BooleanEncodedValue into a EnumEncodedValue ?

Currently I do not see a reason for this.

@otbutz

otbutz commented May 14, 2024

Copy link
Copy Markdown
Contributor

isn't this accessibility information already available via foot_access && !bike_access?

Good point

@ratrun

ratrun commented May 16, 2024

Copy link
Copy Markdown
Contributor Author

isn't this accessibility information already available via foot_access && !bike_access?

How would a custom model for bicycles theoretically look like which routes on such a combination? I put foot_access and bike_access to graph.encoded_values and tried

{
  "priority": [
    { "if": "!bike_access && foot_access",  "multiply_by": "1.0" }
  ],
  "speed": [
    { "if": "!bike_access && foot_access",  "limit_to": "5.0" }
  ]
}

but this does not work. These edges are not considered as they are still not accessible for a bike. I guess that this is an issue which would need to be considered separately even if we changed the EV for the get_off_bike EV into an enum.

Now that we have discussed the enum idea this PR is ready for merge from my point of view. Could you please check again?

@karussell

karussell commented May 16, 2024 •

Copy link
Copy Markdown
Member

How would a custom model for bicycles theoretically look like which routes on such a combination?

For the latest stable 9.1 you can modify bike.json and include foot_access similarly how we soften the reverse direction of oneways with backward_bike_access.

(For older versions you would have to use the roads profile)

this PR is ready for merge from my point of view. Could you please check again?

will do

@karussell karussell left a comment •

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.

Instead of the current code in BikeCommonAccessParser: could we not just remove the vehicle key from the restrictionKeys? Because without it this would make the code more complex and this also leads to the following inconsistency: for vehicle=forestry the access is forbidden, but for vehicle=no it is allowed.

@ratrun

ratrun commented May 24, 2024

Copy link
Copy Markdown
Contributor Author

Instead of the current code in BikeCommonAccessParser: could we not just remove the vehicle key from the restrictionKeys? Because without it this would make the code more complex and this also leads to the following inconsistency: for vehicle=forestry the access is forbidden, but for vehicle=no it is allowed.

I guess that here you mean a removal of the vehicle key in the toOSMRestrictions method of OSMRoadAccessParser.java. I do not get why this would make BikeCommonAccessParser more complex, can you please explain it a little bit more? But the more important good question is if we should consequently also allow ways tagged as vehicle=forestry as EV get_off_bike sections. First I didn't want to change the blocking here because of the impact it might have on routes in forest/agriculture areas, people actually not obeying the law, and the lack of the OSM website to indicate that there are get_off_bike sections contained. But you convinced me that we also should change that.

@karussell karussell left a comment

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 do not get why this would make BikeCommonAccessParser more complex, can you please explain it a little bit more?

we can now remove the change in BikeCommonAccessParser. See my comment below.

But the more important good question is if we should consequently also allow ways tagged as vehicle=forestry as EV get_off_bike sections. First I didn't want to change the blocking here because of the impact it might have on routes in forest/agriculture areas, people actually not obeying the law, and the lack of the OSM website to indicate that there are get_off_bike sections contained. But you convinced me that we also should change that.

And is a change required in BikeCommonAverageSpeedParser because of this? Should we reduce the speed for vehicle=forestry/agricultural to walking speed? As I understand we currently skip these roads and with this change we should allow access but only with walking speed.

@ratrun

ratrun commented Jun 10, 2024

Copy link
Copy Markdown
Contributor Author

And is a change required in BikeCommonAverageSpeedParser because of this? Should we reduce the speed for vehicle=forestry/agricultural to walking speed? As I understand we currently skip these roads and with this change we should allow access but only with walking speed.

Thank you, you are right. Implemented in a6d14ff

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants