Anúncio: todos os projetos não comerciais registrados para usar o Earth Engine antes de
15 de abril de 2025 precisam
verificar a qualificação não comercial para manter o acesso ao Earth Engine.
ee.ImageCollection.merge
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Mescla duas coleções de imagens em uma só. O resultado tem todas as imagens que estavam em qualquer uma das coleções.
Uso | Retorna |
---|
ImageCollection.merge(collection2) | ImageCollection |
Argumento | Tipo | Detalhes |
---|
isso: collection1 | ImageCollection | A primeira coleção a ser mesclada. |
collection2 | ImageCollection | A segunda coleção a ser mesclada. |
Exemplos
Editor de código (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);
Configuração do Python
Consulte a página
Ambiente Python para informações sobre a API Python e como usar
geemap
para desenvolvimento interativo.
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())
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-26 UTC.
[null,null,["Última atualização 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```"]]