# 1.1 服务介绍

路径规划API是一套以HTTP形式提供的步行、公交、驾车查询及行驶距离计算接口,返回JSON 或 XML格式的查询数据,用于实现路径规划功能的开发。 由于道路/数据/算法的变更,很可能存在间隔一段时间后请求相同起终点的经纬度返回不同结果。使用API前您需先申请Key

# 1.2 整体说明⚠️

⚠️注意

  1. 字符串都为utf8格式;
  2. HTTP Headers:
    2.1 Content-Type设置为:application/json
  3. 域名(IP)使用
    公网环境(开发环境)下的开发可使用IPhttps://location-dev.newayz.com进行接口的调用
    政务网(正式发布)下可按实际需要使用IPhttps://yzt.pudong.gov.cn:80或者http://yzt.pudong.gov.cn:5236进行接口的调用

# 1.3 错误处理

错误的具体信息将在error字段中返回。示例如下:

{
    "code": "400",
    "message": "Param Error"
}
1
2
3
4

# 1.4 状态码列表

状态码 说明
200 返回正常
400 参数错误
401 无access key或access key无效
500 服务器内部错误

# 1.5 接口说明

# 1.5.1 路径演算

以HTTP形式提供的出行查询及行驶距离计算接口,返回JSON格式的查询数据。

使用API前您需先申请Key。

# 请求

路径演算通过get请求下面的URL:

https://location-dev.newayz.com/maps/route/v1/routes?access_key={YOUR_API_KEY}

# 请求参数
参数 类型 是否必填 说明
origin string(LngLat) lng,lat(经度,纬度),如117.500244, 40.417801 经纬度小数点不超过6位
destination string(LngLat) lng,lat(经度,纬度),如117.500244, 40.417801 经纬度小数点不超过6位
strategy string 路径演算策略,参见下方strategy的说明,默认speed
waypoints string(LngLats) 途经点,最大数目:16个坐标点,多个坐标点按|分隔,如121.609842,31.178933|121.594135,31.186056 经纬度小数点不超过6位
avoidPolygon string(LngLats) 只支持一个避让区域,如果是四边形则有四个坐标点,如果是五边形则有五个坐标点,如
avoidRoad string 只支持一条避让道路,如:南京西路
mode string 默认:driving,当前只⽀持driving模式
# strategy(策略)
ID 名称 说明
1 speed 速度优先
2 cost 费用优先,不走收费路段,且耗时最少的路线
3 distance 距离优先,不考虑路况,仅走距离最短的路线,但是可能存在穿越小路/小区的情况
4 highway 高速优先
40 avoidHighway 不走高速
# 请求示例
https://location-dev.newayz.com/maps/route/v1/routes?access_key={YOUR_API_KEY}&origin=121.604595,31.179705&destination=121.601958,31.205857&strategy=speed&avoidPolygon=121.601958,31.205857|121.602376,31.181279|121.601443,31.180765|121.602607,31.180816|121.601958,31.205857&waypoints=121.609842,31.178933|121.594135,31.186056
1

# 响应

# 响应结构
参数 类型 是否必填 说明
[]Route 路径

Route结构

参数 类型 是否必填 说明
summary Summary 概要
locations []Location 路径演算起点和终点
legs []Leg 路径

Summary结构

参数 类型 是否必填 说明
boundingBox BoundingBox bounding
duration int32 耗时,单位为秒
length float 长度,单位为公里

BoundingBox结构

参数 类型 是否必填 说明
leftBottom LngLat 左下角
rightTop LngLat 右上角

LngLat结构

参数 类型 是否必填 说明
longitude double 经度
latitude double 纬度

Location结构

参数 类型 是否必填 说明
originalIndex int32 序列号,用于说明location的顺序
longitude double 经度
latitude double 纬度
sideOfStreet string left,right

Leg结构

参数 类型 是否必填 说明
summary Summary 概要
steps []Step 导航路段

Step结构

参数 类型 是否必填 说明
instruction string 指示
roadName string 所在道路名称
duration int32 耗时
length float 长度,单位为公里
toll bool 是否存在收费
action string 导航主要动作
assistantAction string 导航辅助动作
geometry Geometry 此路段坐标点串

Action

type 数值 中文值
none 0 无基本导航动作
left 1 左转
right 2 右转
left-head 11 向左前方行驶
right-head 12 向右前方行驶
left-back 21 向左后方行驶
right-back 22 向右后方行驶
left-uturn 3 左转调头
head 4 直行
keep-left 31 靠左
keep-right 32 靠右
enter-roundabout 6 进入环岛
exit-roundabout 7 离开环岛
slowdown 9 减速行驶

