إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
فلترة ImageCollection
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
كما هو موضّح في قسم "البدء"
وقسم "معلومات عن مجموعة الصور"، يوفّر Earth
Engine مجموعة متنوعة من الطرق المُريحة لفلترة مجموعات الصور.
على وجه التحديد، تعالج imageCollection.filterDate()
وimageCollection.filterBounds()
العديد من حالات الاستخدام الشائعة. للفلترة للأغراض العامة، استخدِم
imageCollection.filter()
مع ee.Filter
كوسيطة. يوضّح المثال التالي كلّ من الطريقتَين الملائمتَين وfilter()
لتحديد الصور التي تتضمّن تغطية سحابة عالية وإزالتها من ImageCollection
.
محرِّر الرموز البرمجية (JavaScript)
// Load Landsat 8 data, filter by date, month, and bounds.
var collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
.filterDate('2015-01-01', '2018-01-01') // Three years of data
.filter(ee.Filter.calendarRange(11, 2, 'month')) // Only Nov-Feb observations
.filterBounds(ee.Geometry.Point(25.8544, -18.08874)); // Intersecting ROI
// Also filter the collection by the CLOUD_COVER property.
var filtered = collection.filter(ee.Filter.eq('CLOUD_COVER', 0));
// Create two composites to check the effect of filtering by CLOUD_COVER.
var badComposite = collection.mean();
var goodComposite = filtered.mean();
// Display the composites.
Map.setCenter(25.8544, -18.08874, 13);
Map.addLayer(badComposite,
{bands: ['B3', 'B2', 'B1'], min: 0.05, max: 0.35, gamma: 1.1},
'Bad composite');
Map.addLayer(goodComposite,
{bands: ['B3', 'B2', 'B1'], min: 0.05, max: 0.35, gamma: 1.1},
'Good composite');
إعداد لغة Python
اطّلِع على صفحة
بيئة Python للحصول على معلومات عن واجهة برمجة التطبيقات Python API واستخدام IDE
geemap
لتطوير التطبيقات التفاعلي.
import ee
import geemap.core as geemap
Colab (Python)
# Load Landsat 8 data, filter by date, month, and bounds.
collection = (
ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
# Three years of data
.filterDate('2015-01-01', '2018-01-01')
# Only Nov-Feb observations
.filter(ee.Filter.calendarRange(11, 2, 'month'))
# Intersecting ROI
.filterBounds(ee.Geometry.Point(25.8544, -18.08874))
)
# Also filter the collection by the CLOUD_COVER property.
filtered = collection.filter(ee.Filter.eq('CLOUD_COVER', 0))
# Create two composites to check the effect of filtering by CLOUD_COVER.
bad_composite = collection.mean()
good_composite = filtered.mean()
# Display the composites.
m = geemap.Map()
m.set_center(25.8544, -18.08874, 13)
m.add_layer(
bad_composite,
{'bands': ['B3', 'B2', 'B1'], 'min': 0.05, 'max': 0.35, 'gamma': 1.1},
'Bad composite',
)
m.add_layer(
good_composite,
{'bands': ['B3', 'B2', 'B1'], 'min': 0.05, 'max': 0.35, 'gamma': 1.1},
'Good composite',
)
m
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eEarth Engine provides multiple methods for filtering image collections, including convenience functions like \u003ccode\u003efilterDate()\u003c/code\u003e and \u003ccode\u003efilterBounds()\u003c/code\u003e as well as the more general \u003ccode\u003efilter()\u003c/code\u003e method for custom filtering needs.\u003c/p\u003e\n"],["\u003cp\u003eThis example demonstrates how to filter a Landsat 8 image collection by date, month, geographic bounds, and cloud cover using these methods.\u003c/p\u003e\n"],["\u003cp\u003eFiltering by cloud cover significantly improves the quality of composites derived from image collections, as shown by comparing a composite generated from unfiltered data with one generated from data filtered for zero cloud cover.\u003c/p\u003e\n"],["\u003cp\u003eThe code example is provided in both JavaScript and Python, enabling users to apply these filtering techniques in their preferred programming environment within the Earth Engine platform.\u003c/p\u003e\n"]]],["The content demonstrates filtering image collections in Earth Engine. It uses `filterDate()`, `filterBounds()`, and `filter()` to refine a Landsat 8 dataset. The data is filtered by date (2015-2018), month (November-February), and a specific location. Further filtering removes images with high cloud cover using `CLOUD_COVER`. Two composites, one filtered for low cloud cover and one unfiltered, are then created and displayed to illustrate the effect of filtering.\n"],null,["# Filtering an ImageCollection\n\nAs illustrated in the [Get Started section](/earth-engine/guides/getstarted)\nand the [ImageCollection Information section](/earth-engine/guides/ic_info), Earth\nEngine provides a variety of convenience methods for filtering image collections.\nSpecifically, many common use cases are handled by `imageCollection.filterDate()`,\nand `imageCollection.filterBounds()`. For general purpose filtering, use\n`imageCollection.filter()` with an `ee.Filter` as an argument. The\nfollowing example demonstrates both convenience methods and `filter()`\nto identify and remove images with high cloud cover from an `ImageCollection`.\n\n### Code Editor (JavaScript)\n\n```javascript\n// Load Landsat 8 data, filter by date, month, and bounds.\nvar collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')\n .filterDate('2015-01-01', '2018-01-01') // Three years of data\n .filter(ee.Filter.calendarRange(11, 2, 'month')) // Only Nov-Feb observations\n .filterBounds(ee.Geometry.Point(25.8544, -18.08874)); // Intersecting ROI\n\n// Also filter the collection by the CLOUD_COVER property.\nvar filtered = collection.filter(ee.Filter.eq('CLOUD_COVER', 0));\n\n// Create two composites to check the effect of filtering by CLOUD_COVER.\nvar badComposite = collection.mean();\nvar goodComposite = filtered.mean();\n\n// Display the composites.\nMap.setCenter(25.8544, -18.08874, 13);\nMap.addLayer(badComposite,\n {bands: ['B3', 'B2', 'B1'], min: 0.05, max: 0.35, gamma: 1.1},\n 'Bad composite');\nMap.addLayer(goodComposite,\n {bands: ['B3', 'B2', 'B1'], min: 0.05, max: 0.35, gamma: 1.1},\n 'Good composite');\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# Load Landsat 8 data, filter by date, month, and bounds.\ncollection = (\n ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')\n # Three years of data\n .filterDate('2015-01-01', '2018-01-01')\n # Only Nov-Feb observations\n .filter(ee.Filter.calendarRange(11, 2, 'month'))\n # Intersecting ROI\n .filterBounds(ee.Geometry.Point(25.8544, -18.08874))\n)\n\n# Also filter the collection by the CLOUD_COVER property.\nfiltered = collection.filter(ee.Filter.eq('CLOUD_COVER', 0))\n\n# Create two composites to check the effect of filtering by CLOUD_COVER.\nbad_composite = collection.mean()\ngood_composite = filtered.mean()\n\n# Display the composites.\nm = geemap.Map()\nm.set_center(25.8544, -18.08874, 13)\nm.add_layer(\n bad_composite,\n {'bands': ['B3', 'B2', 'B1'], 'min': 0.05, 'max': 0.35, 'gamma': 1.1},\n 'Bad composite',\n)\nm.add_layer(\n good_composite,\n {'bands': ['B3', 'B2', 'B1'], 'min': 0.05, 'max': 0.35, 'gamma': 1.1},\n 'Good composite',\n)\nm\n```"]]