Skip to content

Remove ferry argument from TagParser#handleWayTags #2465

Closed

Description

@easbar

We use the ferry parameter of handleWayTags to determine the RoadEnvironment in OSMRoadEnvironmentParser. For others like OSMRoadClassParser and OSMRoundaboutParser we only use it as a (very minor) performance optimization so we can return early if ferry=true. The ferry parameter is a bit strange though, because it tells us whether or not any of the encoders returned Access.FERRY in FlagEncoder#getAccess. This means its value depends on which encoders were included for the import and the RoadEnvironment might change simply because we add/remove some vehicles. This doesn't really make sense?! Can we not simply set RoadEnvironment=FERRY iff route=ferry? In this case we won't need the ferry parameter at all.

The other interesting value here is RoadEnvironment.SHUTTLE_TRAIN, but I think we currently hardly ever (or never?) use it. Take for example this route (one of 41(!) shuttle_train routes on the planet according to taginfo): https://www.openstreetmap.org/way/327715897 and this corresponding route. If we used only the foot encoder this would be a 'tunnel', but since we use foot+car it is recognized as a 'ferry'. Only if the tunnel=yes tag wasn't there and we only used the foot and/or bike encoder it would be 'shuttle_train'.

We use RoadEnvironment.FERRY for a few things like ferry interpolation and snap prevention, but we don't do this for SHUTTLE_TRAIN. So I think we either should set RoadEnvironment.FERRY for all ways with route=ferry||shuttle_train or if we decide to keep both values we will need to do this special handling for SHUTTLE_TRAIN as well. In any case this encoded value should not depend on which flag encoders are included and the ferry argument in TagParser#handleWayTags can/should be removed?!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions