# 影像数据集

# 获取影像数据集列表

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/list

# 请求方式:

  • GET

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符,如为 * 则表示不过滤帐户

# 请求参数:

参数名称 类型 是否必须 默认值 说明
search String - 搜索的文本
offset Number 0 返回结果的偏移量,用于分页
limit Number 11 返回结果的数量,用于分页
sortField String createdAt 用于排序的字段
sortType String desc 排序的类型

# 请求示例

GET http://host:port/heycloud/api/data/idataset/list?search=&offset=0&limit=11

# 正确响应示例:

{
  "result": [
    {
      "id": "73906a36-a4ca-4c10-ad23-9728fcf53bdb",
      "accountId": "3699b354-28e3-44e7-9e09-405f98fb7936",
      "title": "1",
      "bands": 1,
      "sr": "wgs-84",
      "count": "0",
      "createdAt": "2021-05-12T07:30:13.899Z"
    }
  ]
}

# 错误响应示例:

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

# 获取 idataset 的元数据

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/:idatasetId/meta

# 请求方式:

  • GET

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

参数名称 类型 是否必须 默认值 说明
idatasetId String - 数据集 ID

# 请求示例

GET http://host:port/heycloud/api/data/idataset/xxxxx/meta

# 正确响应示例:

{
  "result": {
    "id": "efb38b3d-40f9-4527-833f-e5687083c1a9",
    "accountId": "",
    "title": "大文件",
    "sr": "wgs-84",
    "count": "0",
    "extent": null,
    "createdAt": "2021-05-17T08:50:27.730Z",
    "attrFields": [{ "name": "title", "type": "text" }]
  }
}

# 错误响应示例:

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

# 根据条件查询记录

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/:idatasetId/query

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

属性名称 可选值 类型 是否必须 默认值 说明
idatasetId - String - 数据集 ID
where - String - 查询的条件
sortField - String createdAt 排序的字段
sortType desc | asc String desc 排序的类型
offset - Number 0 返回结果的偏移量,用于分页
limit - Number 11 返回结果的数量,用于分页
geom - Object - 查询的几何对象,GeoJSON 格式
dataSR String - 几何数据的空间参考,比如数据可能为 WGS84
outWebMercator - Boolean - 是否输出 Web Mercator 的几何对象

# 请求示例

POST http://host:port/heycloud/api/data/idataset/xxxxx/query

{
   "where": "id>10",
   "geom": { type: 'Point', coordinates: [0, 0] },
   "sortField": "id",
   "sortType": "asc",
   "offset": 0,
   "limit": 11,
   "dataSR": "wgs-84",
   "outWebMercator": true
}

# 正确响应示例:

{
  "result": [
    {
      "id": "3d44427b-3be4-447d-b78b-8df7a301e9cf",
      "title": "大同影像",
      "geom": {
        "type": "Polygon",
        "coordinates": [
          [
            [12607380.016053582, 4874273.337079315],
            [12607381.00601044, 4883865.709982973],
            [12617181.233172575, 4883881.564837843],
            [12617180.22675608, 4874289.176007589],
            [12607380.016053582, 4874273.337079315]
          ]
        ]
      },
      "createdAt": "2021-04-20T02:58:00.363Z"
    }
  ]
}

# 错误响应示例:

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

# 提取一块影像数据

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/:idatasetId/extract

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

属性名称 可选值 类型 是否必须 默认值 说明
idatasetId - String - 数据集 ID
where - String - 查询的条件
bbox - Array - 坐标
width - Number 64 输出的宽度
height - Number 64 输出的高度
sortField - String createdAt 排序的字段
sortType desc | asc String desc 排序的类型
bands - Array [0] 输出的波段索引
imageryPrefix - String "" 影像的前缀,为文件名前缀或 URL 前缀

# 请求示例

POST http://host:port/heycloud/api/data/idataset/xxxxx/extract

{
  "bbox": [113.24, 40.11, 113.26, 40.13]
}

# 正确响应示例:

{
  "result": ...
}

# 错误响应示例:

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

# 更新标题

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/:idatasetIdId/updateTitle

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

属性名称 类型 是否必须 默认值 说明
idatasetId String - 数据集 ID
title String - 更新的标题

# 请求示例

POST http://host:port/heycloud/api/data/idataset/xxxxx/updateTitle

{
  title: "xxx"
}

# 正确响应示例:

{
  "result": {
    "title": "..."
  }
}

# 错误响应示例:

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

# 更新数据范围

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/:idatasetId/updateExtent

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

属性名称 类型 是否必须 默认值 说明
idatasetId String - 数据集 ID

# 请求示例

POST http://host:port/heycloud/api/data/idataset/xxxxx/updateExtent

# 正确响应示例:

{
  "result": {
    "idatasetId": "xxxxx",
    "notifyAt": "2021-05-14T08:09:18.624Z"
  }
}

# 错误响应示例:

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

# 等间隔分段法

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/:idatasetId/breaks/equal-interval

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

属性名称 类型 是否必须 默认值 说明
idatasetId String - 数据集 ID
breakCount Number 4 分段的数量
where String - 查询的条件
limit Number 100 计算使用的影像数量,如为 <=0 的值则对数量不作限制

# 请求示例

POST http://host:port/heycloud/api/data/idataset/xxxxx/breaks/equal-interval

{
  "breakCount": 8
}

# 正确响应示例:

{
  "result": [0, 10, ..., 80]
}

# 错误响应示例:

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

# 列举影像数据集中某个范围内像素的不同取值

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/:idatasetId/stats/distinct

# 请求方式:

  • POST

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

属性名称 类型 是否必须 默认值 说明
idatasetId String - 数据集 ID
where String - 查询的条件
bbox Array - 坐标
width Number 64 输出的宽度
height Number 64 输出的高度
bands Array [0] 输出的波段索引
imageryPrefix String "" 影像的前缀,为文件名前缀或 URL 前缀
limit Number 10 计算使用的影像数量,如为 <=0 的值则对数量不作限制

# 请求示例

POST http://host:port/heycloud/api/data/idataset/:idatasetId/stats/distinct

{
  "bbox": [113.24, 40.11, 113.26, 40.13]
}

# 正确响应示例:

{
  "result": [[0, 1, 2, 3]]
}

# 错误响应示例:

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

# WCS 接口

# 请求 URL:

  • http://host:port/heycloud/api/data/idataset/:idatasetId/wcs

# 请求方式:

  • GET

# 请求 Header:

字段 类型 是否必选 说明
x-heycloud-admin-session String 通过 session 提供管理权限
x-heycloud-account-id String 帐号的唯一标识符

# 请求参数:

# Params:
字段 类型 说明
idatasetId String 影像数据集的唯一标识
# Query:
字段 类型 说明
request String 操作,可选 GetCapabilities/DescribeCoverage/GetCoverage
bbox String 提取的矩形范围
width Number 图片的像素宽度
height Number 图片的像素高度

# 请求示例:

GET http://host:port/heycloud/api/data/idataset/:idatasetId/wcs?request=GetCoverage