-
Notifications
You must be signed in to change notification settings - Fork 87
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
Expose duration_typical via public API. #462
Conversation
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.
Looks good code-wise, with some opportunities for improved documentation.
Suggested changelog entry:
- Added the
DirectionsResult.typicalTravelTime
andRouteStep.typicalTravelTime
properties that indicate the typical travel time, as opposed to the current expected travel time. (#462)
@@ -139,6 +143,11 @@ open class DirectionsResult: Codable { | |||
*/ | |||
open var expectedTravelTime: TimeInterval | |||
|
|||
/** | |||
The route’s typical travel time, measured in seconds. |
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.
Should we mention any caveats to this property, such as the ones in the expectedTravelTime
documentation above?
- Does it work in every profile or just driving profiles?
- Presumably these times are still subject to the vagaries of ferry schedules.
- The developer shouldn’t assume the user would travel along the route at a fixed speed. Does the Directions API expose an attribute option (attribute) for typical travel times as it does for expected travel times?
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've added more details about duration_typical
:
duration_typical
is only available when usingdriving-traffic
profile.- Tested with route which contains ferry and both
duration
andduration_typical
are affected, mentioned this in docs. - I'll mention that user shouldn't make an assumption that travel along the route will be at a fixed speed. I also don't see that
duration_typical
is supported byAttributeOptions
.
@danpaz, not sure if you're the right person to ask, but would it be possible to update documentation in https://docs.mapbox.com/api/navigation/#retrieve-directions to contain duration_typical
related info?
/** | ||
The route’s typical travel time, measured in seconds. | ||
*/ | ||
open var typicalTravelTime: TimeInterval? |
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.
This property is on DirectionsResult rather than Route, so it’s also available on Match. Does the Map Matching API expose this value as well?
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.
Just did a few tests related to Map Matching API and don't see that duration_typical
is exposed.
c03738c
to
aeb6a2e
Compare
e5367be
to
380a3e6
Compare
Closing #459.