ee.ImageCollection.filter
Stay organized with collections
Save and categorize content based on your preferences.
Apply a filter to this collection.
Returns the filtered collection.
Usage | Returns | ImageCollection.filter(filter) | Collection |
Argument | Type | Details | this: collection | Collection | The Collection instance. |
filter | Filter | A filter to apply to this collection. |
Examples
Code Editor (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 setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
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())
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]