公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Filter.eq
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
篩選中繼資料,只顯示等於指定值的項目。
傳回建構的篩選器。
用量 | 傳回 |
---|
ee.Filter.eq(name, value) | 篩選器 |
引數 | 類型 | 詳細資料 |
---|
name | 字串 | 要篩選的屬性名稱。 |
value | 物件 | 要比較的基準值。 |
範例
程式碼編輯器 (JavaScript)
// The GOES Mesoscale images come in two domains.
// Separate the two groups using ee.Filter.eq.
var goes17_mcmipm = ee.ImageCollection('NOAA/GOES/17/MCMIPM');
var goes17_mcmipm_2019 =
goes17_mcmipm.filterDate(ee.Date('2019-11-01'), ee.Date('2019-11-05'));
var d1 = goes17_mcmipm_2019.filter(ee.Filter.eq('domain', 1));
var d2 = goes17_mcmipm_2019.filter(ee.Filter.eq('domain', 2));
print(goes17_mcmipm_2019.size());
print(d1.size());
print(d2.size());
Python 設定
請參閱
Python 環境頁面,瞭解 Python API 和如何使用 geemap
進行互動式開發。
import ee
import geemap.core as geemap
Colab (Python)
# The GOES Mesoscale images come in two domains.
# Separate the two groups using ee.Filter.eq.
goes17_mcmipm = ee.ImageCollection('NOAA/GOES/17/MCMIPM')
goes17_mcmipm_2019 = goes17_mcmipm.filterDate(
ee.Date('2019-11-01'), ee.Date('2019-11-05')
)
d1 = goes17_mcmipm_2019.filter(ee.Filter.eq('domain', 1))
d2 = goes17_mcmipm_2019.filter(ee.Filter.eq('domain', 2))
print(goes17_mcmipm_2019.size().getInfo())
print(d1.size().getInfo())
print(d2.size().getInfo())
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eee.Filter.eq()\u003c/code\u003e filters an ImageCollection based on property values, returning a new filtered collection.\u003c/p\u003e\n"],["\u003cp\u003eIt takes two arguments: \u003ccode\u003ename\u003c/code\u003e (the property to filter on) and \u003ccode\u003evalue\u003c/code\u003e (the value to match).\u003c/p\u003e\n"],["\u003cp\u003eThis filter is useful for selecting specific data within an ImageCollection, such as isolating images with particular metadata attributes, as demonstrated with the GOES Mesoscale imagery example.\u003c/p\u003e\n"]]],[],null,["# ee.Filter.eq\n\n\u003cbr /\u003e\n\nFilter to metadata equal to the given value.\n\n\u003cbr /\u003e\n\nReturns the constructed filter.\n\n| Usage | Returns |\n|-----------------------------|---------|\n| `ee.Filter.eq(name, value)` | Filter |\n\n| Argument | Type | Details |\n|----------|--------|---------------------------------|\n| `name` | String | The property name to filter on. |\n| `value` | Object | The value to compare against. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// The GOES Mesoscale images come in two domains.\n// Separate the two groups using ee.Filter.eq.\nvar goes17_mcmipm = ee.ImageCollection('NOAA/GOES/17/MCMIPM');\nvar goes17_mcmipm_2019 =\n goes17_mcmipm.filterDate(ee.Date('2019-11-01'), ee.Date('2019-11-05'));\n\nvar d1 = goes17_mcmipm_2019.filter(ee.Filter.eq('domain', 1));\nvar d2 = goes17_mcmipm_2019.filter(ee.Filter.eq('domain', 2));\nprint(goes17_mcmipm_2019.size()); \nprint(d1.size());\nprint(d2.size());\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# The GOES Mesoscale images come in two domains.\n# Separate the two groups using ee.Filter.eq.\ngoes17_mcmipm = ee.ImageCollection('NOAA/GOES/17/MCMIPM')\ngoes17_mcmipm_2019 = goes17_mcmipm.filterDate(\n ee.Date('2019-11-01'), ee.Date('2019-11-05')\n)\n\nd1 = goes17_mcmipm_2019.filter(ee.Filter.eq('domain', 1))\nd2 = goes17_mcmipm_2019.filter(ee.Filter.eq('domain', 2))\nprint(goes17_mcmipm_2019.size().getInfo())\nprint(d1.size().getInfo())\nprint(d2.size().getInfo())\n```"]]