إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
عمليات الربط المقلوبة
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
لنفترض أنّ الغرض من عملية الدمج هو الاحتفاظ بجميع الصور في مجموعة primary
التي لا تظهر في مجموعة secondary
. يمكنك تنفيذ
هذا النوع من عمليات الربط المقلوب باستخدام ee.Join.inverted()
.
محرِّر الرموز البرمجية (JavaScript)
// Load a Landsat 8 image collection at a point of interest.
var collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
.filterBounds(ee.Geometry.Point(-122.09, 37.42));
// Define start and end dates with which to filter the collections.
var april = '2014-04-01';
var may = '2014-05-01';
var june = '2014-06-01';
var july = '2014-07-01';
// The primary collection is Landsat images from April to June.
var primary = collection.filterDate(april, june);
// The secondary collection is Landsat images from May to July.
var secondary = collection.filterDate(may, july);
// Use an equals filter to define how the collections match.
var filter = ee.Filter.equals({
leftField: 'system:index',
rightField: 'system:index'
});
// Define the join.
var invertedJoin = ee.Join.inverted();
// Apply the join.
var invertedJoined = invertedJoin.apply(primary, secondary, filter);
// Print the result.
print('Inverted join:', invertedJoined);
إعداد لغة Python
اطّلِع على صفحة
بيئة Python للحصول على معلومات عن واجهة برمجة التطبيقات Python API واستخدام IDE
geemap
لتطوير التطبيقات التفاعلي.
import ee
import geemap.core as geemap
Colab (Python)
# Load a Landsat 8 image collection at a point of interest.
collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA').filterBounds(
ee.Geometry.Point(-122.09, 37.42)
)
# Define start and end dates with which to filter the collections.
april = '2014-04-01'
may = '2014-05-01'
june = '2014-06-01'
july = '2014-07-01'
# The primary collection is Landsat images from April to June.
primary = collection.filterDate(april, june)
# The secondary collection is Landsat images from May to July.
secondary = collection.filterDate(may, july)
# Use an equals filter to define how the collections match.
filter = ee.Filter.equals(leftField='system:index', rightField='system:index')
# Define the join.
inverted_join = ee.Join.inverted()
# Apply the join.
inverted_joined = inverted_join.apply(primary, secondary, filter)
# Print the result.
display('Inverted join:', inverted_joined)
من المفترض أن يظهر الناتج على النحو التالي:
Image LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140403 (17 bands)
Image LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140419 (17 bands)
يحتوي الربط المقلوب على الصور من 3 نيسان (أبريل) و19 نيسان (أبريل)، ما يشير إلى الصور
المتوفّرة في مجموعة primary
ولكن ليس في مجموعة
secondary
.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003eee.Join.inverted()\u003c/code\u003e allows you to keep images from a primary collection that do not have matching images in a secondary collection based on a specified filter.\u003c/p\u003e\n"],["\u003cp\u003eThis example demonstrates how to use \u003ccode\u003eee.Join.inverted()\u003c/code\u003e to identify Landsat 8 images from April that are not present in the May to July timeframe.\u003c/p\u003e\n"],["\u003cp\u003eAn \u003ccode\u003eee.Filter.equals()\u003c/code\u003e is employed to define matching criteria between the collections, typically using a common property like 'system:index'.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting collection contains only images unique to the primary collection, effectively isolating images not found in the secondary collection.\u003c/p\u003e\n"]]],["The content demonstrates how to use `ee.Join.inverted()` to retain images from a `primary` collection that are absent in a `secondary` collection. It involves loading a Landsat 8 image collection and defining `primary` (April-June) and `secondary` (May-July) collections. An equals filter is used to match images by their system index. The `invertedJoin` is defined and applied, resulting in images present in the `primary` but not in the `secondary` collection, exemplified by images from April 3rd and 19th.\n"],null,["# Inverted Joins\n\nSuppose that the purpose of the join is to retain all images in the `primary`\ncollection that are not in the `secondary` collection. You can perform this\ntype of inverted join using `ee.Join.inverted()`.\n\n### Code Editor (JavaScript)\n\n```javascript\n// Load a Landsat 8 image collection at a point of interest.\nvar collection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')\n .filterBounds(ee.Geometry.Point(-122.09, 37.42));\n\n// Define start and end dates with which to filter the collections.\nvar april = '2014-04-01';\nvar may = '2014-05-01';\nvar june = '2014-06-01';\nvar july = '2014-07-01';\n\n// The primary collection is Landsat images from April to June.\nvar primary = collection.filterDate(april, june);\n\n// The secondary collection is Landsat images from May to July.\nvar secondary = collection.filterDate(may, july);\n\n// Use an equals filter to define how the collections match.\nvar filter = ee.Filter.equals({\n leftField: 'system:index',\n rightField: 'system:index'\n});\n\n// Define the join.\nvar invertedJoin = ee.Join.inverted();\n\n// Apply the join.\nvar invertedJoined = invertedJoin.apply(primary, secondary, filter);\n\n// Print the result.\nprint('Inverted join:', invertedJoined);\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 a Landsat 8 image collection at a point of interest.\ncollection = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA').filterBounds(\n ee.Geometry.Point(-122.09, 37.42)\n)\n\n# Define start and end dates with which to filter the collections.\napril = '2014-04-01'\nmay = '2014-05-01'\njune = '2014-06-01'\njuly = '2014-07-01'\n\n# The primary collection is Landsat images from April to June.\nprimary = collection.filterDate(april, june)\n\n# The secondary collection is Landsat images from May to July.\nsecondary = collection.filterDate(may, july)\n\n# Use an equals filter to define how the collections match.\nfilter = ee.Filter.equals(leftField='system:index', rightField='system:index')\n\n# Define the join.\ninverted_join = ee.Join.inverted()\n\n# Apply the join.\ninverted_joined = inverted_join.apply(primary, secondary, filter)\n\n# Print the result.\ndisplay('Inverted join:', inverted_joined)\n```\n\nThe output should look something like: \n\n```\nImage LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140403 (17 bands)\nImage LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140419 (17 bands)\n```\n\nThe inverted join contains the images from April 3 and April 19, indicating the images\nthat are present in the `primary` collection but not in the\n`secondary` collection."]]