graphhopper / graphhopper

Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.

Home Page:https://www.graphhopper.com/open-source/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

should locked=yes have lower priority?

karussell opened this issue · comments

This node is tagged bicycle=yes and foot=yes and locked=yes. And we cannot pass it.

Or is this incorrect tagging?

commented

An example from the OSM wiki:

Example

It's locked, yet still passable for bikes and pedestrians.

I know how this is meant. It is still discussable if this is the same way where it is passable. So IMO in the photo this would be two different ways and locked=yes means inaccessible for all transportation modes.

commented

Seems like a tagging mistake to me:

https://maps.app.goo.gl/yw1dCcgVTrKYRFBo7

If bikes are allowed and pedestrians can walk freely then yes to both but not a vehicle.

I asked question about this on forum https://discuss.graphhopper.com/t/barrier-lift-gate-is-blocking-bike/8398
I have similar node near me (Poland) which blocks routing through official cycling route.

I would vote for ignoring locked=yes if there is [access]=yes.

commented

Probably the majority of mappers uses locked=yes as equivalent to access=no and in such a case we would also let it through for bicycle=yes.

I did this change in my fork to allow bicycles when there is locked=yes. Maybe something like this could go to the main branch?

commit

        if (restrictedValues.contains(firstValue))
            return true;
        else if (node.hasTag("locked", "yes") && !intendedValues.contains(firstValue))
            return true;

I think that one also needs to take the transportation mode into regard. See master...ratrun:biketourplanner:issue2982 for a draft

@ratrun Don't we already return restrictionKeys based on transportation mode?

https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/parsers/AbstractAccessParser.java#L37

restrictionKeys.addAll(OSMRoadAccessParser.toOSMRestrictions(transportationMode));

Then below lines will return true for bicycle=yes only for bike profile, right?

String firstValue = node.getFirstValue(restrictionKeys);
intendedValues.contains(firstValue))

Don't we already return restrictionKeys based on transportation mode?

Yes, you are right. Thank you! I now simplified my change and created a PR, see #3018