New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #2980, block highway=cycleway with access=no #2981
base: master
Are you sure you want to change the base?
Conversation
Why do we treat |
# Conflicts: # core/src/test/java/com/graphhopper/routing/util/parsers/BikeTagParserTest.java # core/src/test/java/com/graphhopper/routing/util/parsers/OSMGetOffBikeParserTest.java
Yes, you are right. Thanks! I'll update. Reduction to walking speed is included now |
Please recheck. I think that all requested improvements are included now. |
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? |
@@ -76,10 +76,13 @@ public WayAccess getAccess(ReaderWay way) { | |||
return WayAccess.CAN_SKIP; | |||
} | |||
|
|||
// use the way if it is tagged for bikes | |||
if (way.hasTag("bicycle", "dismount") || way.hasTag("highway", "cycleway")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if we have vehicle=no
and bicycle=no
or even access=no
? I think we have to somehow integrate this and the next case into the "restriction loop" (for(String value:restrict)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to block these combinations, I prepared a change.
No, I think that this would be too controversial as it would allow bicycles also on |
Looking at the details of this change I found out that it would also modify the access result for the tag combination So I'm not sure if this change is really a good idea. |
…re if this is a good idea
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. |
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 |
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
yes, could be. @ratrun (?)
Yes, this would be important if the mapping is a bit strange e.g. for vehicle=no and foot=no instead of access=no. |
I think that this would require to change the |
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.
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. |
I'm not sure if we can support such a distinction. My suggestion for this new
|
If we're not allowed to use the road either way, we can also keep |
OK.
I'm not sure if I understood this one. Using the value @karussell What do you think about the idea of changing the current |
Exactly. If access is prohibited, there's no point in duplicating this information in a GetOffBike enum value. |
isn't this accessibility information already available via
Currently I do not see a reason for this. |
Good point |
How would a custom model for bicycles theoretically look like which routes on such a combination? I put
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 Now that we have discussed the enum idea this PR is ready for merge from my point of view. Could you please check again? |
For the latest stable 9.1 you can modify bike.json and include (For older versions you would have to use the roads profile)
will do |
There was a problem hiding this comment.
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.
@@ -35,6 +35,7 @@ public void handleWayTags(int edgeId, EdgeIntAccess edgeIntAccess, ReaderWay way | |||
boolean notIntended = !way.hasTag("bicycle", INTENDED) && | |||
(GET_OFF_BIKE.contains(highway) | |||
|| way.hasTag("railway", "platform") | |||
|| (way.hasTag("vehicle", "no") && highway != null && !highway.equals("cycleway")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|| (way.hasTag("vehicle", "no") && highway != null && !highway.equals("cycleway")) | |
|| !"cycleway".equals(highway) && way.hasTag("vehicle", "no") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change that into your suggestion
return WayAccess.WAY; | ||
if (firstRestrictedKey.equals("bicycle") && way.hasTag("vehicle", "no")) { | ||
if (way.hasTag("highway", "cycleway")) | ||
return WayAccess.WAY; // Tagging error, we follow the highway value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we really consider (rare?) tagging mistakes like highway=cycleway && bicycle=no
? Or are they very frequent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we really consider (rare?) tagging mistakes like
highway=cycleway && bicycle=no
? Or are they very frequent?
I checked with overpass in Europe and except for Belgium where they seem to have ways for Mopeds tagged as such I didn't find a lot. Therefore I'll remove this special treatment.
if (value.equals("no")) { | ||
if (firstRestrictedKey.equals("vehicle")) | ||
return WayAccess.WAY; | ||
if (firstRestrictedKey.equals("bicycle") && way.hasTag("vehicle", "no")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When is way.hasTag("vehicle", "no")
true? Because I think we always return earlier for firstRestrictedKey==vehicle && value==no
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed now
I guess that here you mean a removal of the |
No description provided.