路线规划
2021年04月12日

接口描述

请求路径:https://mapapi-routes.apigw-gz.didiyunapi.com/api/v1/direction/driving

请求方法:GET Content-Type=application/json

输入参数

参数名称 类型 必选 默认值 描述
origin GeoPoint 起点经纬度:lng,lat,经纬度小数点后不超过6位。
road_levels array 道路等级,支持多个值,1高速道路,2城市高速,3国道,4省道,5县道,6乡镇村道,7其它道路,8九级路,9轮渡,10行人道路,11人渡,12自行车专用道。如果输入多个等级,[1,2,3,...],则只返回指定等级的道路;没有输入,则返回所有等级道路,暂不支持此字段
road_func_classes array 起点绑路道路功能等级,[1,2,3,...]
road_name string 起点绑路道路名称
destination GeoPoint 终点经纬度,经纬度小数点后不超过6位。
waypoints array<GeoPoint> 途径点,最多支持30个,10个以上收费更高。
strategy int 0 默认值0,路线规划策略:0(综合模式)、1(时间最短)、2(距离最短)、3(不走高速)、4(少收费)、5(高速优先)、6(红绿灯少)
alternatives boolean false 默认值false,是否返回备选路线,最多3条。有途径点的时候,此参数被忽略。
departure_time int 指定出发时间,UNIX时间戳,只能是当前时间和未来7天内的时间。
avoid_polygons array> 区域避让,当前仅支持矩形区域,最多30个
avoid_road string 避让道路名,只支持一条。
avoids array 避让:1(轮渡)、2(收费)、3(高速)。
plate_number string 限行参数,车牌号,如“京A12345”,也支持7位新能源车牌号

GeoPoint:

参数名称 类型 必选 默认值 描述
longitude float 经度,建议小数点不超过6位
latitude float 纬度,建议小数点不超过6位

输出参数

参数名称 类型 描述
status int 状态码
info string 状态说明
result Result 请求返回数据

Result:

参数名称 类型 描述
routes array<Routes> 路线json数组

Routes:

参数名称 类型 描述
routeid string 路线ID
strategy string 策略
toll float 此导航方案道路收费金额,单位:元
toll_distance float 此导航方案道路收费距离长度,单位:米
restriction string 限行结果:0表示无限行;1打破避让轮渡;2打破避让收费;3打破避让高速;4打破车辆限行;5打破区域避让;6打破道路避让
traffic_lights string 此路线红绿灯个数
distance int 距离,单位米
duration int 时间,单位分
legs array<Legs> 起点到第一个途径点;途径点之间;最后一个途径点到终点

Legs:

参数名称 类型 描述
distance string 路径距离,单位:米
duration int64 预计行驶时间,单位:秒
outline string 路段坐标点串,lng,lat;lng,lat;...

错误码

错误码

示例

请求:

curl -X GET 'https://mapapi-routes.apigw-gz.didiyunapi.com/api/v1/direction/driving' \
  --header 'Authorization: AppCode XXX' \
  --header 'Content-Type: application/json' \
  --data '{
   "origin": {
       "longitude": 116.424966,
       "latitude": 39.976888
    },
   "destination": {
       "longitude": 116.345052,
       "latitude": 39.947689
    }
}'

输出:

