MCPcopy Index your code
hub / github.com/googlemaps/google-maps-services-python / directions

Function directions

googlemaps/directions.py:23–153  ·  view source on GitHub ↗

Get directions between an origin point and a destination point. :param origin: The address or latitude/longitude value from which you wish to calculate directions. :type origin: string, dict, list, or tuple :param destination: The address or latitude/longitude value from which

(client, origin, destination,
               mode=None, waypoints=None, alternatives=False, avoid=None,
               language=None, units=None, region=None, departure_time=None,
               arrival_time=None, optimize_waypoints=False, transit_mode=None,
               transit_routing_preference=None, traffic_model=None)

Source from the content-addressed store, hash-verified

21
22
23def directions(client, origin, destination,
24 mode=None, waypoints=None, alternatives=False, avoid=None,
25 language=None, units=None, region=None, departure_time=None,
26 arrival_time=None, optimize_waypoints=False, transit_mode=None,
27 transit_routing_preference=None, traffic_model=None):
28 """Get directions between an origin point and a destination point.
29
30 :param origin: The address or latitude/longitude value from which you wish
31 to calculate directions.
32 :type origin: string, dict, list, or tuple
33
34 :param destination: The address or latitude/longitude value from which
35 you wish to calculate directions. You can use a place_id as destination
36 by putting 'place_id:' as a prefix in the passing parameter.
37 :type destination: string, dict, list, or tuple
38
39 :param mode: Specifies the mode of transport to use when calculating
40 directions. One of "driving", "walking", "bicycling" or "transit"
41 :type mode: string
42
43 :param waypoints: Specifies an array of waypoints. Waypoints alter a
44 route by routing it through the specified location(s). To influence
45 route without adding stop prefix the waypoint with `via`, similar to
46 `waypoints = ["via:San Francisco", "via:Mountain View"]`.
47 :type waypoints: a single location, or a list of locations, where a
48 location is a string, dict, list, or tuple
49
50 :param alternatives: If True, more than one route may be returned in the
51 response.
52 :type alternatives: bool
53
54 :param avoid: Indicates that the calculated route(s) should avoid the
55 indicated features.
56 :type avoid: list or string
57
58 :param language: The language in which to return results.
59 :type language: string
60
61 :param units: Specifies the unit system to use when displaying results.
62 "metric" or "imperial"
63 :type units: string
64
65 :param region: The region code, specified as a ccTLD ("top-level domain"
66 two-character value.
67 :type region: string
68
69 :param departure_time: Specifies the desired time of departure.
70 :type departure_time: int or datetime.datetime
71
72 :param arrival_time: Specifies the desired time of arrival for transit
73 directions. Note: you can't specify both departure_time and
74 arrival_time.
75 :type arrival_time: int or datetime.datetime
76
77 :param optimize_waypoints: Optimize the provided route by rearranging the
78 waypoints in a more efficient order.
79 :type optimize_waypoints: bool
80

Callers

nothing calls this directly

Calls 1

_requestMethod · 0.80

Tested by

no test coverage detected