驾车路线规划

更新时间:

本文介绍通过阿里云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

插电式混动汽车