お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.FeatureCollection.filter
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このコレクションにフィルタを適用します。
フィルタされたコレクションを返します。
用途 | 戻り値 |
---|
FeatureCollection.filter(filter) | コレクション |
引数 | タイプ | 詳細 |
---|
これ: collection | コレクション | Collection インスタンス。 |
filter | フィルタ | このコレクションに適用するフィルタ。 |
例
コードエディタ(JavaScript)
// Get Denver county polygon.
var denver = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2')
.filter("ADM2_NAME == 'Denver'")
.filter(ee.Filter.eq('ADM2_NAME', 'Denver')) // Exactly the same as above.
.first()
.geometry();
Map.centerObject(denver, 9);
Map.addLayer(denver, null, 'Denver');
Python の設定
Python API とインタラクティブな開発での geemap
の使用については、
Python 環境のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# Get Denver county polygon.
denver = (
ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2')
.filter("ADM2_NAME == 'Denver'")
.filter(ee.Filter.eq('ADM2_NAME', 'Denver')) # Exactly the same as above.
.first()
.geometry()
)
m = geemap.Map()
m.center_object(denver, 9)
m.add_layer(denver, None, 'Denver')
m
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003e\u003ccode\u003efilter()\u003c/code\u003e returns a filtered version of the original Earth Engine FeatureCollection based on the provided filter criteria.\u003c/p\u003e\n"],["\u003cp\u003eThe filter can be specified using a string expression (e.g., "ADM2_NAME == 'Denver'") or an \u003ccode\u003eee.Filter\u003c/code\u003e object (e.g., \u003ccode\u003eee.Filter.eq('ADM2_NAME', 'Denver')\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThis method allows for the selection of specific features within a collection based on their properties.\u003c/p\u003e\n"],["\u003cp\u003eThe examples demonstrate how to filter a FeatureCollection to obtain a specific feature's geometry (Denver county) and display it on a map.\u003c/p\u003e\n"]]],["The content details how to apply a filter to a `FeatureCollection`, which returns a filtered collection. The `filter` argument, of type `Filter`, is applied to the `Collection` instance. Examples in JavaScript and Python demonstrate filtering a collection to find the 'Denver' county polygon using `.filter()`. This filtering can be done directly using the parameter name and value or using `ee.Filter.eq()` and is applied to the \"ADM2_NAME\" parameter.\n"],null,["# ee.FeatureCollection.filter\n\n\u003cbr /\u003e\n\nApply a filter to this collection.\n\n\u003cbr /\u003e\n\nReturns the filtered collection.\n\n| Usage | Returns |\n|------------------------------------|------------|\n| FeatureCollection.filter`(filter)` | Collection |\n\n| Argument | Type | Details |\n|--------------------|------------|---------------------------------------|\n| this: `collection` | Collection | The Collection instance. |\n| `filter` | Filter | A filter to apply to this collection. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Get Denver county polygon.\nvar denver = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2')\n .filter(\"ADM2_NAME == 'Denver'\")\n .filter(ee.Filter.eq('ADM2_NAME', 'Denver')) // Exactly the same as above.\n .first()\n .geometry();\n\nMap.centerObject(denver, 9);\nMap.addLayer(denver, null, 'Denver');\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# Get Denver county polygon.\ndenver = (\n ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2')\n .filter(\"ADM2_NAME == 'Denver'\")\n .filter(ee.Filter.eq('ADM2_NAME', 'Denver')) # Exactly the same as above.\n .first()\n .geometry()\n)\n\nm = geemap.Map()\nm.center_object(denver, 9)\nm.add_layer(denver, None, 'Denver')\nm\n```"]]