ee.ImageCollection.merge
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Führt zwei Bildsammlungen in einer zusammen. Das Ergebnis enthält alle Bilder, die in einer der beiden Sammlungen waren.
Nutzung | Ausgabe |
---|
ImageCollection.merge(collection2) | ImageCollection |
Argument | Typ | Details |
---|
So gehts: collection1 | ImageCollection | Die erste Sammlung, die zusammengeführt werden soll. |
collection2 | ImageCollection | Die zweite Sammlung, die zusammengeführt werden soll. |
Beispiele
Code-Editor (JavaScript)
// Sentinel-2 surface reflectance image collection.
var ic = ee.ImageCollection('COPERNICUS/S2_SR');
// Filter the images to those that intersect Mount Shasta for 3 months
// in 2019 and 2021 (two image collections).
var geom = ee.Geometry.Point(-122.196, 41.411);
var ic2018 = ic.filterBounds(geom).filterDate('2019-07-01', '2019-10-01');
print('2018 image collection', ic2018);
var ic2021 = ic.filterBounds(geom).filterDate('2021-07-01', '2021-10-01');
print('2021 image collection', ic2021);
// Merge the two image collections.
var icMerged = ic2018.merge(ic2021);
print('Merged image collection', icMerged);
Python einrichten
Informationen zur Python API und zur Verwendung von geemap
für die interaktive Entwicklung finden Sie auf der Seite
Python-Umgebung.
import ee
import geemap.core as geemap
Colab (Python)
# Sentinel-2 surface reflectance image collection.
ic = ee.ImageCollection('COPERNICUS/S2_SR')
# Filter the images to those that intersect Mount Shasta for 3 months
# in 2019 and 2021 (two image collections).
geom = ee.Geometry.Point(-122.196, 41.411)
ic2018 = ic.filterBounds(geom).filterDate('2019-07-01', '2019-10-01')
print('2018 image collection:', ic2018.getInfo())
ic2021 = ic.filterBounds(geom).filterDate('2021-07-01', '2021-10-01')
print('2021 image collection:', ic2021.getInfo())
# Merge the two image collections.
ic_merged = ic2018.merge(ic2021)
print('Merged image collection:', ic_merged.getInfo())
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003e\u003ccode\u003emerge()\u003c/code\u003e combines two ImageCollections, resulting in a new collection containing all images from both inputs.\u003c/p\u003e\n"],["\u003cp\u003eThe output of \u003ccode\u003emerge()\u003c/code\u003e is a new ImageCollection with no duplicates.\u003c/p\u003e\n"],["\u003cp\u003eThis function is useful for consolidating image collections filtered by different criteria, such as date ranges or regions, as shown in the example with Sentinel-2 imagery filtered for different years.\u003c/p\u003e\n"]]],["The `merge` method combines two `ImageCollection` objects, `collection1` and `collection2`, into a single `ImageCollection`. This resulting collection contains all images from both input collections. The method takes `collection2` as an argument. An example filters a Sentinel-2 collection for 2019 and 2021, then merges these two filtered collections using `merge(ic2021)`. The output is a new collection containing images from both time periods.\n"],null,["# ee.ImageCollection.merge\n\nMerges two image collections into one. The result has all the images that were in either collection.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------|-----------------|\n| ImageCollection.merge`(collection2)` | ImageCollection |\n\n| Argument | Type | Details |\n|---------------------|-----------------|---------------------------------|\n| this: `collection1` | ImageCollection | The first collection to merge. |\n| `collection2` | ImageCollection | The second collection to merge. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Sentinel-2 surface reflectance image collection.\nvar ic = ee.ImageCollection('COPERNICUS/S2_SR');\n\n// Filter the images to those that intersect Mount Shasta for 3 months\n// in 2019 and 2021 (two image collections).\nvar geom = ee.Geometry.Point(-122.196, 41.411);\nvar ic2018 = ic.filterBounds(geom).filterDate('2019-07-01', '2019-10-01');\nprint('2018 image collection', ic2018);\nvar ic2021 = ic.filterBounds(geom).filterDate('2021-07-01', '2021-10-01');\nprint('2021 image collection', ic2021);\n\n// Merge the two image collections.\nvar icMerged = ic2018.merge(ic2021);\nprint('Merged image collection', icMerged);\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# Sentinel-2 surface reflectance image collection.\nic = ee.ImageCollection('COPERNICUS/S2_SR')\n\n# Filter the images to those that intersect Mount Shasta for 3 months\n# in 2019 and 2021 (two image collections).\ngeom = ee.Geometry.Point(-122.196, 41.411)\nic2018 = ic.filterBounds(geom).filterDate('2019-07-01', '2019-10-01')\nprint('2018 image collection:', ic2018.getInfo())\nic2021 = ic.filterBounds(geom).filterDate('2021-07-01', '2021-10-01')\nprint('2021 image collection:', ic2021.getInfo())\n\n# Merge the two image collections.\nic_merged = ic2018.merge(ic2021)\nprint('Merged image collection:', ic_merged.getInfo())\n```"]]