# 道路网络

# 获取所有已加载的道路网络名称

# 请求 URL:

  • http://host:port/heycloud/api/routing/network/list

# 请求方式:

  • GET

# 请求示例:

GET http://host:port/heycloud/api/routing/network/list

# 正确响应示例:

{
  "result": ["sample"]
}

# 错误响应示例:

{
  "error": "ERROR",
  "message": "错误信息"
}

# 计算两点间行进最快的路线

# 请求 URL:

  • http://host:port/heycloud/api/routing/network/:networkId/paths

# 请求方式:

  • POST

# 请求参数:

# Content type: application/json
字段 类型 默认值 说明
points Array 起点、途经点、终点构成的坐标点序列,格式为 [ [x1, y1], [x2, y2] ]
sr String gcj-02 坐标点的空间参考,输出结果和输入相同,支持 wgs-84/cgcs-2000/gcj-02/bd-09/web-mercator
alternatives Number 0 额外计算备选路线的数量
language String zh-Hans 导航提示的语言,支持 zh-Hans/en/ja/ko/fr/de/ru/it/ar

# 请求示例:

POST http://host:port/heycloud/api/routing/network/sample/paths

{
  "points": [ [7.401, 43.7251], [7.4126, 43.7407], [7.4226, 43.7409]],
  "alternatives": 2
}

# 正确响应示例:

{
  "result": {
    "waypoints": [<geojson>, <geojson>],
    "routes": [<geojson>, <geojson>],
  }
}

# 错误响应示例:

{
  "error": "ERROR",
  "message": "错误信息"
}

# 计算某点的服务区域

# 请求 URL:

  • http://host:port/heycloud/api/routing/network/:networkId/serviceArea

# 请求方式:

  • POST

# 请求参数:

# Content type: application/json
字段 类型 默认值 说明
point Array 坐标点,格式为 [x, y]
sr String 坐标点的空间参考,输出结果和输入相同,支持 wgs-84/cgcs-2000/gcj-02/bd-09/web-mercator
distance Number 1000 服务距离,单位米
concavity Number 1 区域凹凸程度
limit Number 100000 向外搜索节点的数量限制

# 请求示例:

POST http://host:port/heycloud/api/routing/network/sample/serviceArea

{
  "point": [7.401, 43.7251],
  "distance": 2000,
  "concavity": 5
}

# 正确响应示例:

{
  "result": {
    "hull": <geojson>,
    "searchCount": 3124,
    "matchCount": 3121
  }
}

# 错误响应示例:

{
  "error": "ERROR",
  "message": "错误信息"
}