Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
ee.ImageCollection.merge
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Unisce due raccolte di immagini in una sola. Il risultato contiene tutte le immagini presenti in entrambe le raccolte.
Utilizzo | Resi |
---|
ImageCollection.merge(collection2) | ImageCollection |
Argomento | Tipo | Dettagli |
---|
questo: collection1 | ImageCollection | La prima raccolta da unire. |
collection2 | ImageCollection | La seconda raccolta da unire. |
Esempi
Editor di codice (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);
Configurazione di Python
Consulta la pagina
Ambiente Python per informazioni sull'API Python e sull'utilizzo di
geemap
per lo sviluppo interattivo.
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())
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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```"]]