駕車路線規劃
本文介紹通過阿里云OpenAPI SDK調用 周邊查詢-基礎API-駕車路線規劃 的方法以及參數說明。
駕車路線規劃
根據起終點坐標檢索符合條件的駕車路線規劃方案。
API定義
請求參數
參數名 | 含義及規則 | 是否必須 | 缺省值 | 參數樣例 |
originLongitude | 起點的經度 | 必填 | 無 | 117.466485 |
originLatitude | 起點的緯度 | 必填 | 無 | 39.995197 |
destinationLongitude | 目的地的經度 | 必填 | 無 | 116.46424 |
destinationLatitude | 目的地的緯度 | 必填 | 無 | 40.020642 |
carType | 車輛類型 | 可選 | 無 | GASOLINE_VEHICLE |
plate | 車牌號碼 | 可選 | 無 | 陜A63*** |
響應參數
參數名稱 | 類型 | 參數說明 | ||||
success | bool | 接口調用是否成功 | ||||
errorCode | integer | 錯誤碼 | ||||
errorMessage | string | 錯誤信息 | ||||
data | object | 駕車路線對象 | ||||
originLongitude | string | 起點坐標經度 | ||||
originLatitude | string | 起點坐標緯度 | ||||
destinationLongitude | string | 終點坐標經度 | ||||
destinationLatitude | string | 終點坐標緯度 | ||||
taxiCost | string | 預計出租車費用,單位:元 | ||||
count | string | 路徑規劃方案總數 | ||||
paths | list | 路徑方案列表 | ||||
distanceMeter | string | 方案距離 | ||||
restriction | integer | 是否限行 | ||||
durationSecond | integer | 路線耗時 | ||||
cost | object | 路徑時間及費用成本 | ||||
durationSecond | string | 路線耗時 | ||||
tolls | string | 此路線道路收費 | ||||
tollDistanceMeter | string | 收費路段里程 | ||||
trafficLights | string | 交通燈數量 | ||||
steps | list | 路徑步驟詳情 | ||||
instruction | string | 行駛指示 | ||||
orientation | string | 進入道路方向 | ||||
roadName | string | 分段道路名稱 | ||||
stepDistanceMeter | string | 分段距離信息 | ||||
polyline | string | 分路段坐標點串 | ||||
cost | object | 分段道路時間及費用成本 | ||||
durationSecond | string | 路線耗時 | ||||
tolls | string | 此路線道路收費 | ||||
tollRoads | string | 收費道路 | ||||
tollDistanceMeter | string | 收費路段里程 | ||||
trafficLights | string | 交通燈數量 |
示例
響應示例
{
"data": {
"originLatitude": "39.995197",
"originLongitude": "116.466485",
"paths": [
{
"cost": {
"durationSecond": "459",
"trafficLights": "4",
"tolls": "0",
"tollDistanceMeter": "0"
},
"restriction": "0",
"distanceMeter": "1630",
"steps": [
{
"orientation": "南",
"cost": {
"durationSecond": "23",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "41",
"instruction": "向南行駛41米右轉",
"polyline": "116.466198,39.99511;116.46616,39.995035;116.466128,39.994928;116.466128,39.994863;116.466128,39.994745"
},
{
"orientation": "西",
"cost": {
"durationSecond": "20",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "70",
"instruction": "向西行駛70米向左前方行駛",
"polyline": "116.466128,39.994745;116.465511,39.994735;116.465308,39.994708"
},
{
"orientation": "南",
"cost": {
"durationSecond": "149",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "561",
"instruction": "向南行駛561米右轉",
"polyline": "116.465308,39.994708;116.465216,39.994697;116.465146,39.99466;116.464739,39.994289;116.464524,39.99408;116.464417,39.99393;116.464411,39.993844;116.464449,39.993415;116.464508,39.992739;116.46453,39.992374;116.46453,39.991956;116.464524,39.991677;116.464519,39.991548;116.464503,39.991081;116.464519,39.990985;116.464605,39.99077;116.464675,39.990636;116.464755,39.990529;116.464851,39.990427;116.464964,39.99033;116.46512,39.990234;116.465297,39.990121"
},
{
"orientation": "西南",
"cost": {
"durationSecond": "41",
"trafficLights": "1",
"tolls": "0"
},
"stepDistanceMeter": "115",
"instruction": "向西南行駛115米右轉進入主路",
"polyline": "116.465297,39.990121;116.465071,39.989906;116.464669,39.989526;116.464535,39.989391;116.464438,39.989295"
},
{
"orientation": "北",
"cost": {
"durationSecond": "132",
"trafficLights": "3",
"tolls": "0"
},
"stepDistanceMeter": "624",
"instruction": "沿南湖南路向北行駛624米右轉",
"roadName": "南湖南路",
"polyline": "116.46439,39.989252;116.463306,39.989955;116.463151,39.990094;116.463092,39.990212;116.463086,39.990234;116.463076,39.990293;116.463065,39.99055;116.46306,39.990733;116.463055,39.990802;116.463038,39.991146;116.463033,39.991226;116.463022,39.991435;116.462963,39.992836;116.462936,39.99342;116.462904,39.994284;116.462899,39.994407;116.462899,39.994472"
},
{
"orientation": "東北",
"cost": {
"durationSecond": "77",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "198",
"instruction": "向東北行駛198米左轉",
"polyline": "116.462974,39.994477;116.46314,39.994477;116.463865,39.994525;116.464492,39.99459;116.464508,39.994654;116.464503,39.994874;116.464481,39.995206"
},
{
"orientation": "西",
"cost": {
"durationSecond": "17",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "21",
"instruction": "向西行駛21米到達目的地",
"polyline": "116.464481,39.995206;116.46424,39.995192"
}
]
},
{
"cost": {
"durationSecond": "616",
"trafficLights": "5",
"tolls": "0",
"tollDistanceMeter": "0"
},
"restriction": "0",
"distanceMeter": "2144",
"steps": [
{
"orientation": "南",
"cost": {
"durationSecond": "21",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "41",
"instruction": "向南行駛41米右轉",
"polyline": "116.466198,39.99511;116.46616,39.995035;116.466128,39.994928;116.466128,39.994863;116.466128,39.994745"
},
{
"orientation": "西",
"cost": {
"durationSecond": "19",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "70",
"instruction": "向西行駛70米向左前方行駛",
"polyline": "116.466128,39.994745;116.465511,39.994735;116.465308,39.994708"
},
{
"orientation": "西南",
"cost": {
"durationSecond": "57",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "69",
"instruction": "向西南行駛69米左轉調頭",
"polyline": "116.465308,39.994708;116.465216,39.994697;116.465146,39.99466;116.464739,39.994289"
},
{
"orientation": "東北",
"cost": {
"durationSecond": "9",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "42",
"instruction": "向東北行駛42米靠左沿當前道路行駛",
"polyline": "116.464739,39.994289;116.46476,39.994273;116.465061,39.994558"
},
{
"orientation": "東",
"cost": {
"durationSecond": "45",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "143",
"instruction": "向東行駛143米右轉",
"polyline": "116.465061,39.994558;116.465227,39.99467;116.465511,39.994708;116.466128,39.994718;116.466251,39.994702;116.466375,39.994638;116.466461,39.994552;116.466482,39.99445"
},
{
"orientation": "南",
"cost": {
"durationSecond": "62",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "265",
"instruction": "向南行駛265米向右前方行駛",
"polyline": "116.466482,39.99445;116.466509,39.994;116.466606,39.99363;116.466649,39.993554;116.466761,39.993361;116.466852,39.993254;116.467153,39.992921;116.46726,39.992766;116.467319,39.992653;116.467362,39.992535;116.467378,39.99238;116.467362,39.992208"
},
{
"orientation": "西南",
"cost": {
"durationSecond": "34",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "116",
"instruction": "向西南行駛116米左轉",
"polyline": "116.467362,39.992208;116.467287,39.992025;116.467169,39.991838;116.466638,39.991333"
},
{
"orientation": "東南",
"cost": {
"durationSecond": "76",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "127",
"instruction": "向東南行駛127米右轉進入主路",
"polyline": "116.466633,39.991296;116.467576,39.990668;116.467764,39.99054"
},
{
"orientation": "西南",
"cost": {
"durationSecond": "55",
"trafficLights": "1",
"tolls": "0"
},
"stepDistanceMeter": "293",
"instruction": "沿阜通西大街向西南行駛293米右轉",
"roadName": "阜通西大街",
"polyline": "116.467813,39.990513;116.467512,39.990234;116.467485,39.990207;116.467185,39.989939;116.466766,39.989553;116.466112,39.98886;116.465833,39.988571;116.465672,39.98841"
},
{
"orientation": "西北",
"cost": {
"durationSecond": "152",
"trafficLights": "4",
"tolls": "0"
},
"stepDistanceMeter": "759",
"instruction": "沿南湖南路向西北行駛759米右轉",
"roadName": "南湖南路",
"polyline": "116.465608,39.988458;116.465474,39.988544;116.464905,39.988914;116.464444,39.98922;116.46439,39.989252;116.463306,39.989955;116.463151,39.990094;116.463092,39.990212;116.463086,39.990234;116.463076,39.990293;116.463065,39.99055;116.46306,39.990733;116.463055,39.990802;116.463038,39.991146;116.463033,39.991226;116.463022,39.991435;116.462963,39.992836;116.462936,39.99342;116.462904,39.994284;116.462899,39.994407;116.462899,39.994472"
},
{
"orientation": "東北",
"cost": {
"durationSecond": "70",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "198",
"instruction": "向東北行駛198米左轉",
"polyline": "116.462974,39.994477;116.46314,39.994477;116.463865,39.994525;116.464492,39.99459;116.464508,39.994654;116.464503,39.994874;116.464481,39.995206"
},
{
"orientation": "西",
"cost": {
"durationSecond": "16",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "21",
"instruction": "向西行駛21米到達目的地",
"polyline": "116.464481,39.995206;116.46424,39.995192"
}
]
},
{
"cost": {
"durationSecond": "586",
"trafficLights": "6",
"tolls": "0",
"tollDistanceMeter": "0"
},
"restriction": "0",
"distanceMeter": "2381",
"steps": [
{
"orientation": "南",
"cost": {
"durationSecond": "20",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "41",
"instruction": "向南行駛41米右轉",
"polyline": "116.466198,39.99511;116.46616,39.995035;116.466128,39.994928;116.466128,39.994863;116.466128,39.994745"
},
{
"orientation": "西",
"cost": {
"durationSecond": "18",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "70",
"instruction": "向西行駛70米向左前方行駛",
"polyline": "116.466128,39.994745;116.465511,39.994735;116.465308,39.994708"
},
{
"orientation": "西南",
"cost": {
"durationSecond": "55",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "69",
"instruction": "向西南行駛69米左轉調頭",
"polyline": "116.465308,39.994708;116.465216,39.994697;116.465146,39.99466;116.464739,39.994289"
},
{
"orientation": "東北",
"cost": {
"durationSecond": "8",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "42",
"instruction": "向東北行駛42米靠左沿當前道路行駛",
"polyline": "116.464739,39.994289;116.46476,39.994273;116.465061,39.994558"
},
{
"orientation": "東",
"cost": {
"durationSecond": "43",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "143",
"instruction": "向東行駛143米右轉",
"polyline": "116.465061,39.994558;116.465227,39.99467;116.465511,39.994708;116.466128,39.994718;116.466251,39.994702;116.466375,39.994638;116.466461,39.994552;116.466482,39.99445"
},
{
"orientation": "南",
"cost": {
"durationSecond": "20",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "50",
"instruction": "向南行駛50米左轉",
"polyline": "116.466482,39.99445;116.466509,39.994"
},
{
"orientation": "東",
"cost": {
"durationSecond": "67",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "149",
"instruction": "向東行駛149米右轉",
"polyline": "116.466547,39.993994;116.467008,39.994053;116.467185,39.994075;116.467432,39.994118;116.467571,39.994139;116.467984,39.994203;116.468279,39.994268"
},
{
"orientation": "東南",
"cost": {
"durationSecond": "40",
"trafficLights": "1",
"tolls": "0"
},
"stepDistanceMeter": "241",
"instruction": "沿廣順北大街向東南行駛241米右轉",
"roadName": "廣順北大街",
"polyline": "116.468279,39.994268;116.468392,39.994085;116.468553,39.993865;116.468703,39.993699;116.469084,39.993366;116.469385,39.993157;116.469814,39.992862;116.470146,39.992653"
},
{
"orientation": "西南",
"cost": {
"durationSecond": "87",
"trafficLights": "1",
"tolls": "0"
},
"stepDistanceMeter": "598",
"instruction": "沿阜通西大街向西南行駛598米右轉",
"roadName": "阜通西大街",
"polyline": "116.470146,39.992653;116.470055,39.992573;116.46991,39.992428;116.469068,39.991645;116.46843,39.991065;116.468317,39.990969;116.468215,39.990878;116.46806,39.990733;116.467995,39.990674;116.46785,39.99055;116.467813,39.990513;116.467512,39.990234;116.467485,39.990207;116.467185,39.989939;116.466766,39.989553;116.466112,39.98886;116.465833,39.988571;116.465672,39.98841"
},
{
"orientation": "西北",
"cost": {
"durationSecond": "145",
"trafficLights": "4",
"tolls": "0"
},
"stepDistanceMeter": "759",
"instruction": "沿南湖南路向西北行駛759米右轉",
"roadName": "南湖南路",
"polyline": "116.465608,39.988458;116.465474,39.988544;116.464905,39.988914;116.464444,39.98922;116.46439,39.989252;116.463306,39.989955;116.463151,39.990094;116.463092,39.990212;116.463086,39.990234;116.463076,39.990293;116.463065,39.99055;116.46306,39.990733;116.463055,39.990802;116.463038,39.991146;116.463033,39.991226;116.463022,39.991435;116.462963,39.992836;116.462936,39.99342;116.462904,39.994284;116.462899,39.994407;116.462899,39.994472"
},
{
"orientation": "東北",
"cost": {
"durationSecond": "68",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "198",
"instruction": "向東北行駛198米左轉",
"polyline": "116.462974,39.994477;116.46314,39.994477;116.463865,39.994525;116.464492,39.99459;116.464508,39.994654;116.464503,39.994874;116.464481,39.995206"
},
{
"orientation": "西",
"cost": {
"durationSecond": "15",
"trafficLights": "0",
"tolls": "0"
},
"stepDistanceMeter": "21",
"instruction": "向西行駛21米到達目的地",
"polyline": "116.464481,39.995206;116.46424,39.995192"
}
]
}
],
"count": "3",
"taxiCost": "13",
"destinationLatitude": "39.995197",
"destinationLongitude": "116.46424"
},
"success": true
}
枚舉定義
車輛類型carType枚舉
Code | Value | 說明 |
GASOLINE_VEHICLE | 0 | 普通燃油車 |
PURE_ELECTRIC_VEHICLE | 1 | 純電動汽車 |
PLUG_IN_HYBRID_ELECTRIC_VEHICLE | 2 | 插電式混動汽車 |