お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
Method: projects.assets.getPixels
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
画像アセットからピクセルを取得します。このカスタム メソッドを使用すると、呼び出し元は画像から任意のピクセル タイルをリクエストできます。必要に応じて、バンドと地図投影を指定することもできます。マスキングされたデータまたは欠落しているデータは、ゼロとしてエンコードされます。
リクエストは、リクエストのディメンション(ピクセル単位)、リクエストされた画像バンドの数、各バンドのピクセルあたりのバイト数の積として計算される、リクエストあたり 48 MB の非圧縮データに制限されます。リクエストは、いずれかのディメンションで最大 32,000 ピクセル、最大 1,024 バンドに制限されています。これらの上限を超えるリクエストは、エラーコード 400(BAD_REQUEST)になります。
成功した場合、レスポンスの本文には、リクエストの fileFormat
フィールドで指定されたエンコードでリクエストされたピクセルデータが含まれます。
HTTP リクエスト
POST https://earthengine.googleapis.com/v1alpha/{name=projects/*/assets/**}:getPixels
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
name |
string
必須。ピクセルを取得する画像アセットの名前。name の形式は「projects/*/assets/**」です(例: 「projects/earthengine-legacy/assets/users/[USER]/[ASSET]」)。ユーザー所有のアセットはすべて、プロジェクト「earthengine-legacy」に含まれています(例: 「projects/earthengine-legacy/assets/users/foo/bar」)。その他のアセットはすべてプロジェクト「earthengine-public」に含まれています(例: "projects/earthengine-public/assets/LANDSAT").
認可には、指定されたリソース name に対する次の IAM の権限が必要です。
|
リクエストの本文
リクエストの本文には、次の構造のデータが含まれます。
フィールド |
fileFormat |
enum (ImageFileFormat )
ピクセル値を返す出力ファイル形式。
|
grid |
object (PixelGrid )
データを取得するピクセル グリッドを記述するパラメータ。デフォルトは、データのネイティブ ピクセル グリッドです。
|
region |
object (Struct format)
指定されている場合、返されるデータの領域。GeoJSON ジオメトリ オブジェクトとして指定します(RFC 7946 を参照)。返される画像は常に長方形であるため、出力座標系で指定されたジオメトリの境界ボックスが実際に使用されます。grid.dimensions も指定すると、グリッドはリクエストされたサイズに再スケーリングされます。
|
bandIds[] |
string
指定されている場合、ピクセルを取得する特定のバンドセットを指定します。バンドは ID で識別されます。これは、ImageBand プロトコルの id フィールドで示されます。
|
visualizationOptions |
object (VisualizationOptions )
存在する場合は、元のデータではなく、データの 8 ビット RGB ビジュアリゼーションを生成するために適用する一連のビジュアリゼーション オプション。
|
workloadTag |
string
この計算をトラッキングするためにユーザーが指定したタグ。
|
レスポンスの本文
成功した場合、レスポンスはメソッドによって定義された形式の汎用 HTTP レスポンスになります。
認可スコープ
以下のいずれかの 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 Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eFetches pixel data from Earth Engine image assets, allowing users to specify desired regions, bands, and output formats.\u003c/p\u003e\n"],["\u003cp\u003eRequests are limited to 48MB of uncompressed data, 32K pixels in each dimension, and 1024 bands; exceeding these limits will result in a 400 error.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses contain the requested pixel data in the specified file format, or an 8-bit RGB visualization if visualization options are provided.\u003c/p\u003e\n"],["\u003cp\u003eThe request must specify the image asset name and can optionally include parameters for the output format, pixel grid, region, bands, visualization options, and a workload tag for tracking.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires appropriate IAM permissions or one of the specified OAuth scopes, including 'earthengine', 'earthengine.readonly', 'cloud-platform', or 'cloud-platform.read-only'.\u003c/p\u003e\n"]]],[],null,["# Method: projects.assets.getPixels\n\nFetches pixels from an image asset. This custom method allows the caller to request an arbitrary tile of pixels from an image, optionally specifying the bands and map projection. Masked or missing data will be encoded as zeroes.\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/v1alpha/{name=projects/*/assets/**}:getPixels`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The name of the image asset from which to get pixels. `name` is of the format \"projects/\\*/assets/\\*\\*\" (e.g., \"projects/earthengine-legacy/assets/users/\\[USER\\]/\\[ASSET\\]\"). All user-owned assets are under the project \"earthengine-legacy\" (e.g., \"projects/earthengine-legacy/assets/users/foo/bar\"). All other assets are under the project \"earthengine-public\" (e.g., \"projects/earthengine-public/assets/LANDSAT\"). Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `earthengine.assets.get` |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"fileFormat\": enum (/earth-engine/reference/rest/v1alpha/ImageFileFormat), \"grid\": { object (/earth-engine/reference/rest/v1alpha/PixelGrid) }, \"region\": { object }, \"bandIds\": [ string ], \"visualizationOptions\": { object (/earth-engine/reference/rest/v1alpha/VisualizationOptions) }, \"workloadTag\": string } ``` |\n\n| Fields ||\n|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `fileFormat` | `enum (`[ImageFileFormat](/earth-engine/reference/rest/v1alpha/ImageFileFormat)`)` The output file format in which to return the pixel values. |\n| `grid` | `object (`[PixelGrid](/earth-engine/reference/rest/v1alpha/PixelGrid)`)` Parameters describing the pixel grid in which to fetch data. Defaults to the native pixel grid of the data. |\n| `region` | `object (`[Struct](https://protobuf.dev/reference/protobuf/google.protobuf/#struct)` format)` If present, the region of data to return, specified as a GeoJSON geometry object (see RFC 7946). Since the returned image is always rectangular, the bounding box of the given geometry in the output coordinate system will actually be used. If `grid.dimensions` is also specified then the grid will finally be rescaled to the requested size. |\n| `bandIds[]` | `string` If present, specifies a specific set of bands from which to get pixels. Bands are identified by id, as indicated by the `id` field of an ImageBand proto. |\n| `visualizationOptions` | `object (`[VisualizationOptions](/earth-engine/reference/rest/v1alpha/VisualizationOptions)`)` If present, a set of visualization options to apply to produce an 8-bit RGB visualization of the data, rather than returning the raw 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)."]]