Assistant Action

type 字符串值
0 无辅助导航动作
101 进入主路
102 进入辅路
103 进入高速
104 进入匝道
105 进入隧道
106 进入左岔路
107 进入中间岔道
108 进入右岔路
109 进入右转专用道
110 进入左转专用道
111 进入左侧道路
112 进入中间道路
113 进入右侧道路

Geometry结构

参数 类型 是否必填 说明
type string LineString
coordinates array<array<double>> 坐标
# 响应示例
[
  {
    "summary": {
      "length": 12.353,
      "boundingBox": {
        "leftBottom": {
          "longitude": 121.58087,
          "latitude": 31.17048
        },
        "rightTop": {
          "longitude": 121.61003,
          "latitude": 31.21208
        }
      },
      "duration": 834
    },
    "locations": [
      {
        "longitude": 121.604595,
        "latitude": 31.179705
      },
      {
        "longitude": 121.609842,
        "latitude": 31.178933,
        "originalIndex": 1
      },
      {
        "longitude": 121.594135,
        "latitude": 31.186056,
        "originalIndex": 2
      },
      {
        "longitude": 121.601958,
        "latitude": 31.205857,
        "originalIndex": 3
      }
    ],
    "legs": [
      {
        "summary": {
          "length": 0.876,
          "boundingBox": {
            "leftBottom": {
              "longitude": 121.60452,
              "latitude": 31.17886
            },
            "rightTop": {
              "longitude": 121.60967,
              "latitude": 31.18091
            }
          },
          "duration": 56
        },
        "steps": [
          {
            "instruction": "沿祥科路行驶322米后,右转弯",
            "length": 0.322,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60452,
                  31.18009
                ],
                [
                  121.60481,
                  31.18014
                ],
                [
                  121.60529,
                  31.18023
                ],
                [
                  121.60583,
                  31.18036
                ],
                [
                  121.60599,
                  31.1804
                ],
                [
                  121.60659,
                  31.18057
                ],
                [
                  121.60705,
                  31.18071
                ],
                [
                  121.60768,
                  31.18091
                ]
              ]
            },
            "roadName": "祥科路",
            "duration": 20,
            "action": "右转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿百业路行驶251米后,左转弯",
            "length": 0.251,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60768,
                  31.18091
                ],
                [
                  121.60813,
                  31.18001
                ],
                [
                  121.60819,
                  31.17991
                ],
                [
                  121.60874,
                  31.17886
                ]
              ]
            },
            "roadName": "百业路",
            "duration": 16,
            "action": "左转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶303米到达目的地",
            "length": 0.303,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60874,
                  31.17886
                ],
                [
                  121.60912,
                  31.17901
                ],
                [
                  121.60967,
                  31.17927
                ]
              ]
            },
            "duration": 20,
            "action": "无转角操作",
            "assistantAction": "到达目的地"
          }
        ]
      },
      {
        "summary": {
          "length": 6.234,
          "boundingBox": {
            "leftBottom": {
              "longitude": 121.58087,
              "latitude": 31.17048
            },
            "rightTop": {
              "longitude": 121.61003,
              "latitude": 31.18752
            }
          },
          "duration": 421
        },
        "steps": [
          {
            "instruction": "沿荣科路行驶263米后,左转弯",
            "length": 0.263,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60967,
                  31.17927
                ],
                [
                  121.60912,
                  31.17901
                ]
              ]
            },
            "roadName": "荣科路",
            "duration": 18,
            "action": "左转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶286米后,右转弯",
            "length": 0.286,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60912,
                  31.17901
                ],
                [
                  121.60874,
                  31.17886
                ],
                [
                  121.60934,
                  31.17781
                ],
                [
                  121.6094,
                  31.17772
                ],
                [
                  121.6097,
                  31.17729
                ],
                [
                  121.60991,
                  31.17698
                ],
                [
                  121.60995,
                  31.17692
                ]
              ]
            },
            "duration": 17,
            "action": "右转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶934米直行进入中间岔路",
            "length": 0.934,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60995,
                  31.17692
                ],
                [
                  121.61003,
                  31.17674
                ],
                [
                  121.60981,
                  31.17665
                ],
                [
                  121.60927,
                  31.17643
                ],
                [
                  121.60908,
                  31.17636
                ],
                [
                  121.60865,
                  31.17619
                ],
                [
                  121.60793,
                  31.17592
                ],
                [
                  121.60735,
                  31.1757
                ],
                [
                  121.6061,
                  31.17528
                ],
                [
                  121.60537,
                  31.17502
                ],
                [
                  121.60423,
                  31.17463
                ],
                [
                  121.60398,
                  31.17454
                ],
                [
                  121.60287,
                  31.17414
                ],
                [
                  121.60249,
                  31.17399
                ],
                [
                  121.60229,
                  31.17393
                ],
                [
                  121.60217,
                  31.17389
                ],
                [
                  121.602,
                  31.17384
                ],
                [
                  121.60161,
                  31.17371
                ],
                [
                  121.60123,
                  31.17361
                ]
              ]
            },
            "duration": 61,
            "action": "直行",
            "assistantAction": "进入中间岔路"
          },
          {
            "instruction": "行驶437米直行",
            "length": 0.437,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60123,
                  31.17361
                ],
                [
                  121.60111,
                  31.1736
                ],
                [
                  121.60096,
                  31.1736
                ],
                [
                  121.60034,
                  31.17347
                ],
                [
                  121.59955,
                  31.1733
                ],
                [
                  121.5978,
                  31.17295
                ],
                [
                  121.59756,
                  31.17287
                ],
                [
                  121.59742,
                  31.1728
                ],
                [
                  121.59718,
                  31.17267
                ],
                [
                  121.59687,
                  31.17252
                ]
              ]
            },
            "duration": 31,
            "action": "直行",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿中环路行驶730米靠右进入右侧岔路",
            "length": 0.73,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59687,
                  31.17252
                ],
                [
                  121.5957,
                  31.17227
                ],
                [
                  121.59553,
                  31.17223
                ],
                [
                  121.59457,
                  31.17204
                ],
                [
                  121.59335,
                  31.17178
                ],
                [
                  121.59139,
                  31.17137
                ],
                [
                  121.59116,
                  31.17131
                ],
                [
                  121.59053,
                  31.17117
                ],
                [
                  121.59027,
                  31.17109
                ],
                [
                  121.58947,
                  31.17086
                ]
              ]
            },
            "roadName": "中环路",
            "duration": 52,
            "action": "靠右",
            "assistantAction": "进入右侧岔路"
          },
          {
            "instruction": "行驶153米靠右进入右侧岔路",
            "length": 0.153,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.58947,
                  31.17086
                ],
                [
                  121.58913,
                  31.17083
                ],
                [
                  121.58906,
                  31.17081
                ],
                [
                  121.58831,
                  31.1706
                ],
                [
                  121.58803,
                  31.17052
                ],
                [
                  121.58792,
                  31.1705
                ]
              ]
            },
            "duration": 11,
            "action": "靠右",
            "assistantAction": "进入右侧岔路"
          },
          {
            "instruction": "行驶639米直行",
            "length": 0.639,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.58792,
                  31.1705
                ],
                [
                  121.58724,
                  31.17048
                ],
                [
                  121.58687,
                  31.17051
                ],
                [
                  121.5866,
                  31.17059
                ],
                [
                  121.58638,
                  31.17066
                ],
                [
                  121.58611,
                  31.17076
                ],
                [
                  121.58579,
                  31.17094
                ],
                [
                  121.58553,
                  31.17113
                ],
                [
                  121.58538,
                  31.1713
                ],
                [
                  121.58524,
                  31.17145
                ],
                [
                  121.58501,
                  31.17173
                ],
                [
                  121.58495,
                  31.17184
                ],
                [
                  121.58485,
                  31.17204
                ],
                [
                  121.58449,
                  31.17278
                ],
                [
                  121.5841,
                  31.17363
                ],
                [
                  121.58389,
                  31.17411
                ],
                [
                  121.58377,
                  31.17429
                ]
              ]
            },
            "duration": 45,
            "action": "直行",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿罗山高架路行驶707米靠右进入右侧岔路",
            "length": 0.707,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.58377,
                  31.17429
                ],
                [
                  121.58368,
                  31.17454
                ],
                [
                  121.5835,
                  31.1751
                ],
                [
                  121.58328,
                  31.17583
                ],
                [
                  121.58299,
                  31.17687
                ],
                [
                  121.58274,
                  31.17786
                ],
                [
                  121.58248,
                  31.17872
                ],
                [
                  121.58246,
                  31.17879
                ],
                [
                  121.58231,
                  31.17936
                ],
                [
                  121.58203,
                  31.18046
                ]
              ]
            },
            "roadName": "罗山高架路",
            "duration": 50,
            "action": "靠右",
            "assistantAction": "进入右侧岔路"
          },
          {
            "instruction": "行驶475米直行",
            "length": 0.475,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.58203,
                  31.18046
                ],
                [
                  121.58202,
                  31.18073
                ],
                [
                  121.58198,
                  31.18107
                ],
                [
                  121.58181,
                  31.18165
                ],
                [
                  121.58166,
                  31.1822
                ],
                [
                  121.58162,
                  31.18236
                ],
                [
                  121.58139,
                  31.18325
                ],
                [
                  121.58124,
                  31.18387
                ],
                [
                  121.58114,
                  31.18433
                ],
                [
                  121.58113,
                  31.18463
                ]
              ]
            },
            "duration": 32,
            "action": "直行",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿罗山路行驶93米后,右转弯",
            "length": 0.093,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.58113,
                  31.18463
                ],
                [
                  121.58106,
                  31.18488
                ],
                [
                  121.58087,
                  31.18543
                ]
              ]
            },
            "roadName": "罗山路",
            "duration": 6,
            "action": "右转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿张衡路行驶1.1公里后,右转弯",
            "length": 1.123,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.58087,
                  31.18543
                ],
                [
                  121.58105,
                  31.18542
                ],
                [
                  121.58118,
                  31.18543
                ],
                [
                  121.58131,
                  31.18545
                ],
                [
                  121.58141,
                  31.18547
                ],
                [
                  121.58151,
                  31.18549
                ],
                [
                  121.58179,
                  31.18553
                ],
                [
                  121.5819,
                  31.18555
                ],
                [
                  121.582,
                  31.18556
                ],
                [
                  121.58264,
                  31.18568
                ],
                [
                  121.58326,
                  31.1858
                ],
                [
                  121.5848,
                  31.18612
                ],
                [
                  121.58554,
                  31.18626
                ],
                [
                  121.58798,
                  31.18672
                ],
                [
                  121.58973,
                  31.18703
                ],
                [
                  121.59033,
                  31.18714
                ],
                [
                  121.59096,
                  31.18727
                ],
                [
                  121.59127,
                  31.18734
                ],
                [
                  121.59136,
                  31.18735
                ],
                [
                  121.59152,
                  31.18738
                ],
                [
                  121.59217,
                  31.18749
                ],
                [
                  121.59236,
                  31.18752
                ]
              ]
            },
            "roadName": "张衡路",
            "duration": 74,
            "action": "右转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶36米后,往左前方",
            "length": 0.036,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59236,
                  31.18752
                ],
                [
                  121.59245,
                  31.18721
                ]
              ]
            },
            "duration": 2,
            "action": "左前方",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶62米后,往左前方",
            "length": 0.062,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59245,
                  31.18721
                ],
                [
                  121.59255,
                  31.18708
                ],
                [
                  121.59267,
                  31.18699
                ],
                [
                  121.59294,
                  31.18685
                ]
              ]
            },
            "duration": 4,
            "action": "左前方",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶55米靠右进入右侧岔路",
            "length": 0.055,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59294,
                  31.18685
                ],
                [
                  121.59318,
                  31.18681
                ],
                [
                  121.5935,
                  31.18679
                ]
              ]
            },
            "duration": 3,
            "action": "靠右",
            "assistantAction": "进入右侧岔路"
          },
          {
            "instruction": "行驶241米到达目的地",
            "length": 0.241,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.5935,
                  31.18679
                ],
                [
                  121.59401,
                  31.1867
                ],
                [
                  121.59412,
                  31.18664
                ],
                [
                  121.59426,
                  31.18659
                ],
                [
                  121.59442,
                  31.18656
                ],
                [
                  121.59454,
                  31.1865
                ],
                [
                  121.59471,
                  31.18633
                ],
                [
                  121.59489,
                  31.18617
                ],
                [
                  121.5949,
                  31.18609
                ],
                [
                  121.59486,
                  31.18602
                ],
                [
                  121.59469,
                  31.18593
                ],
                [
                  121.59445,
                  31.1858
                ],
                [
                  121.59435,
                  31.18575
                ],
                [
                  121.59433,
                  31.18574
                ]
              ]
            },
            "duration": 15,
            "action": "无转角操作",
            "assistantAction": "到达目的地"
          }
        ]
      },
      {
        "summary": {
          "length": 5.243,
          "boundingBox": {
            "leftBottom": {
              "longitude": 121.59236,
              "latitude": 31.18574
            },
            "rightTop": {
              "longitude": 121.60397,
              "latitude": 31.21208
            }
          },
          "duration": 357
        },
        "steps": [
          {
            "instruction": "行驶191米靠左进入左侧岔路",
            "length": 0.191,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59433,
                  31.18574
                ],
                [
                  121.59435,
                  31.18575
                ],
                [
                  121.59445,
                  31.1858
                ],
                [
                  121.59469,
                  31.18593
                ],
                [
                  121.59486,
                  31.18602
                ],
                [
                  121.5949,
                  31.18609
                ],
                [
                  121.59489,
                  31.18617
                ],
                [
                  121.59471,
                  31.18633
                ],
                [
                  121.59454,
                  31.1865
                ],
                [
                  121.59442,
                  31.18656
                ],
                [
                  121.59426,
                  31.18659
                ],
                [
                  121.59412,
                  31.18664
                ],
                [
                  121.59401,
                  31.1867
                ]
              ]
            },
            "duration": 12,
            "action": "靠左",
            "assistantAction": "进入左侧岔路"
          },
          {
            "instruction": "行驶105米后,往右前方",
            "length": 0.105,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59401,
                  31.1867
                ],
                [
                  121.5935,
                  31.18679
                ],
                [
                  121.59318,
                  31.18681
                ],
                [
                  121.59294,
                  31.18685
                ]
              ]
            },
            "duration": 6,
            "action": "右前方",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶62米后,往右前方",
            "length": 0.062,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59294,
                  31.18685
                ],
                [
                  121.59267,
                  31.18699
                ],
                [
                  121.59255,
                  31.18708
                ],
                [
                  121.59245,
                  31.18721
                ]
              ]
            },
            "duration": 4,
            "action": "右前方",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶36米后,右转弯",
            "length": 0.036,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59245,
                  31.18721
                ],
                [
                  121.59236,
                  31.18752
                ]
              ]
            },
            "duration": 2,
            "action": "右转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿张衡路行驶863米后,左转弯",
            "length": 0.863,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59236,
                  31.18752
                ],
                [
                  121.59324,
                  31.18769
                ],
                [
                  121.59347,
                  31.18773
                ],
                [
                  121.59364,
                  31.18776
                ],
                [
                  121.59389,
                  31.18781
                ],
                [
                  121.59501,
                  31.18801
                ],
                [
                  121.59538,
                  31.18809
                ],
                [
                  121.59576,
                  31.18817
                ],
                [
                  121.59656,
                  31.18836
                ],
                [
                  121.5968,
                  31.18842
                ],
                [
                  121.59736,
                  31.18856
                ],
                [
                  121.59748,
                  31.18859
                ],
                [
                  121.59759,
                  31.18861
                ],
                [
                  121.59777,
                  31.18866
                ],
                [
                  121.59801,
                  31.18871
                ],
                [
                  121.59852,
                  31.18883
                ],
                [
                  121.59877,
                  31.18889
                ],
                [
                  121.59972,
                  31.18911
                ],
                [
                  121.60064,
                  31.18934
                ],
                [
                  121.60089,
                  31.18939
                ],
                [
                  121.60112,
                  31.18944
                ]
              ]
            },
            "roadName": "张衡路",
            "duration": 56,
            "action": "左转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "行驶2.4公里后,右转弯",
            "length": 2.448,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60112,
                  31.18944
                ],
                [
                  121.60126,
                  31.18948
                ],
                [
                  121.60127,
                  31.18957
                ],
                [
                  121.60121,
                  31.19064
                ],
                [
                  121.60113,
                  31.19177
                ],
                [
                  121.6011,
                  31.19225
                ],
                [
                  121.60109,
                  31.19233
                ],
                [
                  121.60097,
                  31.19373
                ],
                [
                  121.60096,
                  31.1938
                ],
                [
                  121.60089,
                  31.19482
                ],
                [
                  121.60086,
                  31.1953
                ],
                [
                  121.60086,
                  31.19567
                ],
                [
                  121.60083,
                  31.19624
                ],
                [
                  121.60081,
                  31.19674
                ],
                [
                  121.60073,
                  31.19774
                ],
                [
                  121.60071,
                  31.19801
                ],
                [
                  121.6007,
                  31.19812
                ],
                [
                  121.60068,
                  31.1984
                ],
                [
                  121.60051,
                  31.20058
                ],
                [
                  121.60048,
                  31.20104
                ],
                [
                  121.60039,
                  31.20231
                ],
                [
                  121.60037,
                  31.20254
                ],
                [
                  121.60037,
                  31.20261
                ],
                [
                  121.60029,
                  31.20379
                ],
                [
                  121.60026,
                  31.20412
                ],
                [
                  121.60025,
                  31.20424
                ],
                [
                  121.6002,
                  31.20497
                ],
                [
                  121.60014,
                  31.20587
                ],
                [
                  121.6001,
                  31.20637
                ],
                [
                  121.60006,
                  31.20699
                ],
                [
                  121.60004,
                  31.20721
                ],
                [
                  121.60003,
                  31.20738
                ],
                [
                  121.59991,
                  31.20913
                ],
                [
                  121.59979,
                  31.21076
                ],
                [
                  121.59976,
                  31.21126
                ]
              ]
            },
            "duration": 169,
            "action": "右转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿郭守敬路行驶374米后,右转弯",
            "length": 0.374,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.59976,
                  31.21126
                ],
                [
                  121.60043,
                  31.2114
                ],
                [
                  121.60178,
                  31.21169
                ],
                [
                  121.60188,
                  31.21171
                ],
                [
                  121.60206,
                  31.21175
                ],
                [
                  121.60356,
                  31.21208
                ]
              ]
            },
            "roadName": "郭守敬路",
            "duration": 26,
            "action": "右转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿哈雷路行驶802米后,右转弯",
            "length": 0.802,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60356,
                  31.21208
                ],
                [
                  121.60361,
                  31.21137
                ],
                [
                  121.60378,
                  31.20832
                ],
                [
                  121.60385,
                  31.20717
                ],
                [
                  121.60394,
                  31.20543
                ],
                [
                  121.60395,
                  31.20525
                ],
                [
                  121.60397,
                  31.2049
                ]
              ]
            },
            "roadName": "哈雷路",
            "duration": 56,
            "action": "右转",
            "assistantAction": "无操作"
          },
          {
            "instruction": "沿祖冲之路行驶362米到达目的地",
            "length": 0.362,
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  121.60397,
                  31.2049
                ],
                [
                  121.60217,
                  31.20458
                ]
              ]
            },
            "roadName": "祖冲之路",
            "duration": 26,
            "action": "无转角操作",
            "assistantAction": "到达目的地"
          }
        ]
      }
    ]
  }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422

