Respect speed limits on roads marked with OSM maxspeed tag in street export; introduce km/h speed column #188
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.
Background
https://replicahq.slack.com/archives/C02H69K05EJ/p1753902112837709
Several cases have come up over the years where customers have noticed odd speeds in the
speedscolumn of our network link export tables, which is meant to loosely reflect real-world speed limits of network links based on OSM attributes. One of the main issues with the column is that OSM Ways with themaxspeedtag explicitly present - which is supposed to represent an exact marked speed limit on the road - don't have thatmaxspeedvalue reflected in thespeedcolumn of the street export table (most larger/more important roads - the one customers care about the most - are tagged withmaxspeed).The reason for this discrepancy is the way Graphhopper deals with speeds internally. It parses the
maxspeedtag directly, but also calculates an "average" speed for every link, which scales down explicitmaxspeedvalues by a factor of0.9and fills in speeds for any links without the tag present usinghighway-based default speeds. We've been using this average speed to fill in thespeedcolumn of the network link export, resulting in confusion as to why most larger roads seem to have strangely-scaled speed values.Changes
Other (future?) approaches
While looking into fixes for this issue, I also investigated several other approaches we could take to improve the accuracy of the
speedcolumn. I decided against implementing any of these approaches in this round of changes, as they each have potential downsides that we might want to consider further:Testing
charlie