Method: projects.image.computePixels
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 ô pixel bằng cách thực hiện một phép tính tuỳ ý trên dữ liệu hình ảnh.
Mỗi yêu cầu được giới hạn ở 48 MB dữ liệu không nén, được tính bằng tích của kích thước yêu cầu tính bằng pixel, số dải hình ảnh được yêu cầu và số byte trên mỗi pixel cho mỗi dải. Các yêu cầu cũng bị giới hạn ở tối đa 32K pixel theo một trong hai kích thước và tối đa 1024 băng tần. Các yêu cầu vượt quá các giới hạn này sẽ dẫn đến mã lỗi 400 (BAD_REQUEST).
Nếu thành công, nội dung phản hồi sẽ chứa dữ liệu pixel được yêu cầu theo cách mã hoá được chỉ định trong trường fileFormat
của yêu cầu.
Yêu cầu HTTP
POST https://earthengine.googleapis.com/v1beta/{project=projects/*}/image:computePixels
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:
Trường |
expression |
object (Expression )
Biểu thức cần tính toán.
|
fileFormat |
enum (ImageFileFormat )
Định dạng tệp đầu ra để trả về các giá trị pixel.
|
grid |
object (PixelGrid )
Các thông số mô tả cách hình ảnh do expression tính toán được chiếu lại và cắt bớt. Nếu không có, hình ảnh được tính toán đầy đủ sẽ được trả về theo phép chiếu gốc.
|
bandIds[] |
string
Nếu có, hãy chỉ định một nhóm băng tần cụ thể sẽ được chọn từ kết quả đánh giá expression . Nếu không có, tất cả các dải tần số từ expression sẽ được chọn.
|
visualizationOptions |
object (VisualizationOptions )
Một tập hợp các tuỳ chọn trực quan hoá (nếu có) để áp dụng nhằm tạo ra hình ảnh trực quan hoá RGB 8 bit của dữ liệu.
|
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
Nếu thành công, phản hồi sẽ là một phản hồi HTTP chung có định dạng do phương thức xác định.
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\u003eThis API computes a tile of pixels by performing a user-defined computation on image data using an expression.\u003c/p\u003e\n"],["\u003cp\u003eRequests are limited to 48MB of uncompressed data and specific dimensions, exceeding which results in a 400 error.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses contain pixel data in the specified file format, encoded within the HTTP response body.\u003c/p\u003e\n"],["\u003cp\u003eThe API requires authorization using specific OAuth 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"],["\u003cp\u003eUsers can define the projection, clipping, band selection, and visualization options for the computed image within the request.\u003c/p\u003e\n"]]],["This API computes a tile of pixels from image data via an arbitrary expression. Input parameters include `expression`, `fileFormat`, `grid`, `bandIds`, `visualizationOptions`, and `workloadTag`. Requests are limited to 48MB of uncompressed data, 32K pixels per dimension, and 1024 bands, returning a 400 error code if these limits are exceeded. A successful request returns pixel data in the specified `fileFormat`, with authorization requiring specific OAuth scopes.\n"],null,["# Method: projects.image.computePixels\n\nComputes a tile of pixels by performing an arbitrary computation on image data.\n\nRequests are limited to 48MB in uncompressed data per request, computed as the product of the request dimensions in pixels, the number of image bands requested, and the number of bytes per pixel for each band. Requests are also limited to at most 32K pixels in either dimension and at most 1024 bands. Requests exceeding these limits will result in an error code of 400 (BAD_REQUEST).\n\nIf successful, the response body contains the requested pixel data in the encoding specified in the `fileFormat` field of the request.\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1beta/{project=projects/*}/image:computePixels`\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) }, \"fileFormat\": enum (/earth-engine/reference/rest/v1beta/ImageFileFormat), \"grid\": { object (/earth-engine/reference/rest/v1beta/PixelGrid) }, \"bandIds\": [ string ], \"visualizationOptions\": { object (/earth-engine/reference/rest/v1beta/VisualizationOptions) }, \"workloadTag\": string } ``` |\n\n| Fields ||\n|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `expression` | `object (`[Expression](/earth-engine/reference/rest/v1beta/Expression)`)` The expression to compute. |\n| `fileFormat` | `enum (`[ImageFileFormat](/earth-engine/reference/rest/v1beta/ImageFileFormat)`)` The output file format in which to return the pixel values. |\n| `grid` | `object (`[PixelGrid](/earth-engine/reference/rest/v1beta/PixelGrid)`)` Parameters describing how the image computed by `expression` should be reprojected and clipped. If not present, the full computed image is returned in its native projection. |\n| `bandIds[]` | `string` If present, specifies a specific set of bands that will be selected from the result of evaluating `expression`. If not present, all bands resulting from `expression` will be selected. |\n| `visualizationOptions` | `object (`[VisualizationOptions](/earth-engine/reference/rest/v1beta/VisualizationOptions)`)` If present, a set of visualization options to apply to produce an 8-bit RGB visualization of the data. |\n| `workloadTag` | `string` User supplied tag to track this computation. |\n\n### Response body\n\nIf successful, the response is a generic HTTP response whose format is defined by the method.\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)."]]