google_directions_api library

Classes

DirectionsDuration
Details about the total duration, with the following elements:
DirectionsRequest
Settings for route calculation.
DirectionsResult
Directions responses contain the following root elements:
DirectionsRoute
When the Directions API returns results, it places them within a (JSON) routes array. Even if the service returns no results (such as if the origin and/or destination doesn't exist) it still returns an empty routes array. (XML responses consist of zero or more
DirectionsService
This service is used to calculate route between two points
DirectionsStatus
The status field within the Directions response object contains the status of the request, and may contain debugging information to help you track down why the Directions service failed.
DirectionsWaypoint
Specifies an intermediate location to include along the route between the origin and destination points as pass through or stopover location. Waypoints alter a route by directing it through the specified location(s).
Distance
Details about the total distance covered by this leg, with the following elements:
DrivingOptions
Specifies the desired time of departure and/or desired assumption of time in traffic calculation for non-transit TravelMode.
Fare
Contains the total fare (that is, the total ticket costs) on this route. This property is only returned for transit requests and only for routes where fare information is available for all transit legs. The information includes:
GeocodedWaypoint
Details about the geocoding of every waypoint, as well as origin and destination, can be found in the (JSON) geocoded_waypoints array. These can be used to infer why the service would return unexpected or no routes.
GeoCoord
A pair of latitude and longitude coordinates, stored as degrees.
GeoCoordBounds
A latitude/longitude aligned rectangle.
Leg
Each element in the legs array specifies a single leg of the journey from the origin to the destination in the calculated route. For routes that contain no waypoints, the route will consist of a single "leg," but for routes that define one or more waypoints, the route will consist of one or more legs, corresponding to the specific legs of the journey.
OverviewPolyline
Contains a single points object that holds an encoded polyline representation of the route. This polyline is an approximate (smoothed) path of the resulting directions.
Step
Each element in the steps array defines a single step of the calculated directions. A step is the most atomic unit of a direction's route, containing a single step describing a specific, single instruction on the journey. E.g. "Turn left at W. 4th St." The step not only describes the instruction but also contains distance and duration information relating to how this step relates to the following step. For example, a step denoted as "Merge onto I-80 West" may contain a duration of "37 miles" and "40 minutes," indicating that the next step is 37 miles/40 minutes from this step.
Time
Details about the time, with the following elements:
TrafficModel
Specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the durationInTraffic field in the response, which contains the predicted time in traffic based on historical averages. The trafficModel parameter may only be specified for driving directions where the request includes a departureTime.
TransitAgency
Provides information about the operator of the line, including the following properties:
TransitDetails
Transit directions return additional information that is not relevant for other modes of transportation. These additional properties are exposed through the transit object, returned as a field of an element in the steps array. From the TransitDetails object you can access additional information about the transit stop, transit line and transit agency.
TransitLine
Contains information about the transit line used in this step, and may include the following properties:
TransitMode
Specifies one or more preferred modes of transit. This parameter may only be specified for transit directions. The parameter supports the following arguments:
TransitOptions
Specifies the desired time of arrival/departure and/or desired transit types and/or desired routing preference for transit TravelMode.
TransitRoutingPreference
Specifies preferences for transit routes. Using this parameter, you can bias the options returned, rather than accepting the default best route chosen by the API. This parameter may only be specified for transit directions. The parameter supports the following arguments:
TransitStop
Contains information about the stop/station for this part of the trip. Stop details can include:
TravelMode
Represents an enum of various travel modes.
UnitSystem
Directions results contain text within distance fields that may be displayed to the user to indicate the distance of a particular "step" of the route. By default, this text uses the unit system of the origin's country or region.
Vehicle
Contains the type of vehicle used on this line. This may include the following properties:
VehicleType
Type of vehicle.
ViaWaypoint
The locations of via waypoints along this leg. contains info about points through which the route was laid