Method: projects.value.compute
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tính toán một giá trị tuỳ ý. Thao tác này sẽ không thành công nếu kết quả của Biểu thức không phải là một giá trị có thể biểu thị hoặc nếu việc đánh giá biểu thức đó yêu cầu quá nhiều tài nguyên. Mặc dù có thể (và không phải là lỗi) tính toán bất kỳ loại đối tượng nào ở đây, nhưng nói chung, mọi Biểu thức tạo ra kết quả phù hợp hơn với một trong các điểm cuối Compute* khác đều phải sử dụng điểm cuối đó (ví dụ: Biểu thức có kết quả là một tập hợp các tính năng phải sử dụng ComputeFeatures).
Yêu cầu HTTP
POST https://earthengine.googleapis.com/v1beta/{project=projects/*}/value:compute
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
project |
string
Mã dự án hoặc số dự án của dự án Google Cloud Platform sẽ được coi là người dùng dịch vụ cho yêu cầu này. Định dạng là projects/{project-id} .
Việc uỷ quyền yêu cầu quyền IAM sau đây trên tài nguyên project đã chỉ định:
earthengine.computations.create
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"expression": {
object (Expression )
},
"workloadTag": string
} |
Trường |
expression |
object (Expression )
Biểu thức cần tính toán.
|
workloadTag |
string
Thẻ do người dùng cung cấp để theo dõi phép tính này.
|
Nội dung phản hồi
Kết quả của một phép tính tuỳ ý.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"result": value
} |
Trường |
result |
value (Value format)
Kết quả của việc tính toán giá trị của biểu thức.
|
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
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
Để biết thêm thông tin, hãy xem OAuth 2.0 Overview.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eComputes the value of an arbitrary Earth Engine expression, potentially failing if the result is not expressible as a Value or requires excessive resources.\u003c/p\u003e\n"],["\u003cp\u003eIt's recommended to use specific Compute endpoints (e.g., ComputeFeatures) when dealing with expressions yielding results better suited for those endpoints, rather than this general-purpose endpoint.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing an expression object and an optional workload tag in the request body, and returns the computed value in the response.\u003c/p\u003e\n"],["\u003cp\u003eTo use, you need appropriate authorization with scopes like \u003ccode\u003ehttps://www.googleapis.com/auth/earthengine\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\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/v1beta/{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/v1beta/Expression) }, \"workloadTag\": string } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------|\n| `expression` | `object (`[Expression](/earth-engine/reference/rest/v1beta/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)."]]