# 1.5.2 路径查询

以HTTP形式提供的查询路径的接口,返回JSON格式的查询数据。

使用API前您需先申请Key。

# 请求

路径查询通过 get 请求下⾯的 URL :

/maps/route/v1/edges
1

https://location-dev.newayz.com/maps/route/v1/edges?access_key={YOUR_API_KEY}

# 请求参数
参数 类型 是否必填 说明
points string(Point) lng,lat,direction,speed(经度,纬度,⽅向,速度),多个点按|分隔并以最后一个点位置为准,方向为倒数第二个点到最后一个点的方向,如121.605165,31.177015,-1,20|121.609865,31.182494,-1,20|121.608642,31.182421,-1,20
# point
参数 类型 是否必填 说明
lng double 经度
lat double 纬度
direction int32 正北顺时针⽅向,取值范围[0,360),-1为⽅向不确定
speed int32 ⽶/秒
# 请求示例
https://location-dev.newayz.com/maps/route/v1/edges?access_key={YOUR_API_KEY}&points=121.605165,31.177015,-1,20|121.609865,31.182494,-1,20|121.608642,31.182421,-1,20
1

# 响应

# 响应结构
参数 类型 是否必填 说明
kind int 道路类型
speed Speed 道路限速信息
name string 道路名称
tolled bool 是否收费

Speed结构说明

参数 类型 是否必填 说明
limit int32 一般限速
truckLimit int32 卡车限速
limitFromGrade bool 是否通过道路等级获取的限速

kind列表说明

说明
1 ⾼速道路
2 城市⾼速道路
3 国道
4 省道
6 快速道路
7 主⼲道路
8 次要道路
9 ⼀般道路
10 窄道路
11 其他道路
12 规划道路
14 ⼩区道路
100 轮渡
# 响应示例
{
  "edge": {
    "name": "海科路",
    "kind": 9,
    "speed": {
      "limit": 30
    }
  }
}
1
2
3
4
5
6
7
8
9
Last Updated: 5/7/2021, 5:59:04 PM