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.
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
Detailed Road Classification #507
Detailed Road Classification #507
Changes from 4 commits
6497a7a
ba20396
083d779
3b771af
0b81298
6e410e8
01f3bfc
d3f6a8a
0792abf
cc3c88d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
And in the
outletRoadClasses
documentation, add a cross-reference like this: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.
By definition, mini roundabouts are never mapped as ways in OpenStreetMap, so they wouldn’t appear in the routing graph as an edge to assign a Mapbox Streets road class to. It’s worth confirming that this is also true of other data sources, but I’d be hard-pressed to think of a situation where it would make sense to represent a mini roundabout as a linear feature (as opposed to a full-size roundabout).
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 think we should omit these values. As these road classifications are currently used, they would only occur on linear features, not point features. They appear in the
road
layer of the Mapbox Streets source because that layer also contains point features. For example, some styles use theroad
layer’straffic_signals
-classed point features to label traffic lights with 🚦.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.
Directions team suggests to still have these values even though not all of them can really be present... So maybe we should leave it just to be safe?
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’m inclined to say YAGNI, since we could always add more cases to this non-frozen enumeration without breaking backwards compatibility, and it’s difficult to imagine a situation where the Directions API would start adding these values to edges without breaking backwards compatibility in other ways.
If we really want to be on the safe side, I guess we could leave it in but keep it undocumented. But even then, the downside is that developers still have to deal with these dead code paths whenever they deal with Streets road classes. Swift will complain about these cases being missing from any switch statement unless the developer adds a
default @unknown
clause. So I’m inclined to omit these values; if on the off chance they occur, it would be the same as an unexpected new value that the Directions API adds after the fact.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.
According to the source code, there are more cases which will never make it to the real world navigation:
pedestrian
(this one is surprising, why not?) ,construction
,track
,path
,"major_rail"
,minor_rail
,service_rail
,aerialway
,golf
.Maybe we should also not add them for now?