文档中心 > API类目 > 阿里健康药API

alibaba.health.nr.logistics.route.plan (路径规划接口)

路径规划接口提供的步行、骑行、公交、驾车路线查询及行驶距离、时间计算,用于实现路径规划功能的开发。

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
query NavigationQuery 必须 路径规划请求对象
  • starting_point
  • LocationQuery
  • 必须
  • 出发地经纬度
  • └ latitude
  • String
  • 必须
  • 40.001010
  • 纬度
  • └ longitude
  • String
  • 必须
  • 116.486620
  • 经度
  • └ route_type
  • Number
  • 必须
  • 1
  • 导航类型
  • destination
  • LocationQuery
  • 必须
  • 目的地经纬度
  • └ latitude
  • String
  • 必须
  • 40.001010
  • 纬度
  • └ longitude
  • String
  • 必须
  • 116.486620
  • 经度
  • └ departure_city
  • String
  • 可选
  • 北京
  • 出发城市(公交导航必填,城市名称/adCode)
  • └ arrival_city
  • String
  • 可选
  • 杭州
  • 到达城市(公交跨城导航必填,城市名称/cityCode)
  • └ strategy
  • Number
  • 可选
  • 1
  • 公交换乘策略/驾车导航策略
  • └ night_flag
  • Number
  • 可选
  • 0
  • 是否计算公交夜班车,0-不计算(默认),1-计算
  • └ departure_date
  • String
  • 可选
  • 2020-3-19
  • 出发日期,筛选可乘坐的公交路线
  • └ departure_time
  • String
  • 可选
  • 22:34
  • 出发时间,筛选可乘坐的公交路线
  • └ extensions
  • String
  • 可选
  • all
  • 返回结果详略:base-返回基本信息(默认),all-返回全部信息

响应参数