{
    "status":0,
    "info":"OK",
    "result":{
        "routes":[
            {
                "id":"ac17db35605adf625f10c98f0704bbb0",
                "strategy":0,
                "toll":0,
                "duration":2335,
                "distance":12313,
                "legs":[
                    {
                        "duration":2335,
                        "distance":12313,
                        "outline":"116.424950,39.977050;116.425760,39.977060;116.425830,39.977060;116.426090,39.977060;116.426090,39.977060;116.426200,39.977060;116.426570,39.977050;116.426930,39.977040;116.427290,39.977060;116.427780,39.977060;116.427780,39.977060;116.428190,39.977060;116.428190,39.977060;116.428500,39.977060;116.428500,39.977060;116.428500,39.977110;116.428500,39.977110;116.428770,39.977110;116.428770,39.977110;116.429380,39.977110;116.429380,39.977110;116.429600,39.977110;116.429600,39.977110;116.430000,39.977120;116.430000,39.977120;116.430080,39.977120;116.430080,39.977120;116.430160,39.977120;116.430160,39.977120;116.430480,39.977110;116.430480,39.977110;116.430970,39.977100;116.430970,39.977100;116.431050,39.977100;116.431050,39.977100;116.431280,39.976990;116.431360,39.976960;116.431460,39.976950;116.431710,39.976900;116.431710,39.976900;116.432240,39.976870;116.432240,39.976870;116.432420,39.976860;116.432420,39.976860;116.433610,39.976750;116.433610,39.976750;116.433900,39.976700;116.434040,39.976660;116.434040,39.976660;116.434090,39.976640;116.434160,39.976600;116.434220,39.976550;116.434250,39.976500;116.434280,39.976480;116.434280,39.976480;116.434290,39.976430;116.434310,39.976370;116.434320,39.976310;116.434310,39.976230;116.434300,39.976170;116.434300,39.976170;116.433900,39.975520;116.433840,39.975420;116.433840,39.975420;116.433800,39.975000;116.433800,39.975000;116.433610,39.974730;116.433290,39.974240;116.433200,39.974080;116.433020,39.973830;116.432860,39.973590;116.432570,39.973150;116.432570,39.973150;116.432300,39.972750;116.432140,39.972470;116.432140,39.972470;116.431940,39.972250;116.431920,39.972220;116.431920,39.972220;116.431860,39.972130;116.431720,39.971880;116.431590,39.971640;116.431590,39.971640;116.431530,39.971520;116.431490,39.971430;116.431440,39.971290;116.431440,39.971290;116.431400,39.971150;116.431350,39.970930;116.431320,39.970640;116.431330,39.970370;116.431320,39.970180;116.431300,39.970030;116.431270,39.969970;116.431200,39.969910;116.431120,39.969850;116.431050,39.969830;116.430950,39.969800;116.430820,39.969790;116.430530,39.969740;116.429680,39.969780;116.429560,39.969780;116.429490,39.969780;116.428990,39.969760;116.428830,39.969740;116.428450,39.969730;116.428130,39.969690;116.426660,39.969540;116.426350,39.969490;116.425880,39.969470;116.425770,39.969440;116.425770,39.969440;116.425640,39.969430;116.424970,39.969410;116.424910,39.969410;116.424840,39.969400;116.424820,39.969400;116.424750,39.969400;116.424490,39.969390;116.424220,39.969380;116.424220,39.969380;116.423270,39.969370;116.421750,39.969320;116.421750,39.969320;116.421710,39.969320;116.421540,39.969320;116.421470,39.969310;116.421260,39.969310;116.421260,39.969310;116.419730,39.969270;116.419320,39.969250;116.418230,39.969230;116.418130,39.969230;116.418080,39.969220;116.418080,39.969220;116.418030,39.969230;116.417980,39.969230;116.417950,39.969230;116.417870,39.969230;116.417760,39.969220;116.416850,39.969200;116.415790,39.969170;116.415120,39.969160;116.415120,39.969160;116.414540,39.969150;116.414540,39.969150;116.413840,39.969140;116.413840,39.969140;116.413610,39.969130;116.413330,39.969110;116.413330,39.969110;116.413300,39.969110;116.412330,39.969090;116.412330,39.969090;116.412160,39.969090;116.412010,39.969090;116.411790,39.969090;116.411790,39.969090;116.411590,39.969090;116.411590,39.969090;116.411270,39.969080;116.411270,39.969080;116.411110,39.969070;116.410840,39.969060;116.410840,39.969060;116.410530,39.969050;116.410530,39.969050;116.409660,39.969020;116.409660,39.969020;116.409370,39.969000;116.408740,39.968990;116.408740,39.968990;116.408070,39.968970;116.407970,39.968970;116.407900,39.968970;116.407900,39.968970;116.407460,39.968950;116.407460,39.968950;116.407170,39.968950;116.406960,39.968950;116.405670,39.968910;116.405670,39.968910;116.404860,39.968890;116.403830,39.968860;116.403830,39.968860;116.403620,39.968860;116.403620,39.968860;116.403080,39.968850;116.402180,39.968820;116.402180,39.968820;116.401410,39.968810;116.401410,39.968810;116.400760,39.968800;116.400760,39.968800;116.400480,39.968790;116.400480,39.968790;116.399360,39.968760;116.399360,39.968760;116.399230,39.968760;116.399230,39.968760;116.398450,39.968730;116.398450,39.968730;116.398220,39.968710;116.398220,39.968710;116.397840,39.968710;116.397040,39.968690;116.397040,39.968690;116.395710,39.968640;116.395710,39.968640;116.395370,39.968640;116.395370,39.968640;116.394700,39.968620;116.394660,39.968620;116.394630,39.968620;116.394540,39.968610;116.394080,39.968600;116.394040,39.968600;116.393140,39.968570;116.393140,39.968570;116.391590,39.968530;116.391590,39.968530;116.391350,39.968520;116.391350,39.968520;116.391200,39.968520;116.391200,39.968520;116.390170,39.968490;116.389890,39.968480;116.389890,39.968480;116.389820,39.968480;116.389540,39.968470;116.389540,39.968470;116.389320,39.968460;116.389000,39.968440;116.389000,39.968440;116.388720,39.968440;116.388720,39.968440;116.388260,39.968440;116.387970,39.968440;116.387860,39.968440;116.387860,39.968440;116.387380,39.968420;116.386640,39.968410;116.386640,39.968410;116.385660,39.968350;116.385660,39.968350;116.385140,39.968340;116.385140,39.968340;116.384550,39.968310;116.384360,39.968300;116.383940,39.968300;116.383470,39.968290;116.383300,39.968290;116.383300,39.968290;116.382870,39.968280;116.382210,39.968260;116.382210,39.968260;116.381880,39.968260;116.381880,39.968260;116.381290,39.968260;116.381290,39.968260;116.381230,39.968260;116.380690,39.968240;116.380640,39.968240;116.380640,39.968240;116.380490,39.968240;116.380350,39.968240;116.380180,39.968240;116.380140,39.968240;116.380050,39.968240;116.380050,39.968240;116.379800,39.968230;116.379470,39.968220;116.379470,39.968220;116.378890,39.968320;116.378890,39.968320;116.378820,39.968350;116.378770,39.968410;116.378750,39.968440;116.378730,39.968480;116.378720,39.968520;116.378720,39.968550;116.378730,39.968590;116.378750,39.968620;116.378790,39.968640;116.378830,39.968640;116.379720,39.968670;116.379930,39.968670;116.380020,39.968670;116.380080,39.968660;116.380130,39.968640;116.380160,39.968640;116.380210,39.968580;116.380210,39.968580;116.380200,39.968480;116.380190,39.968350;116.380180,39.968240;116.380170,39.968150;116.380160,39.968080;116.380160,39.968060;116.380140,39.967950;116.380140,39.967950;116.380120,39.967750;116.380120,39.967750;116.380050,39.967290;116.380050,39.967290;116.380040,39.967230;116.380010,39.966990;116.379910,39.965990;116.379910,39.965990;116.380030,39.965680;116.380030,39.965680;116.380020,39.965530;116.379960,39.965020;116.379960,39.965020;116.379910,39.964580;116.379910,39.964580;116.379850,39.964100;116.379850,39.964100;116.379810,39.963740;116.379810,39.963710;116.379810,39.963710;116.379640,39.962240;116.379640,39.962240;116.379620,39.962030;116.379560,39.961580;116.379560,39.961580;116.379520,39.961260;116.379520,39.961260;116.379430,39.960580;116.379430,39.960580;116.379400,39.960360;116.379400,39.960360;116.379350,39.960000;116.379350,39.960000;116.379290,39.959420;116.379280,39.959060;116.379250,39.958560;116.379240,39.958250;116.379240,39.958050;116.379240,39.958050;116.379240,39.957980;116.379230,39.957550;116.379230,39.957520;116.379230,39.957440;116.379240,39.956320;116.379250,39.956030;116.379250,39.955950;116.379250,39.955950;116.379250,39.955860;116.379250,39.955860;116.379270,39.955090;116.379270,39.955090;116.379300,39.953930;116.379300,39.953930;116.379310,39.953280;116.379310,39.953280;116.379300,39.952570;116.379270,39.952180;116.379270,39.952180;116.379230,39.952030;116.379200,39.951910;116.379140,39.951760;116.379140,39.951760;116.379050,39.951540;116.379030,39.951500;116.379030,39.951500;116.378970,39.951380;116.378970,39.951380;116.378900,39.951230;116.378900,39.951230;116.378800,39.951020;116.378730,39.950890;116.378720,39.950870;116.378720,39.950870;116.378700,39.950800;116.378690,39.950670;116.378690,39.950500;116.378690,39.950440;116.378680,39.950110;116.378670,39.949650;116.378670,39.949650;116.378570,39.949530;116.378500,39.949390;116.378460,39.949330;116.378310,39.949150;116.378310,39.949150;116.377720,39.949140;116.377610,39.949140;116.377610,39.949140;116.377310,39.949140;116.377230,39.949140;116.376720,39.949010;116.376720,39.949010;116.376410,39.949010;116.376410,39.949010;116.376210,39.949010;116.376210,39.949010;116.375880,39.948910;116.375880,39.948910;116.375000,39.948880;116.375000,39.948880;116.374460,39.948830;116.373660,39.948790;116.373360,39.948780;116.373160,39.948770;116.373010,39.948760;116.372350,39.948720;116.372040,39.948690;116.372010,39.948690;116.371930,39.948680;116.371850,39.948670;116.371850,39.948670;116.371640,39.948630;116.371460,39.948620;116.371270,39.948590;116.370770,39.948500;116.370580,39.948450;116.370430,39.948420;116.370340,39.948380;116.370340,39.948380;116.370270,39.948370;116.370150,39.948340;116.369860,39.948250;116.369670,39.948180;116.369670,39.948180;116.369490,39.948140;116.369050,39.947980;116.369050,39.947980;116.368900,39.947920;116.368900,39.947920;116.368580,39.947790;116.368580,39.947790;116.368400,39.947710;116.368400,39.947710;116.368010,39.947560;116.367640,39.947400;116.367640,39.947400;116.366790,39.947060;116.366140,39.946800;116.366140,39.946800;116.365830,39.946660;116.365830,39.946660;116.365380,39.946520;116.365380,39.946520;116.365100,39.946430;116.364610,39.946270;116.363570,39.945970;116.363570,39.945970;116.363210,39.945980;116.363210,39.945980;116.362670,39.945830;116.362670,39.945830;116.362610,39.945810;116.362610,39.945810;116.362410,39.945760;116.362410,39.945760;116.361690,39.945540;116.360570,39.945240;116.360570,39.945240;116.359780,39.945010;116.359780,39.945010;116.359640,39.944980;116.359640,39.944980;116.359530,39.944950;116.359530,39.944950;116.359240,39.944870;116.359240,39.944870;116.359210,39.944860;116.359210,39.944860;116.359140,39.944840;116.359140,39.944840;116.359090,39.944830;116.359090,39.944830;116.358810,39.944750;116.358080,39.944540;116.358030,39.944530;116.358030,39.944530;116.357220,39.944300;116.356680,39.944150;116.356430,39.944100;116.356430,39.944100;116.356390,39.944090;116.356350,39.944080;116.356350,39.944080;116.356290,39.944060;116.356130,39.944020;116.356070,39.944000;116.356070,39.944000;116.355940,39.943950;116.355880,39.943920;116.355880,39.943920;116.355780,39.943840;116.355630,39.943680;116.355350,39.943370;116.355350,39.943370;116.355220,39.943210;116.355220,39.943210;116.355170,39.943070;116.355090,39.942810;116.355090,39.942810;116.355070,39.942650;116.355060,39.942620;116.355050,39.942520;116.355050,39.942520;116.355040,39.942360;116.355040,39.942200;116.355040,39.942200;116.355060,39.941870;116.355090,39.941670;116.355130,39.941490;116.355130,39.941490;116.355030,39.941330;116.354900,39.941210;116.354900,39.941210;116.354800,39.941110;116.354650,39.940950;116.354650,39.940950;116.354480,39.940770;116.354440,39.940740;116.354410,39.940720;116.354370,39.940700;116.354300,39.940680;116.354250,39.940660;116.354250,39.940660;116.354160,39.940640;116.354160,39.940640;116.353420,39.940540;116.352410,39.940390;116.352410,39.940390;116.352120,39.940370;116.352120,39.940370;116.352090,39.940500;116.352090,39.940500;116.352060,39.940630;116.352060,39.940630;116.352050,39.940680;116.352030,39.940770;116.352000,39.940950;116.351920,39.941460;116.351910,39.941510;116.351910,39.941510;116.351820,39.942070;116.351820,39.942070;116.351790,39.942310;116.351790,39.942310;116.351780,39.942480;116.351780,39.942480;116.351820,39.943010;116.351820,39.943010;116.351820,39.943260;116.351800,39.943340;116.351680,39.943650;116.351680,39.943650;116.351660,39.943750;116.351650,39.943780;116.351630,39.943820;116.351630,39.943820;116.351610,39.943840;116.351590,39.943860;116.351510,39.943940;116.351380,39.944030;116.351380,39.944030;116.351320,39.944070;116.351210,39.944130;116.351090,39.944160;116.351090,39.944160;116.350980,39.944200;116.350660,39.944290;116.350660,39.944290;116.350570,39.944310;116.350150,39.944420;116.350150,39.944420;116.350000,39.944470;116.350000,39.944470;116.349810,39.944530;116.348260,39.945030;116.348070,39.945090;116.348070,39.945090;116.347620,39.945250;116.347620,39.945250;116.347530,39.945270;116.347530,39.945270;116.346900,39.945500;116.346020,39.945770;116.346020,39.945770;116.345720,39.945870;116.345720,39.945870;116.345130,39.946070;116.344430,39.946300;116.344430,39.946300;116.344440,39.946330;116.344470,39.946390;116.344470,39.946390;116.344480,39.946420;116.344510,39.946480;116.344520,39.946530;116.344510,39.946590;116.344500,39.946660;116.344490,39.946720;116.344490,39.946720;116.344430,39.946930;116.344390,39.947290;116.344380,39.947330;116.344380,39.947330;116.344370,39.947380;116.344370,39.947470;116.344380,39.947510;116.344400,39.947530;116.344440,39.947560;116.344440,39.947560;116.344890,39.947590;116.345000,39.947570"
                    }
                ]
            }
        ]
    }
}

项搜索结果

    空空如也
    没有找到您要搜索的内容,请直接拨打服务热线400-0590-666