

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

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

Routes 提供計算位置之間最佳化路徑的功能。這些功能支援需要物流規劃、距離計算和路由最佳化的應用程式。使用者也可以將位置點貼齊道路，以提高準確性。如需詳細資訊，請參閱 [Amazon Location Service Routes](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_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **尋找原始伺服器和目的地的路由多軸 **支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **尋找原始伺服器和目的地的路由輪流方向**支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **立即離開以尋找路由**支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **如果您在特定時間出發，請尋找路線**支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **如果您需要在特定時間抵達，請尋找路線**支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **尋找最短路由 **支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **尋找最快的路由 **支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **尋找替代路由**支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **尋找流量感知路由 **支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **尋找迴避的路線，例如過路費、u-turn、船、高速公路、通道等 **支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **透過傳遞多邊形或多邊形，尋找具有自訂迴避的路由**支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/location/latest/developerguide/choose-routes-apis.html) | `CalculateRoutes` |  | 
| **計算過路費 **支援以下項目：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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_tw/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_tw/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_tw/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)  |  | 