ee.ImageCollection.filter

對這個集合套用篩選器。

傳回經過篩選的集合。

用量傳回
ImageCollection.filter(filter)集合
引數類型詳細資料
這個:collection集合Collection 執行個體。
filter篩選器要套用至這個集合的篩選器。

範例

程式碼編輯器 (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_day =
    goes17_mcmipm.filterDate('2020-09-26', '2020-09-27');

var d1 = goes17_mcmipm_day.filter('domain == 1');
var d2 = goes17_mcmipm_day.filter('domain == 2');
// domain 3 does not exist.
var d3 = goes17_mcmipm_day.filter('domain == 3');

print(goes17_mcmipm_day.size());
print(d1.size());
print(d2.size());
print(d3.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_day = goes17_mcmipm.filterDate('2020-09-26', '2020-09-27')

d1 = goes17_mcmipm_day.filter('domain == 1')
d2 = goes17_mcmipm_day.filter('domain == 2')
# domain 3 does not exist.
d3 = goes17_mcmipm_day.filter('domain == 3')

print(goes17_mcmipm_day.size().getInfo())
print(d1.size().getInfo())
print(d2.size().getInfo())
print(d3.size().getInfo())