Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 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,["\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\nCode 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\nColab (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```"]]