Routes Preferred API is currently available only to select customers.
Contact sales to learn more.
ComputeRouteMatrixRequest
Stay organized with collections
Save and categorize content based on your preferences.
ComputeRouteMatrix request message
Fields |
origins[] |
object (RouteMatrixOrigin )
Required. Array of origins, which determines the rows of the response matrix. Several size restrictions apply to the cardinality of origins and destinations:
- The number of elements (origins × destinations) must be no greater than 625 in any case.
- The number of elements (origins × destinations) must be no greater than 100 if routingPreference is set to
TRAFFIC_AWARE_OPTIMAL .
- The number of waypoints (origins + destinations) specified as
placeId must be no greater than 50.
|
destinations[] |
object (RouteMatrixDestination )
Required. Array of destinations, which determines the columns of the response matrix.
|
travelMode |
enum (RouteTravelMode )
Optional. Specifies the mode of transportation.
|
routingPreference |
enum (RoutingPreference )
Optional. Specifies how to compute the route. The server attempts to use the selected routing preference to compute the route. If the routing preference results in an error or an extra long latency, an error is returned. You can specify this option only when the travelMode is DRIVE or TWO_WHEELER , otherwise the request fails.
|
departureTime |
string (Timestamp format)
Optional. The departure time. If you don't set this value, this defaults to the time that you made the request. If you set this value to a time that has already occurred, the request fails. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z" .
|
RouteMatrixOrigin
A single origin for ComputeRouteMatrixRequest
Fields |
waypoint |
object (Waypoint )
Required. Origin waypoint
|
routeModifiers |
object (RouteModifiers )
Optional. Modifiers for every route that takes this as the origin
|
RouteMatrixDestination
A single destination for ComputeRouteMatrixRequest
JSON representation |
{
"waypoint": {
object (Waypoint )
}
} |
Fields |
waypoint |
object (Waypoint )
Required. Destination waypoint
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-23 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-23 UTC."],[[["The ComputeRouteMatrix request calculates travel times and distances between multiple origins and destinations."],["Requests must include origins and destinations, with optional parameters for travel mode, routing preference, and departure time."],["The maximum number of origins and destinations is limited based on routing preferences and waypoint types."],["Origins and destinations are defined using waypoints, and origins can optionally include route modifiers."]]],["The core content describes the `ComputeRouteMatrix` request, which calculates routes between multiple origins and destinations. Key actions involve specifying arrays of `origins` and `destinations`, each containing a `waypoint`. Optional parameters include `travelMode`, `routingPreference`, and `departureTime`. Size limitations apply to the number of origins and destinations: their product must not exceed 625 and no more than 50 if they are placeIds. Each `RouteMatrixOrigin` and `RouteMatrixDestination` have a `waypoint`, and `RouteMatrixOrigin` additionally allows for `routeModifiers`.\n"]]