骑行路径规划
GET
/v4/direction/bicycling接口简介:
骑行路径规划用于规划骑行通勤方案,规划时不会考虑路况;考虑天桥、单行线、封路等情况。最大支持 500km 的骑行路线规划。
parameters代表的参数包括必填参数和可选参数。所有参数均使用和号字符(&)进行分隔。下面的列表枚举了这些参数及其使用规则。
- 服务示例
https://restapi.amap.com/v4/direction/bicycling?origin=116.434307,39.90909&destination=116.434307,39.90909&key=<用户的key>
参数 | 值 | 备注 | 必选 |
---|---|---|---|
origin | 起点经纬度 | 是 | |
destination | 终点经纬度 | 是 |
请求参数
Query 参数
origin
string
必需
出发点经纬度 填入规则:X,Y,采用","分隔,例如“ 117.500244, 40.417801 ” 小数点后不得超过6位
示例值:
116.434307,39.90909
destination
string
必需
填入规则:X,Y,采用","分隔,例如“ 117.500244, 40.417801 ” 小数点后不得超过6位
示例值:
116.434446,39.90816
parameters
string
可选
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
data
object
必需
对象 里面包含具体内容
origin
string
必需
起点坐标 格式:X,Y
destination
string
必需
终点坐标 格式:X,Y
paths
object
必需
数组 骑行方案列表信息
errcode
string
必需
返回结果码 0,表示成功
errdetail
string
必需
具体错误原因 此字段会详细说明错误原因
errmsg
string
必需
示例成功示例
{
"data": {
"destination": "116.434446,39.90816",
"origin": "116.434307,39.90909",
"paths": [
{
"distance": 215,
"duration": 52,
"steps": [
{
"action": "右转",
"assistant_action": "",
"distance": 54,
"duration": 13,
"instruction": "骑行54米右转",
"orientation": "",
"polyline": "116.434323,39.909041;116.434965,39.909041",
"road": "",
"walk_type": 0
},
{
"action": "右转",
"assistant_action": "",
"distance": 114,
"duration": 27,
"instruction": "沿建国门北大街向南骑行114米右转",
"orientation": "南",
"polyline": "116.434965,39.909041;116.434965,39.909028;116.434931,39.908932;116.434887,39.908867;116.434887,39.908867;116.434831,39.908724;116.434818,39.908655;116.434818,39.908542;116.434826,39.908424;116.434883,39.908303;116.434883,39.908303;116.434974,39.908194;116.434996,39.908142;116.435009,39.908103;116.435009,39.908077",
"road": "建国门北大街",
"walk_type": 0
},
{
"action": "",
"assistant_action": "到达目的地",
"distance": 47,
"duration": 11,
"instruction": "骑行47米到达目的地",
"orientation": "",
"polyline": "116.435009,39.908073;116.434891,39.908073;116.434891,39.908073;116.434449,39.908073",
"road": "",
"walk_type": 0
}
]
}
]
},
"errcode": 0,
"errdetail": null,
"errmsg": "OK",
"ext": null
}
修改于 2 年前