お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ImageCollection のフィルタリング
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
スタートガイドとImageCollection 情報のセクションで説明したように、Earth Engine には、画像コレクションをフィルタするためのさまざまな便利なメソッドが用意されています。具体的には、多くの一般的なユースケースは imageCollection.filterDate()
と imageCollection.filterBounds()
によって処理されます。汎用フィルタリングの場合は、ee.Filter
を引数として imageCollection.filter()
を使用します。次の例は、コンビニエンス メソッドと filter()
の両方を使用して、雲量の多い画像を ImageCollection
から識別して削除する方法を示しています。
コードエディタ(JavaScript)
// Load Landsat 8 data, filter by date, month, and bounds.
var collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
.filterDate('2015-01-01', '2018-01-01') // Three years of data
.filter(ee.Filter.calendarRange(11, 2, 'month')) // Only Nov-Feb observations
.filterBounds(ee.Geometry.Point(25.8544, -18.08874)); // Intersecting ROI
// Also filter the collection by the CLOUD_COVER property.
var filtered = collection.filter(ee.Filter.eq('CLOUD_COVER', 0));
// Create two composites to check the effect of filtering by CLOUD_COVER.
var badComposite = collection.mean();
var goodComposite = filtered.mean();
// Display the composites.
Map.setCenter(25.8544, -18.08874, 13);
Map.addLayer(badComposite,
{bands: ['B3', 'B2', 'B1'], min: 0.05, max: 0.35, gamma: 1.1},
'Bad composite');
Map.addLayer(goodComposite,
{bands: ['B3', 'B2', 'B1'], min: 0.05, max: 0.35, gamma: 1.1},
'Good composite');
Python の設定
Python API とインタラクティブな開発で geemap
を使用する方法については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# Load Landsat 8 data, filter by date, month, and bounds.
collection = (
ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
# Three years of data
.filterDate('2015-01-01', '2018-01-01')
# Only Nov-Feb observations
.filter(ee.Filter.calendarRange(11, 2, 'month'))
# Intersecting ROI
.filterBounds(ee.Geometry.Point(25.8544, -18.08874))
)
# Also filter the collection by the CLOUD_COVER property.
filtered = collection.filter(ee.Filter.eq('CLOUD_COVER', 0))
# Create two composites to check the effect of filtering by CLOUD_COVER.
bad_composite = collection.mean()
good_composite = filtered.mean()
# Display the composites.
m = geemap.Map()
m.set_center(25.8544, -18.08874, 13)
m.add_layer(
bad_composite,
{'bands': ['B3', 'B2', 'B1'], 'min': 0.05, 'max': 0.35, 'gamma': 1.1},
'Bad composite',
)
m.add_layer(
good_composite,
{'bands': ['B3', 'B2', 'B1'], 'min': 0.05, 'max': 0.35, 'gamma': 1.1},
'Good composite',
)
m
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eEarth Engine provides multiple methods for filtering image collections, including convenience functions like \u003ccode\u003efilterDate()\u003c/code\u003e and \u003ccode\u003efilterBounds()\u003c/code\u003e as well as the more general \u003ccode\u003efilter()\u003c/code\u003e method for custom filtering needs.\u003c/p\u003e\n"],["\u003cp\u003eThis example demonstrates how to filter a Landsat 8 image collection by date, month, geographic bounds, and cloud cover using these methods.\u003c/p\u003e\n"],["\u003cp\u003eFiltering by cloud cover significantly improves the quality of composites derived from image collections, as shown by comparing a composite generated from unfiltered data with one generated from data filtered for zero cloud cover.\u003c/p\u003e\n"],["\u003cp\u003eThe code example is provided in both JavaScript and Python, enabling users to apply these filtering techniques in their preferred programming environment within the Earth Engine platform.\u003c/p\u003e\n"]]],["The content demonstrates filtering image collections in Earth Engine. It uses `filterDate()`, `filterBounds()`, and `filter()` to refine a Landsat 8 dataset. The data is filtered by date (2015-2018), month (November-February), and a specific location. Further filtering removes images with high cloud cover using `CLOUD_COVER`. Two composites, one filtered for low cloud cover and one unfiltered, are then created and displayed to illustrate the effect of filtering.\n"],null,["# Filtering an ImageCollection\n\nAs illustrated in the [Get Started section](/earth-engine/guides/getstarted)\nand the [ImageCollection Information section](/earth-engine/guides/ic_info), Earth\nEngine provides a variety of convenience methods for filtering image collections.\nSpecifically, many common use cases are handled by `imageCollection.filterDate()`,\nand `imageCollection.filterBounds()`. For general purpose filtering, use\n`imageCollection.filter()` with an `ee.Filter` as an argument. The\nfollowing example demonstrates both convenience methods and `filter()`\nto identify and remove images with high cloud cover from an `ImageCollection`.\n\n### Code Editor (JavaScript)\n\n```javascript\n// Load Landsat 8 data, filter by date, month, and bounds.\nvar collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')\n .filterDate('2015-01-01', '2018-01-01') // Three years of data\n .filter(ee.Filter.calendarRange(11, 2, 'month')) // Only Nov-Feb observations\n .filterBounds(ee.Geometry.Point(25.8544, -18.08874)); // Intersecting ROI\n\n// Also filter the collection by the CLOUD_COVER property.\nvar filtered = collection.filter(ee.Filter.eq('CLOUD_COVER', 0));\n\n// Create two composites to check the effect of filtering by CLOUD_COVER.\nvar badComposite = collection.mean();\nvar goodComposite = filtered.mean();\n\n// Display the composites.\nMap.setCenter(25.8544, -18.08874, 13);\nMap.addLayer(badComposite,\n {bands: ['B3', 'B2', 'B1'], min: 0.05, max: 0.35, gamma: 1.1},\n 'Bad composite');\nMap.addLayer(goodComposite,\n {bands: ['B3', 'B2', 'B1'], min: 0.05, max: 0.35, gamma: 1.1},\n 'Good composite');\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Load Landsat 8 data, filter by date, month, and bounds.\ncollection = (\n ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')\n # Three years of data\n .filterDate('2015-01-01', '2018-01-01')\n # Only Nov-Feb observations\n .filter(ee.Filter.calendarRange(11, 2, 'month'))\n # Intersecting ROI\n .filterBounds(ee.Geometry.Point(25.8544, -18.08874))\n)\n\n# Also filter the collection by the CLOUD_COVER property.\nfiltered = collection.filter(ee.Filter.eq('CLOUD_COVER', 0))\n\n# Create two composites to check the effect of filtering by CLOUD_COVER.\nbad_composite = collection.mean()\ngood_composite = filtered.mean()\n\n# Display the composites.\nm = geemap.Map()\nm.set_center(25.8544, -18.08874, 13)\nm.add_layer(\n bad_composite,\n {'bands': ['B3', 'B2', 'B1'], 'min': 0.05, 'max': 0.35, 'gamma': 1.1},\n 'Bad composite',\n)\nm.add_layer(\n good_composite,\n {'bands': ['B3', 'B2', 'B1'], 'min': 0.05, 'max': 0.35, 'gamma': 1.1},\n 'Good composite',\n)\nm\n```"]]