お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
画像データの抽出
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Earth Engine から画像データを取得する
Earth Engine から Google ドライブ、Cloud Storage、または Earth Engine アセットに画像データを取得するには、Export
を使用します。ジョブはすべて Earth Engine によって処理されます。エクスポート ジョブにスケーリングの問題がある場合(1 日以上かかる、メモリエラーまたはタイムアウト エラーが返されるなど)、または Apache Beam、Spark、Dask などのフレームワークに精通している場合は、ここで説明するデータ抽出方法をおすすめします。これらのフレームワークで実装されたワークフローは、Dataflow や Dataproc などの Google Cloud ツールを使用してスケーリングできます。
具体的には、このガイドでは、getPixels
または computePixels
を使用して画像データのリクエストを手動で行う方法について説明します。ここでの「画像データ」とは、スケールと投影が一致するピクセル値の多次元配列を意味します。リージョン、スケール、投影、ディメンションはリクエストで指定します。[ImageFileFormat ページ] に、使用可能な出力形式が一覧表示されます。出力先には、Cloud Storage またはローカルにマウントされたディレクトリを含めることができます。手動リクエストは複雑になりますが、大規模なワークロードにスケーリングできます。
既存のアセットから画像データを取得する
getPixels
を使用して、既存の Earth Engine アセットから画像データを取得します。アセット ID をリクエストに直接渡すため、抽出前にピクセルに対して計算を行うことはできません。指定されたリージョン、スケール、投影、形式のピクセル ブロックが返されます。次の例は、getPixels
を使用して MODIS 画像コレクションから NDVI の時系列を取得する方法を示しています。
計算画像から画像データを取得する
computePixels
を使用して、合成画像などの計算画像から画像データを取得します。computePixels
では、計算された ee.Image
オブジェクトを expression
パラメータで渡します。指定された領域、スケール、投影、形式で計算されたピクセルのブロックが返されます。次の例は、雲のない Sentinel-2 コンポジットからマルチスペクトル データのパッチを取得する方法を示しています。
リクエストの手動並列化
任意の目的に対して任意の量のリクエストを送信できますが、大規模なワークフローの場合はリクエストを並列化することをおすすめします。このようなリクエストを並列で行うには、Earth Engine 大容量エンドポイントを使用する必要があります。実行できる並列リクエストの数は、同時インタラクティブ リクエストの割り当てによって設定されます。大容量エンドポイントを使用するタイミングについては、Earth Engine の大容量ページをご覧ください。
マルチスレッド処理
スレッドを使用して、同時リクエストを行うことができます。このアプローチは、getPixels
と computePixels
のサンプル ノートブックで示されています。
Apache Beam
Apache Beam パイプラインを使用してリクエストを並列化できます。これらのパイプラインは、ローカルで実行することも、Google Dataflow ジョブとして実行することもできます。例については、Geo for Good トレーニングまたはPeople, Planet and AI のデモをご覧ください。他の並列化ライブラリには、Dask や Apache Spark があります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eThis guide describes alternative methods for extracting image data from Earth Engine using \u003ccode\u003egetPixels\u003c/code\u003e and \u003ccode\u003ecomputePixels\u003c/code\u003e for increased scalability beyond the standard \u003ccode\u003eExport\u003c/code\u003e function.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetPixels\u003c/code\u003e is used to retrieve raw image data from existing Earth Engine assets without any prior computation.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ecomputePixels\u003c/code\u003e allows for extracting data from computed images, such as composites, by passing an \u003ccode\u003eee.Image\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eFor large-scale workflows, manual parallelization through multi-threading or utilizing frameworks like Apache Beam, Spark, or Dask is recommended to enhance processing efficiency.\u003c/p\u003e\n"],["\u003cp\u003eEarth Engine's high-volume endpoint and concurrent interactive request quota should be considered for managing numerous parallel requests.\u003c/p\u003e\n"]]],[],null,["# Image Data Extraction\n\nGetting image data from Earth Engine\n------------------------------------\n\n\nTo get image data from Earth Engine to Google Drive, Cloud Storage, or an Earth Engine asset,\nyou can use [`Export`](/earth-engine/guides/exporting) and the job\nis handled entirely by Earth Engine. If your export jobs have scaling issues (e.g.\ntake longer than a day, return memory or timeout errors) or you're already familiar\nwith a framework like [Apache Beam](https://beam.apache.org/),\n[Spark](https://spark.apache.org/) or [Dask](https://www.dask.org/),\nyou may prefer the data extraction methods described here. Workflows implemented in these\nframeworks can be scaled using Google Cloud tools such as\n[Dataflow](https://cloud.google.com/dataflow) or\n[Dataproc](https://cloud.google.com/dataproc).\n\n\nSpecifically, this guide describes methods for manually making requests\nfor image data using\n[`getPixels`](/earth-engine/apidocs/ee-data-getpixels) or\n[`computePixels`](/earth-engine/apidocs/ee-data-computepixels).\nHere, \"image data\" means multi-dimensional arrays of pixel values with consistent\nscale and projection. The region, scale, projection and/or dimensions are specified\nin the request. The\n[ImageFileFormat page](/earth-engine/reference/rest/v1/ImageFileFormat) lists\npossible output formats. Output destinations include Cloud Storage or any locally mounted\ndirectory. Manual requests add complexity, but can scale to larger workloads.\n\nGetting image data from existing assets\n---------------------------------------\n\nUse [`getPixels`](/earth-engine/apidocs/ee-data-getpixels)\nto get image data from existing Earth Engine assets. You\npass the asset ID directly to the request, so you can't do any computation on the pixels\nprior to extracting them. A block of pixels in the specified region, scale, projection\nand format is returned. The following example demonstrates getting time series of NDVI\nfrom a MODIS image collection using `getPixels`. \n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Run in Google Colab](https://colab.research.google.com/github/google/earthengine-community/blob/master/guides/linked/Earth_Engine_training_patches_getPixels.ipynb) | [View source on GitHub](https://github.com/google/earthengine-community/blob/master/guides/linked/Earth_Engine_training_patches_getPixels.ipynb) |\n\nGetting image data from computed images\n---------------------------------------\n\n\nUse [`computePixels`](/earth-engine/apidocs/ee-data-computepixels)\nto get image data from a computed image, for example a composite. With\n[`computePixels`](/earth-engine/apidocs/ee-data-computepixels),\nyou pass a computed `ee.Image` object through the `expression`\nparameter. A block of computed pixels in the specified region, scale, projection and\nformat is returned. The following example shows getting patches of multispectral data\nfrom a cloud-free Sentinel-2 composite. \n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Run in Google Colab](https://colab.research.google.com/github/google/earthengine-community/blob/master/guides/linked/Earth_Engine_training_patches_computePixels.ipynb) | [View source on GitHub](https://github.com/google/earthengine-community/blob/master/guides/linked/Earth_Engine_training_patches_computePixels.ipynb) |\n\nManual parallelization of requests\n----------------------------------\n\n\nThough you can make requests for any purpose in any volume, you may want to parallelize\nrequests for larger workflows. To make many such requests in parallel, you should use\nthe [Earth Engine high volume endpoint](/earth-engine/cloud/highvolume).\nThe number of parallel requests you can have is set by your\n[concurrent\ninteractive request quota](/earth-engine/guides/usage#concurrent_interactive_requests). See the [Earth\nEngine high volume page](/earth-engine/cloud/highvolume) for details on when to use the high volume endpoint.\n\n### Multi-threading\n\nYou can use threads to make concurrrent requests. This approach is demonstrated in the\n`getPixels` and `computePixels` example notebooks.\n\n### Apache Beam\n\n\nYou can use [Apache Beam](https://beam.apache.org/) pipelines to parallelize\nrequests. These pipelines can be run locally or as Google Dataflow jobs. For examples, see\n[this Geo for Good training](https://earthoutreachonair.withgoogle.com/events/geoforgood22?talk=day1-trackthree-talk2) or\n[this People, Planet and AI demonstration](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/people-and-planet-ai/land-cover-classification). Alternatively, other parallelization\nlibraries include [Dask](https://www.dask.org/) and\n[Apache Spark](https://spark.apache.org/)."]]