文 档 中 心 / Document Center
搜索 管理中心
壹川接口文档V3
获取推荐线路路径组合规划
更新时间:2018-04-19 18:21:40   更新人员:叶洋   文档状态:完成 #199    测试接口
摘要
  1. 接口基本信息
    接口名称:获取线路规划
    请求方法:GET
    接口地址:line/wayplan
    登录验证:是
  2. 请求参数
    参数名 参数 数据类型 是否必须 示例值 说明
    mode 推荐方案依据 string posi 可选值:posi:起止点经纬度;netid:起止网点id
    from 起点数据 string posi方案时填起点经纬度(逗号分隔),netid方案时填起点网点id
    to 终点数据 string posi方案时填终点经纬度(逗号分隔),netid方案时填终点网点id
  3. 响应数据参数
    参数名 参数 数据类型 示例值 说明
    type 类型 string point:在网点上;way:在线路上。
    [point]在网点参数{} 在网点参数表 object
    └ point{} └ 点信息 object
      ├ id   ├ 网点id string
      ├ name   ├ 网点名 string
      └ coordinate{}   └ 经纬度 object
        ├ x     ├ 经度 float
        └ y     └ 纬度 float
    [way]在线路参数{} 在线路参数 object
    ├ line{} ├ 线路信息 object
    │ ├ id │ ├ 线路id string
    │ ├ name │ ├ 线路名称 string
    │ └ way[] │ └ 线路起止点id集合 arrayo
    ├ from{} ├ 线路起点信息 object
    │ ├ id │ ├ 起点id string
    │ ├ name │ ├ 起点名称 string
    │ └ coordinate{} │ └ 起点经纬度 object
    │   ├ x │   ├ 经度 float
    │   └ y │   └ 纬度 float
    ├ to{} ├ 线路终点信息 object
    │ ├ id │ ├ 终点id string
    │ ├ name │ ├ 终点名称 string
    │ └ coordinate{} │ └ 终点经纬度 object
    │   ├ x │   ├ 经度 float
    │   └ y │   └ 纬度 float
    └ distance └ 线路估算距离 float 该值为曼哈顿距离
  4. 请求示例
    请求例子:
     
    apirq('line/wayplan', {
        data: {
            "mode": "netid",
            "from": "155a4f2767ea880e", // 眉山
            "to": "c84dfc14b0fe119f" // 江夏
        }
    }) 
    
    返回数据结果:
     
    {
        "code": 0,
        "msg": "ok",
        "time": "1524131393",
        "data": [
            [
                {
                    "type": "point",
                    "point": {
                        "id": "155a4f2767ea880e",
                        "name": "眉山",
                        "coordinate": {
                            "x": 30.06632,
                            "y": 103.822906
                        }
                    }
                },
                {
                    "type": "way",
                    "line": {
                        "id": "87ae003f21a6dfda",
                        "name": "眉山->长沙",
                        "way": [
                            "155a4f2767ea880e",
                            "a6bf2a0c694e4117"
                        ]
                    },
                    "from": {
                        "id": "155a4f2767ea880e",
                        "name": "眉山",
                        "coordinate": {
                            "x": 30.06632,
                            "y": 103.822906
                        }
                    },
                    "to": {
                        "id": "a6bf2a0c694e4117",
                        "name": "长沙",
                        "coordinate": {
                            "x": 113.00884,
                            "y": 28.191049
                        }
                    },
                    "distance": 17652418.900501
                },
                {
                    "type": "point",
                    "point": {
                        "id": "a6bf2a0c694e4117",
                        "name": "长沙",
                        "coordinate": {
                            "x": 113.00884,
                            "y": 28.191049
                        }
                    }
                },
                {
                    "type": "way",
                    "line": {
                        "id": "9437234ced99aaa9",
                        "name": "长沙->江夏",
                        "way": [
                            "a6bf2a0c694e4117",
                            "c84dfc14b0fe119f"
                        ]
                    },
                    "from": {
                        "id": "a6bf2a0c694e4117",
                        "name": "长沙",
                        "coordinate": {
                            "x": 113.00884,
                            "y": 28.191049
                        }
                    },
                    "to": {
                        "id": "c84dfc14b0fe119f",
                        "name": "江夏",
                        "coordinate": {
                            "x": 113.283244,
                            "y": 23.211662
                        }
                    },
                    "distance": 584849.33885428
                },
                {
                    "type": "point",
                    "point": {
                        "id": "c84dfc14b0fe119f",
                        "name": "江夏",
                        "coordinate": {
                            "x": 113.283244,
                            "y": 23.211662
                        }
                    }
                }
            ]
        ]
    } 
    
本书创建于 2018-03-30 12:03:13 ?如有疑问,请联系技术人员