

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 路线 APIs
<a name="choose-routes-apis"></a>

路线 API 可计算不同地点之间的优化路径。这些功能支持需要进行物流规划、距离计算和路线优化的应用程序。用户还可以将位置点与道路对齐，以提高准确性。有关更多信息，请参阅[Amazon Location Service 路线](routes.md)。
+ **CalculateIsolines**：根据行驶时间或距离生成等值线，可用于定义服务区或可达区域。有关更多信息，请参阅[计算等值线](calculate-isolines.md)。
+ **CalculateRouteMatrix**：提供多个出发地和目的地之间的距离和旅行时间的矩阵，为后勤和行程计划提供支持。有关更多信息，请参阅[计算路线矩阵](calculate-route-matrix.md)。
+ **CalculateRoutes**：计算多站导航的 point-to-point优化路线，包括可自定义的路线偏好。有关更多信息，请参阅[计算路线](calculate-routes.md)。
+ **OptimizeWaypoints**：优化航点顺序以获得最高效的行驶路线，从而最大限度地减少距离或时间。有关更多信息，请参阅[优化航点](actions-optimize-waypoints.md)。
+ **SnapToRoads**：将坐标与最近的道路对齐，通过将点捕捉到已知道路来提高 GPS 精度。有关更多信息，请参阅[与道路对齐](snap-to-roads.md)。

下表列出了一些最好使用 Routes 解决的业务用例 APIs。


| **业务需求** | **有用的 API** | **示例** | 
| --- | --- | --- | 
| **计算出发地和目的地的行程距离和时间**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **查找出发地和目的地的路线折线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **查找出发地和目的地的路线逐向指引**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **立即出发时查找路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **在特定时间出发时查找路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **需要在特定时间到达时查找路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **查找最短路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **查找最快路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **查找替代路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **查找具有交通状况感知功能的路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **查找具有避让功能（例如避让收费公路、掉头路线、渡轮、高速公路、隧道等）的路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **通过传递折线或多边形来查找具有自定义避让功能的路线**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **计算通行费**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` | [计算通行费](calculate-toll-cost.md) | 
| **查找路线上某路段的限速**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **在地图上绘制路线**支持航点标记。 | `GetTile`并`GetStyleDescriptor`使用带有计算路径的渲染引擎 (MapLibre)  |  | 
| **为多个出发地和目的地计算距离和时间的路线矩阵**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRouteMatrix` | [如何为多个出发地和目的地计算距离和时间的路线矩阵](calculate-route-matrix-distance.md) | 
| **在避让情况下计算路线矩阵**支持以下各项：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/choose-routes-apis.html) | `CalculateRouteMatrix` | [如何在避让情况下计算路线矩阵](calculate-route-matrix-with-avoidance.md) | 
| **根据时间（等时线）计算服务区域**支持卡车、行人、汽车和踏板车等出行模式。 | `CalculateIsolines` | [如何根据时间范围计算服务区域](calculate-service-area-based-on-time.md) | 
| **根据距离（等距线）计算服务区域**支持卡车、行人、汽车和踏板车等出行模式。 | `CalculateIsolines` |  | 
| **在避让情况下计算服务区域**支持卡车、行人、汽车和踏板车等出行模式。 | `CalculateIsolines` |  | 
|  **从相反的方向计算服务区域** 支持卡车、行人、汽车和踏板车等出行模式。  | `CalculateIsolines` |  | 
|  **计算多时间或距离范围内的服务区域** 支持卡车、行人、汽车和踏板车等出行模式。  | `CalculateIsolines` |  | 
| **优化路线的航点（旅行推销员问题）** 支持卡车、行人、汽车和踏板车等出行模式。  | `OptimizeWaypoint` | [如何优化路线的航点](optimize-waypoints.md) | 
| **优化具有交通状况感知功能的路线的航点** 支持卡车、行人、汽车和踏板车等出行模式。  | `OptimizeWaypoint` |  | 
| **优化具有通行时间感知功能的路线的航点** 支持卡车、行人、汽车和踏板车等出行模式。 | `OptimizeWaypoint` |  | 
| **将 GPS 轨迹与道路网络匹配**支持卡车、行人、汽车和踏板车等出行模式。 | 与道路对齐  | [如何将 GPS 轨迹与道路网络匹配](how-to-match-gps-traces.md) | 
| **在地图上呈现匹配的 GPS 轨迹**支持卡车、行人、汽车和踏板车等出行模式。 | `GetStyleDescriptor`使用带有 Snap to road 的渲染引擎 (MapLibre)  |  | 