Routes Preferred API 目前仅适用于部分客户。如需了解详情,请
与销售人员联系。
ComputeRouteMatrixRequest
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
字段 |
origins[] |
object (RouteMatrixOrigin )
必需。来源数组,用于确定响应矩阵的行。起点和目的地的基数受到以下大小限制:
- 在任何情况下,元素(出发地 × 目的地)的数量都不得超过 625 个。
- 如果 routingPreference 设置为
TRAFFIC_AWARE_OPTIMAL ,元素数量(起点 × 终点)不得超过 100。
- 指定为
placeId 的路点(起点 + 终点)的数量不得超过 50 个。
|
destinations[] |
object (RouteMatrixDestination )
必需。目的地数组,用于确定响应矩阵的列。
|
travelMode |
enum (RouteTravelMode )
可选。指定交通方式。
|
routingPreference |
enum (RoutingPreference )
可选。指定如何计算路线。服务器会尝试使用所选的路由偏好设置来计算路由。如果路由偏好设置导致错误或延迟时间过长,则返回错误。只有当 travelMode 为 DRIVE 或 TWO_WHEELER 时,您才能指定此选项,否则请求会失败。
|
departureTime |
string (Timestamp format)
可选。出发时间。如果您未设置此值,则默认为您发出请求的时间。如果您将此值设置为已过的时间,请求将失败。 时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
RouteMatrixOrigin
ComputeRouteMatrixRequest 的单个来源
RouteMatrixDestination
ComputeRouteMatrixRequest 的单个目的地
JSON 表示法 |
{
"waypoint": {
object (Waypoint )
}
} |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-11。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-11-11。"],[[["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"]]