Method: projects.value.compute
计算任意值。如果表达式的结果无法表示为值,或者其求值需要太多资源,则此操作将失败。虽然可以在此处计算任何类型的对象(并且不会出错),但一般来说,如果表达式生成的结果更适合于其他某个 Compute* 端点,则应改用该端点(例如,如果表达式的结果是一组地图项,则应使用 ComputeFeatures)。
HTTP 请求
POST https://earthengine.googleapis.com/v1alpha/{project=projects/*}/value:compute
网址采用 gRPC 转码语法。
路径参数
参数 |
project |
string
应被视为此请求的服务使用方的 Google Cloud Platform 项目的项目 ID 或项目编号。格式为 projects/{project-id} 。
必须对指定的资源 project 具有以下 IAM 权限才能进行授权:
earthengine.computations.create
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"expression": {
object (Expression )
},
"workloadTag": string
} |
字段 |
expression |
object (Expression )
要计算的表达式。
|
workloadTag |
string
用户提供的用于跟踪此计算的代码。
|
响应正文
任意计算的结果。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"result": value
} |
字段 |
result |
value (Value format)
计算表达式值的结果。
|
授权范围
需要以下 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。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-06。
[null,null,["最后更新时间 (UTC):2025-03-06。"],[[["Computes an arbitrary value based on a provided expression using the Earth Engine API."],["Utilizes the `POST` method and requires specifying the project ID in the URL."],["Request body includes the expression to compute and an optional workload tag for tracking."],["Successful responses contain the computed value in a structured format."],["Requires specific OAuth scopes for authorization, like `https://www.googleapis.com/auth/earthengine`."]]],["The `compute` endpoint evaluates an arbitrary expression, returning its result as a `Value`. A POST request is made to `https://earthengine.googleapis.com/v1alpha/{project=projects/*}/value:compute`, requiring `earthengine.computations.create` IAM permission. The request body contains the `expression` to compute and an optional `workloadTag`. The response returns the `result` of the computation in `Value` format, and requires one of the provided OAuth scopes for authorization. Other `Compute*` endpoints should be used if they are better suited for the task.\n"]]