Pengumuman: Semua project nonkomersial yang terdaftar untuk menggunakan Earth Engine sebelum
15 April 2025 harus
memverifikasi kelayakan nonkomersial untuk mempertahankan akses Earth Engine.
Method: projects.image.computePixels
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Menghitung ubin piksel dengan melakukan komputasi arbitrer pada data gambar.
Permintaan dibatasi hingga 48 MB dalam data yang tidak dikompresi per permintaan, yang dihitung sebagai produk dimensi permintaan dalam piksel, jumlah band gambar yang diminta, dan jumlah byte per piksel untuk setiap band. Permintaan juga dibatasi maksimal 32K piksel di salah satu dimensi dan maksimal 1024 band. Permintaan yang melebihi batas ini akan menghasilkan kode error 400 (BAD_REQUEST).
Jika berhasil, isi respons akan berisi data piksel yang diminta dalam encoding yang ditentukan di kolom fileFormat
permintaan.
Permintaan HTTP
POST https://earthengine.googleapis.com/v1/{project=projects/*}/image:computePixels
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
project |
string
Project ID atau nomor project project Google Cloud Platform yang harus diperlakukan sebagai konsumen layanan untuk permintaan ini. Format adalah projects/{project-id} .
Otorisasi memerlukan izin IAM berikut pada resource project yang ditentukan:
earthengine.computations.create
|
Isi permintaan
Isi permintaan memuat data dengan struktur berikut:
Kolom |
expression |
object (Expression )
Ekspresi yang akan dihitung.
|
fileFormat |
enum (ImageFileFormat )
Format file output tempat menampilkan nilai piksel.
|
grid |
object (PixelGrid )
Parameter yang menjelaskan cara gambar yang dihitung oleh expression harus diproyeksikan ulang dan dipangkas. Jika tidak ada, gambar lengkap yang dihitung akan ditampilkan dalam proyeksi native-nya.
|
bandIds[] |
string
Jika ada, menentukan kumpulan band tertentu yang akan dipilih dari hasil evaluasi expression . Jika tidak ada, semua band yang dihasilkan dari expression akan dipilih.
|
visualizationOptions |
object (VisualizationOptions )
Jika ada, kumpulan opsi visualisasi yang akan diterapkan untuk menghasilkan visualisasi RGB 8-bit dari data.
|
workloadTag |
string
Tag yang diberikan pengguna untuk melacak komputasi ini.
|
Isi respons
Jika berhasil, responsnya adalah respons HTTP generik yang formatnya ditentukan oleh metode.
Cakupan otorisasi
Memerlukan salah satu cakupan OAuth berikut:
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
Untuk mengetahui informasi selengkapnya, lihat OAuth 2.0 Overview.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-25 UTC.
[null,null,["Terakhir diperbarui pada 2025-07-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eimage:computePixels\u003c/code\u003e method computes a tile of pixels by performing an arbitrary computation on image data provided as an expression.\u003c/p\u003e\n"],["\u003cp\u003eRequest size is limited to 48MB of uncompressed data, 32K pixels in each dimension, and 1024 bands, with exceeding requests resulting in a 400 (BAD_REQUEST) error.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses contain the requested pixel data in the specified file format.\u003c/p\u003e\n"],["\u003cp\u003eUsers can customize output through parameters like \u003ccode\u003efileFormat\u003c/code\u003e, \u003ccode\u003egrid\u003c/code\u003e, \u003ccode\u003ebandIds\u003c/code\u003e, and \u003ccode\u003evisualizationOptions\u003c/code\u003e to control the data format, projection, bands selection, and visualization, respectively.\u003c/p\u003e\n"],["\u003cp\u003eProper authorization with specific OAuth scopes, such as \u003ccode\u003ehttps://www.googleapis.com/auth/earthengine\u003c/code\u003e, is required for accessing this API.\u003c/p\u003e\n"]]],["This content details the process of computing a tile of pixels from image data via a `POST` request to `https://earthengine.googleapis.com/v1/{project=projects/*}/image:computePixels`. Requests specify an `expression`, `fileFormat`, `grid`, optional `bandIds`, `visualizationOptions`, and a `workloadTag`. The request is limited to 48MB of uncompressed data, 32K pixels per dimension, and 1024 bands. Successful responses return requested pixel data in the specified format, with various authorization scopes available.\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/v1/{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/v1/Expression) }, \"fileFormat\": enum (/earth-engine/reference/rest/v1/ImageFileFormat), \"grid\": { object (/earth-engine/reference/rest/v1/PixelGrid) }, \"bandIds\": [ string ], \"visualizationOptions\": { object (/earth-engine/reference/rest/v1/VisualizationOptions) }, \"workloadTag\": string } ``` |\n\n| Fields ||\n|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `expression` | `object (`[Expression](/earth-engine/reference/rest/v1/Expression)`)` The expression to compute. |\n| `fileFormat` | `enum (`[ImageFileFormat](/earth-engine/reference/rest/v1/ImageFileFormat)`)` The output file format in which to return the pixel values. |\n| `grid` | `object (`[PixelGrid](/earth-engine/reference/rest/v1/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/v1/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)."]]