公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
Method: projects.value.compute
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
计算任意值。如果表达式的结果无法表示为值,或者其求值需要太多资源,则此操作将失败。虽然可以在此处计算任何类型的对象(并且不会出错),但一般来说,如果表达式生成的结果更适合于其他某个 Compute* 端点,则应改用该端点(例如,如果表达式的结果是一组地图项,则应使用 ComputeFeatures)。
HTTP 请求
POST https://earthengine.googleapis.com/v1/{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-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eComputes the value of an arbitrary Earth Engine expression, returning the result as a JSON \u003ccode\u003eValue\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRecommended for expressions whose results are not better suited to other specialized endpoints like \u003ccode\u003eComputeFeatures\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying the expression to compute and an optional workload tag for tracking.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes the \u003ccode\u003ePOST\u003c/code\u003e method and requires specific authorization scopes for access.\u003c/p\u003e\n"],["\u003cp\u003eReturns the computed value within a \u003ccode\u003eresult\u003c/code\u003e field in the response body.\u003c/p\u003e\n"]]],[],null,["# Method: projects.value.compute\n\nComputes an arbitrary value. This will fail if the result of the Expression is not something that is expressible as a Value, or if its evaluation requires too many resources. While it is possible (and not an error) to compute any type of object here, in general any Expression producing results that are better suited to one of the other Compute\\* endpoints should use that endpoint instead (e.g., an Expression whose result is a set of features should use ComputeFeatures).\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1/{project=projects/*}/value:compute`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `project` | `string` The project id or project number of the Google Cloud Platform project that should be treated as the service consumer for this request. Format is `projects/{project-id}`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `project`: - `earthengine.computations.create` |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------|\n| ``` { \"expression\": { object (/earth-engine/reference/rest/v1/Expression) }, \"workloadTag\": string } ``` |\n\n| Fields ||\n|---------------|--------------------------------------------------------------------------------------------------|\n| `expression` | `object (`[Expression](/earth-engine/reference/rest/v1/Expression)`)` The expression to compute. |\n| `workloadTag` | `string` User supplied tag to track this computation. |\n\n### Response body\n\nThe results of an arbitrary computation.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------|\n| ``` { \"result\": value } ``` |\n\n| Fields ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| `result` | `value (`[Value](https://protobuf.dev/reference/protobuf/google.protobuf/#value)` format)` The results of computing the value of the expression. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/earthengine`\n- `\n https://www.googleapis.com/auth/earthengine.readonly`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/cloud-platform.read-only`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]