Repository navigation
Improve handling of short ferries without duration tag - #2539
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case there is a duration tag we need to use the distance of the entire way to calculate the speed (see #2528), but when it is missing we should actually use the distance of the edge instead, because there are some ferry ways that visit multiple places like this one: https://www.openstreetmap.org/way/996639224. There are also ferry ways that cross each other. In principle this could mean that a 'long' ferry is split into two 'shorter' parts for which we apply a slower speed (or will apply a slower speed when we fix #2532). But in reality this seems to only happen close to the harbour, so a long ferry really only might be split into a (still) long edge and a (very) short edge. In this case it would be fine to determine the speed for each edge separately, based on the distance of the edge not the entire way. Therefore, I now use the edge distance to determine the speed in case the duration tag is missing. So actually the same as before #2528, but different to what we did before #2457.
The other thing I changed here is I increase the distance limit under which we use the minimum speed for short ferries. Previously we used 300m, but now I use 500m, because since #2528 we use the real distance, not the beeline distance and this can be larger for curved ferry ways. One example is this ferry: https://www.openstreetmap.org/way/3549182 that otherwise would be (much) faster as the beeline distance was below 300m but the actual distance is above 300m. This would change the speed from
speedFactor/2tounknownSpeed(could be a change from 2km/h to 6km/h, so three times faster, ifspeedFactorwas 2 for example). The idea here is that we rather use the lowest possible speed for such short ferries so they are more likely to be avoided.