Skip to content
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

Add support for 'traffic_model' parameter #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jak
Copy link

@jak jak commented Jun 14, 2017

This PR adds support for the traffic_model parameter

From Google's docs:

traffic_model (defaults to best_guess) — Specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the duration_in_traffic field in the response, which contains the predicted time in traffic based on historical averages. The traffic_model parameter may only be specified for driving directions where the request includes a departure_time, and only if the request includes an API key or a Google Maps APIs Premium Plan client ID. The available values for this parameter are:
best_guess (default) indicates that the returned duration_in_traffic should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic. Live traffic becomes more important the closer the departure_time is to now.
pessimistic indicates that the returned duration_in_traffic should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value.
optimistic indicates that the returned duration_in_traffic should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value.
The default value of best_guess will give the most useful predictions for the vast majority of use cases. The best_guess travel time prediction may be shorter than optimistic, or alternatively, longer than pessimistic, due to the way the best_guess prediction model integrates live traffic information.

@coveralls
Copy link

coveralls commented Jun 14, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 7af6d4c on jak:add-traffic-model-parameter-to-directions into 46746fd on edwardsamuel:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7af6d4c on jak:add-traffic-model-parameter-to-directions into 46746fd on edwardsamuel:master.

@coveralls
Copy link

coveralls commented Jun 14, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 8272430 on jak:add-traffic-model-parameter-to-directions into 46746fd on edwardsamuel:master.

@jak
Copy link
Author

jak commented Aug 18, 2017

Hi @edwardsamuel

Have you got any feedback for the PR?

Thanks

@alexander-saratovcev
Copy link

Hi @edwardsamuel , any updates here, do you have a plan to include this implementation in the release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants