Method: projects.table.computeFeatures

通过对一个或多个表中的特征应用任意计算来计算一组特征。结果将作为 GeoJSON 地图项对象的列表返回。

HTTP 请求

POST https://earthengine.googleapis.com/v1beta/{project=projects/*}/table:computeFeatures

网址采用 gRPC 转码语法。

路径参数

参数
project

string

应被视为此请求的服务使用方的 Google Cloud Platform 项目的项目 ID 或项目编号。格式为 projects/{project-id}

必须对指定的资源 project 具有以下 IAM 权限才能进行授权:

  • earthengine.computations.create

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "expression": {
    object (Expression)
  },
  "pageSize": integer,
  "pageToken": string,
  "workloadTag": string
}
字段
expression

object (Expression)

要计算的表达式。

pageSize

integer

每页的结果数上限。服务器返回的特征数量可能少于请求的数量。如果未指定,则默认每页显示 1, 000 条结果。

pageToken

string

标识服务器应返回的结果页面的令牌。 通常,这是上次调用 table.computeFeatures 方法返回的 ComputeFeaturesResponse.next_page_token 值。

workloadTag

string

用户提供的用于跟踪此计算的代码。

响应正文

EarthEngineService.ComputeFeatures 的响应消息。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "type": string,
  "features": [
    {
      object (Feature)
    }
  ],
  "nextPageToken": string
}
字段
type

string

始终包含常量字符串“FeatureCollection”,将其标记为 GeoJSON FeatureCollection 对象。

features[]

object (Feature)

与查询匹配的地图项列表,以 GeoJSON 地图项对象(请参阅 RFC 7946)的列表形式提供,其中名为“type”的字段包含字符串“Feature”,名为“geometry”的字段包含几何图形,名为“properties”的字段包含键值对属性。

nextPageToken

string

用于检索下一页结果的令牌。在对 table.computeFeatures 方法的后续调用中,将此值传入 ComputeFeaturesRequest.page_token 字段,以检索下一页结果。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/earthengine
  • https://www.googleapis.com/auth/earthengine.readonly
  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/cloud-platform.read-only

如需了解详情,请参阅 OAuth 2.0 Overview