名称 类型 示例值 描述
result NavigationResult 接口返回model
  • result
  • Result
  • 返回结果
  • └ fare
  • String
  • 6546.13
  • 公交费用,单位:元
  • ways
  • WayDto []
  • 步行/骑行/驾车路线规划
  • └ duration
  • Number
  • 8883
  • 时间,单位:秒
  • └ distance
  • Number
  • 11104
  • 距离,单位:米
  • └ origin
  • String
  • 116.486620,40.001010
  • 起点经纬度
  • └ restriction
  • Number
  • 0
  • 限行结果:0-限行已规避或未限行,1-限行无法规避,即该线路有限行路段
  • └ destination
  • String
  • 116.486620,40.001010
  • 终点经纬度
  • └ strategy
  • String
  • 1
  • 驾车导航策略
  • steps
  • StepDto []
  • 步骤列表
  • └ orientation
  • String
  • 向东
  • 方向
  • └ assistant_action
  • String
  • 爬坡
  • 辅助动作
  • └ distance
  • Number
  • 48
  • 此路段距离,单位:米
  • └ tolls
  • String
  • 6
  • 驾车此道路收费
  • └ duration
  • Number
  • 38
  • 此路段预计步行时间
  • └ road
  • String
  • 启阳路
  • 道路名称
  • └ instruction
  • String
  • 步行48米左转
  • 路段步行指示
  • └ action
  • String
  • 左转
  • 主要动作
  • └ toll_road
  • String
  • 宏泰东街
  • 主要收费道路
  • └ walk_type
  • Number
  • 0
  • 这段路是否存在特殊的方式
  • └ polyline
  • String
  • 116.434444,39.908073;116.435009,39.908073
  • 此路段坐标串
  • └ toll_distance
  • Number
  • 12
  • 驾车收费路段距离
  • tmcs
  • TmcDto []
  • 交通管制信息列表
  • └ distance
  • Number
  • 168
  • 此段路的长度:单位:米
  • └ status
  • String
  • 畅通
  • 此段路的交通情况:未知、畅通、缓行、拥堵、严重拥堵
  • └ polyline
  • String
  • 116.486620,40.001010,116.586620,40.021010
  • 此段路的轨迹
  • └ traffic_light
  • Number
  • 26
  • 红绿灯个数
  • └ tolls
  • String
  • 10.6
  • 驾车此道路收费
  • └ toll_distance
  • Number
  • 23456
  • 驾车收费路段距离
  • └ distance
  • Number
  • 1900661
  • 公交导航总步行距离,单位:米
  • └ origin
  • String
  • 116.481028,39.989643
  • 起点经纬度
  • └ count
  • Number
  • 1
  • 路径规划方案数目
  • transits
  • TransitDto []
  • 公交路径规划列表
  • └ duration
  • Number
  • 39660
  • 此换乘方案预期时间,单位:秒
  • └ fare
  • String
  • 873.5
  • 此换乘方案价格,单位:元
  • └ walk_distance
  • Number
  • 123
  • 此方案总步行距离,单位:米
  • └ distance
  • Number
  • 2122226
  • 此方案距离,单位:米
  • └ night_flag
  • Number
  • 0
  • 是否是夜班车:0-非夜班车,1-夜班车
  • segments
  • SegmentDto []
  • 步骤列表
  • exit
  • StopDto
  • demo
  • 地铁出口
  • └ name
  • String
  • 望京东
  • 出口名称
  • └ coordinate
  • String
  • 116.489496,39.971109
  • 出口坐标
  • └ type
  • String
  • null
  • 类型
  • └ id
  • String
  • null
  • id
  • └ ad_code
  • String
  • null
  • 城市编码
  • └ time
  • String
  • null
  • 到站时间
  • └ wait_duration
  • String
  • null
  • 等待时间
  • bus_lines
  • BusLineDto []
  • 公交线路列表
  • via_stops
  • StopDto []
  • 途经站列表
  • └ coordinate
  • String
  • 116.489496,39.971109
  • 坐标
  • └ name
  • String
  • 将台
  • 位置名称
  • └ id
  • String
  • 900000028907008
  • 位置id
  • └ type
  • String
  • null
  • 类型
  • └ ad_code
  • String
  • null
  • 城市编码
  • └ time
  • String
  • null
  • 到站时间
  • └ wait_duration
  • String
  • null
  • 等待时间
  • └ distance
  • Number
  • 11038
  • 公交行驶距离,单位:米
  • └ via_num
  • Number
  • 6
  • 此段途经公交站数
  • └ type
  • String
  • 地铁线路
  • 公交类型
  • └ duration
  • Number
  • 1146
  • 公交预计行驶时间,单位:秒
  • arrival_stop
  • StopDto
  • 到达站信息
  • └ coordinate
  • String
  • 116.477495,39.893725
  • 坐标
  • └ name
  • String
  • 九龙山
  • 位置名称
  • └ id
  • String
  • 900000028907015
  • 位置id
  • └ type
  • String
  • null
  • 类型
  • └ ad_code
  • String
  • null
  • 城市编码
  • └ time
  • String
  • null
  • 到站时间
  • └ wait_duration
  • String
  • null
  • 等待时间
  • departure_stop
  • StopDto
  • 起始站信息
  • └ coordinate
  • String
  • 116.481634,39.984634
  • 坐标
  • └ name
  • String
  • 望京南
  • 位置名称
  • └ id
  • String
  • 900000028907006
  • 位置id
  • └ type
  • String
  • null
  • 类型
  • └ ad_code
  • String
  • null
  • 城市编码
  • └ time
  • String
  • null
  • 到站时间
  • └ wait_duration
  • String
  • null
  • 等待时间
  • └ name
  • String
  • 445路(南十里居--地铁望京西站
  • 公交线路名称
  • └ start_time
  • String
  • 0600
  • 首班车时间,如:0600,表示06:00
  • └ id
  • String
  • 900000028907
  • 公交线路id
  • └ end_time
  • String
  • 2300
  • 末班车时间,如:2300,表示23:00
  • └ polyline
  • String
  • 116.481634,39.984634;116.482706,39.983934
  • 此路段坐标串
  • railway
  • RailwayDto
  • 乘坐火车信息
  • └ duration
  • String
  • 123456
  • 该路段行车耗时,单位:秒
  • arrival_stop
  • StopDto
  • demo
  • 到站信息
  • └ id
  • String
  • 123456
  • 站点id
  • └ name
  • String
  • 望京东
  • 站点名称
  • └ coordinate
  • String
  • 116.481634,39.984634;116.482706,39.983934
  • 站点坐标
  • └ time
  • String
  • 2356
  • 发车时间
  • └ type
  • Number
  • 1
  • 站点类型,1-始发站,2-终点站
  • └ ad_code
  • String
  • null
  • 城市编码
  • └ wait_duration
  • String
  • null
  • 等待时间
  • via_stops
  • StopDto []
  • 途经站列表
  • └ name
  • String
  • 望京南
  • 途经站名称
  • └ id
  • String
  • 56789
  • 途经站点id
  • └ coordinate
  • String
  • 116.481634,39.984634;116.482706,39.983934
  • 途径站坐标
  • └ ad_code
  • String
  • null
  • 城市编码
  • └ type
  • String
  • null
  • 类型
  • └ time
  • String
  • null
  • 到站时间
  • └ wait_duration
  • String
  • null
  • 等待时间
  • └ distance
  • String
  • 123456
  • 该路段行车距离,单位:米
  • departure_stop
  • StopDto
  • demo
  • 出发站信息
  • └ id
  • String
  • 123456
  • 站点id
  • └ name
  • String
  • 望京南
  • 站点名称
  • └ coordinate
  • String
  • 116.481634,39.984634;116.482706,39.983934
  • 站点坐标
  • └ time
  • String
  • 1212
  • 发车时间
  • └ type
  • Number
  • 1
  • 站点类型,1-始发站,2-终点站
  • └ ad_code
  • String
  • null
  • 城市编码
  • └ wait_duration
  • String
  • null
  • 等待时间
  • └ name
  • String
  • G39(北京南-杭州东)
  • 线路名称
  • spaces
  • SpaceDto []
  • 仓位信息
  • └ fare
  • String
  • 1707.5
  • 仓位价格
  • └ name
  • String
  • 商务仓
  • 仓位名称
  • alternatives
  • RailwayDto []
  • 备选线路列表
  • └ name
  • String
  • 北京-天津
  • 线路名称
  • └ id
  • String
  • 1234567
  • 线路id
  • └ train_no
  • String
  • G39
  • 线路车次号
  • └ id
  • String
  • 134526
  • 线路id
  • └ type
  • String
  • G字头的高铁火车
  • 该路段车次类型
  • entrance
  • StopDto
  • 地铁入口信息
  • └ wait_duration
  • String
  • 180
  • 途径站点的停靠时间,单位:秒
  • └ coordinate
  • String
  • 116.480347,39.986382
  • 坐标
  • └ time
  • String
  • 2401
  • 发车/到站时间,到站时间如大于2400,则表示跨天
  • └ ad_code
  • String
  • 010
  • 高德城市编码
  • └ name
  • String
  • A西北口
  • 出口名称
  • └ id
  • String
  • 113456
  • 出口位置编码
  • └ type
  • String
  • 1
  • 站点类型,1-始发站,2-终点站
  • way
  • WayDto
  • 步行信息
  • └ duration
  • Number
  • 814
  • 时长
  • └ distance
  • Number
  • 950
  • 距离
  • └ origin
  • String
  • 116.486620,40.001010
  • 起点位置
  • └ restriction
  • Number
  • 0
  • 限行结果:0-限行已规避或未限行,1-限行无法规避,即该线路有限行路段
  • └ destination
  • String
  • 116.486620,40.001010
  • 终点位置
  • └ strategy
  • String
  • 1
  • 驾车导航策略
  • steps
  • StepDto []
  • 步行步骤
  • └ orientation
  • String
  • 向东
  • 方向
  • └ assistant_action
  • String
  • 爬坡
  • 辅助动作
  • └ distance
  • Number
  • 19
  • 距离
  • └ tolls
  • String
  • 12
  • 驾车此道路收费
  • └ duration
  • Number
  • 56
  • 此路段预计步行时间
  • └ road
  • String
  • 启阳路
  • 道路名称
  • └ instruction
  • String
  • 步行19米往前走
  • 路段步行指示
  • └ action
  • String
  • 往前走
  • 主要动作
  • └ toll_road
  • String
  • 宏泰东街
  • 主要收费道路
  • └ walk_type
  • Number
  • 0
  • 这段路是否存在特殊的方式
  • └ polyline
  • String
  • 116.480743,39.989807;116.480568,39.989925
  • 此路段坐标串
  • └ toll_distance
  • Number
  • 16
  • 驾车收费路段距离
  • └ traffic_light
  • Number
  • 16
  • 交通灯数量
  • └ tolls
  • String
  • 100
  • 驾车此道路收费
  • └ toll_distance
  • Number
  • 10887
  • 驾车收费路段距离
  • └ destination
  • String
  • 113.264499,23.130061
  • 公交导航总步行距离,单位:米
  • └ success
  • Boolean
  • true
  • 是否成功
  • └ error_code
  • String
  • NAVIGATION_QUERY_FAIL
  • 错误码
  • └ error_msg
  • String
  • 路径导航失败,请重试
  • 错误信息

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaHealthNrLogisticsRoutePlanRequest req = new AlibabaHealthNrLogisticsRoutePlanRequest();
AlibabaHealthNrLogisticsRoutePlanRequest.NavigationQuery obj1 = new AlibabaHealthNrLogisticsRoutePlanRequest.NavigationQuery();
AlibabaHealthNrLogisticsRoutePlanRequest.LocationQuery obj2 = new AlibabaHealthNrLogisticsRoutePlanRequest.LocationQuery();
obj2.setLatitude("40.001010");
obj2.setLongitude("116.486620");
obj1.setStartingPoint(obj2);
obj1.setRouteType(1L);
AlibabaHealthNrLogisticsRoutePlanRequest.LocationQuery obj3 = new AlibabaHealthNrLogisticsRoutePlanRequest.LocationQuery();
obj3.setLatitude("40.001010");
obj3.setLongitude("116.486620");
obj1.setDestination(obj3);
obj1.setDepartureCity("北京");
obj1.setArrivalCity("杭州");
obj1.setStrategy(1L);
obj1.setNightFlag(0L);
obj1.setDepartureDate("2020-3-19");
obj1.setDepartureTime("22:34");
obj1.setExtensions("all");
req.setQuery(obj1);
AlibabaHealthNrLogisticsRoutePlanResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_health_nr_logistics_route_plan_response>
    <result>
        <result>
            <fare>6546.13</fare>
            <ways>
                <way_dto>
                    <duration>8883</duration>
                    <distance>11104</distance>
                    <origin>116.486620,40.001010</origin>
                    <restriction>0</restriction>
                    <destination>116.486620,40.001010</destination>
                    <strategy>1</strategy>
                    <steps>
                        <step_dto>
                            <orientation>向东</orientation>
                            <assistant_action>爬坡</assistant_action>
                            <distance>48</distance>
                            <tolls>6</tolls>
                            <duration>38</duration>
                            <road>启阳路</road>
                            <instruction>步行48米左转</instruction>
                            <action>左转</action>
                            <toll_road>宏泰东街</toll_road>
                            <walk_type>0</walk_type>
                            <polyline>116.434444,39.908073;116.435009,39.908073</polyline>
                            <toll_distance>12</toll_distance>
                            <tmcs>
                                <tmc_dto>
                                    <distance>168</distance>
                                    <status>畅通</status>
                                    <polyline>116.486620,40.001010,116.586620,40.021010</polyline>
                                </tmc_dto>
                            </tmcs>
                        </step_dto>
                    </steps>
                    <traffic_light>26</traffic_light>
                    <tolls>10.6</tolls>
                    <toll_distance>23456</toll_distance>
                </way_dto>
            </ways>
            <distance>1900661</distance>
            <origin>116.481028,39.989643</origin>
            <count>1</count>
            <transits>
                <transit_dto>
                    <duration>39660</duration>
                    <fare>873.5</fare>
                    <walk_distance>123</walk_distance>
                    <distance>2122226</distance>
                    <night_flag>0</night_flag>
                    <segments>
                        <segment_dto>
                            <exit>
                                <name>望京东</name>
                                <coordinate>116.489496,39.971109</coordinate>
                                <type>null</type>
                                <id>null</id>
                                <ad_code>null</ad_code>
                                <time>null</time>
                                <wait_duration>null</wait_duration>
                            </exit>
                            <bus_lines>
                                <bus_line_dto>
                                    <via_stops>
                                        <stop_dto>
                                            <coordinate>116.489496,39.971109</coordinate>
                                            <name>将台</name>
                                            <id>900000028907008</id>
                                            <type>null</type>
                                            <ad_code>null</ad_code>
                                            <time>null</time>
                                            <wait_duration>null</wait_duration>
                                        </stop_dto>
                                    </via_stops>
                                    <distance>11038</distance>
                                    <via_num>6</via_num>
                                    <type>地铁线路</type>
                                    <duration>1146</duration>
                                    <arrival_stop>
                                        <coordinate>116.477495,39.893725</coordinate>
                                        <name>九龙山</name>
                                        <id>900000028907015</id>
                                        <type>null</type>
                                        <ad_code>null</ad_code>
                                        <time>null</time>
                                        <wait_duration>null</wait_duration>
                                    </arrival_stop>
                                    <departure_stop>
                                        <coordinate>116.481634,39.984634</coordinate>
                                        <name>望京南</name>
                                        <id>900000028907006</id>
                                        <type>null</type>
                                        <ad_code>null</ad_code>
                                        <time>null</time>
                                        <wait_duration>null</wait_duration>
                                    </departure_stop>
                                    <name>445路(南十里居--地铁望京西站</name>
                                    <start_time>0600</start_time>
                                    <id>900000028907</id>
                                    <end_time>2300</end_time>
                                    <polyline>116.481634,39.984634;116.482706,39.983934</polyline>
                                </bus_line_dto>
                            </bus_lines>
                            <railway>
                                <duration>123456</duration>
                                <arrival_stop>
                                    <id>123456</id>
                                    <name>望京东</name>
                                    <coordinate>116.481634,39.984634;116.482706,39.983934</coordinate>
                                    <time>2356</time>
                                    <type>1</type>
                                    <ad_code>null</ad_code>
                                    <wait_duration>null</wait_duration>
                                </arrival_stop>
                                <via_stops>
                                    <stop_dto>
                                        <name>望京南</name>
                                        <id>56789</id>
                                        <coordinate>116.481634,39.984634;116.482706,39.983934</coordinate>
                                        <ad_code>null</ad_code>
                                        <type>null</type>
                                        <time>null</time>
                                        <wait_duration>null</wait_duration>
                                    </stop_dto>
                                </via_stops>
                                <distance>123456</distance>
                                <departure_stop>
                                    <id>123456</id>
                                    <name>望京南</name>
                                    <coordinate>116.481634,39.984634;116.482706,39.983934</coordinate>
                                    <time>1212</time>
                                    <type>1</type>
                                    <ad_code>null</ad_code>
                                    <wait_duration>null</wait_duration>
                                </departure_stop>
                                <name>G39(北京南-杭州东)</name>
                                <spaces>
                                    <space_dto>
                                        <fare>1707.5</fare>
                                        <name>商务仓</name>
                                    </space_dto>
                                </spaces>
                                <alternatives>
                                    <railway_dto>
                                        <name>北京-天津</name>
                                        <id>1234567</id>
                                    </railway_dto>
                                </alternatives>
                                <train_no>G39</train_no>
                                <id>134526</id>
                                <type>G字头的高铁火车</type>
                            </railway>
                            <entrance>
                                <wait_duration>180</wait_duration>
                                <coordinate>116.480347,39.986382</coordinate>
                                <time>2401</time>
                                <ad_code>010</ad_code>
                                <name>A西北口</name>
                                <id>113456</id>
                                <type>1</type>
                            </entrance>
                            <way>
                                <duration>814</duration>
                                <distance>950</distance>
                                <origin>116.486620,40.001010</origin>
                                <restriction>0</restriction>
                                <destination>116.486620,40.001010</destination>
                                <strategy>1</strategy>
                                <steps>
                                    <step_dto>
                                        <orientation>向东</orientation>
                                        <assistant_action>爬坡</assistant_action>
                                        <distance>19</distance>
                                        <tolls>12</tolls>
                                        <duration>56</duration>
                                        <road>启阳路</road>
                                        <instruction>步行19米往前走</instruction>
                                        <action>往前走</action>
                                        <toll_road>宏泰东街</toll_road>
                                        <walk_type>0</walk_type>
                                        <polyline>116.480743,39.989807;116.480568,39.989925</polyline>
                                        <toll_distance>16</toll_distance>
                                    </step_dto>
                                </steps>
                                <traffic_light>16</traffic_light>
                                <tolls>100</tolls>
                                <toll_distance>10887</toll_distance>
                            </way>
                        </segment_dto>
                    </segments>
                </transit_dto>
            </transits>
            <destination>113.264499,23.130061</destination>
        </result>
        <success>true</success>
        <error_code>NAVIGATION_QUERY_FAIL</error_code>
        <error_msg>路径导航失败,请重试</error_msg>
    </result>
</alibaba_health_nr_logistics_route_plan_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部