查询起终点路线并推荐交通方式
amap_get_directionsResolve two addresses to coordinates, compare walking, driving, and transit routes, and get distance, duration, and recommended travel mode with step-by-step directions.
Instructions
主要入口:输入起点和终点地址/地点,一次解析真实坐标,比较步行、驾车和公交,返回距离、耗时、关键步骤及推荐交通方式。单个方式失败时仍返回其他可用方案。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modes | No | 需要比较的交通方式,默认同时查询步行、驾车和公交 | |
| origin | Yes | 起点的地点名、POI 或完整地址 | |
| destination | Yes | 终点的地点名、POI 或完整地址 | |
| origin_city | No | 可选的起点城市名或 adcode,用于地点消歧和公交规划 | |
| destination_city | No | 可选的终点城市名或 adcode,用于地点消歧和跨城公交 | |
| driving_strategy | No | 可选的高德驾车 strategy |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| tool | Yes | ||
| error | No | ||
| summary | Yes | ||
| metadata | Yes |