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.List.add
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Anexa o elemento ao final da lista.
Uso | Retorna |
---|
List.add(element) | Lista |
Argumento | Tipo | Detalhes |
---|
isso: list | Lista | |
element | Objeto | |
Exemplos
Editor de código (JavaScript)
print(ee.List([]).add('b')); // ["b"]
print(ee.List(['a']).add('b')); // ["a","b"]
print(ee.List(['a']).add(ee.String('b'))); // ["a","b"]
print(ee.List(['a']).add(1)); // ["a",1]
print(ee.List(['a']).add(ee.Number(1))); // ["a",1]
print(ee.List(['a']).add(true)); // ["a",true]
print(ee.List(['a']).add([])); // ["a",[]]
print(ee.List(['a']).add(ee.List([]))); // ["a",[]]
print(ee.List(['a']).add(['b'])); // ["a",["b"]]
print(ee.List(['a']).add(ee.List(['b']))); // ["a",["b"]]
print(ee.List(['a']).add(ee.Dictionary())); // ["a",{}]
print(ee.List(['a']).add(ee.Dictionary({b: 'c'}))); // ["a",{"b":"c"}]
// 0: a
// 1: Image (1 band)
print(ee.List(['a']).add(ee.Image.constant(1)));
// ["a",{"type":"ImageCollection","bands":[]}]
print(ee.List(['a']).add(ee.ImageCollection([])));
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)
print(ee.List([]).add('b').getInfo()) # ['b']
print(ee.List(['a']).add('b').getInfo()) # ['a', 'b']
print(ee.List(['a']).add(ee.String('b')).getInfo()) # ['a', 'b']
print(ee.List(['a']).add(1).getInfo()) # ['a', 1]
print(ee.List(['a']).add(ee.Number(1)).getInfo()) # ['a', 1]
print(ee.List(['a']).add(True).getInfo()) # ['a', True]
print(ee.List(['a']).add([]).getInfo()) # ['a', []]
print(ee.List(['a']).add(ee.List([])).getInfo()) # ['a', []]
print(ee.List(['a']).add(['b']).getInfo()) # ['a', ['b']]
print(ee.List(['a']).add(ee.List(['b'])).getInfo()) # ['a', ['b']]
print(ee.List(['a']).add(ee.Dictionary()).getInfo()) # ['a', {}]
# ['a', {'b': 'c'}]
print(ee.List(['a']).add(ee.Dictionary({'b': 'c'})).getInfo())
# 0: a
# 1: Image (1 band)
print(ee.List(['a']).add(ee.Image.constant(1)).getInfo())
# ["a", {"type":"ImageCollection", "bands":[]}]
print(ee.List(['a']).add(ee.ImageCollection([])).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\u003eList.add()\u003c/code\u003e appends an element to the end of a list and returns the modified list.\u003c/p\u003e\n"],["\u003cp\u003eThe method accepts any object as the element to be added.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eList.add()\u003c/code\u003e can be chained with other list methods for more complex operations.\u003c/p\u003e\n"],["\u003cp\u003eThe original list is not modified; a new list with the added element is returned.\u003c/p\u003e\n"]]],["The `List.add(element)` function appends an element to the end of a list. It takes an object as an argument (`element`), which can be any data type. The function modifies the list by adding the provided element at the end. It returns the modified list. The examples show different elements added to a list, including strings, numbers, booleans, empty lists, and even more complex data structures like dictionaries, images, and image collections.\n"],null,["# ee.List.add\n\nAppends the element to the end of list.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------|---------|\n| List.add`(element)` | List |\n\n| Argument | Type | Details |\n|--------------|--------|---------|\n| this: `list` | List | |\n| `element` | Object | |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nprint(ee.List([]).add('b')); // [\"b\"]\nprint(ee.List(['a']).add('b')); // [\"a\",\"b\"]\nprint(ee.List(['a']).add(ee.String('b'))); // [\"a\",\"b\"]\n\nprint(ee.List(['a']).add(1)); // [\"a\",1]\nprint(ee.List(['a']).add(ee.Number(1))); // [\"a\",1]\n\nprint(ee.List(['a']).add(true)); // [\"a\",true]\n\nprint(ee.List(['a']).add([])); // [\"a\",[]]\nprint(ee.List(['a']).add(ee.List([]))); // [\"a\",[]]\nprint(ee.List(['a']).add(['b'])); // [\"a\",[\"b\"]]\nprint(ee.List(['a']).add(ee.List(['b']))); // [\"a\",[\"b\"]]\n\nprint(ee.List(['a']).add(ee.Dictionary())); // [\"a\",{}]\nprint(ee.List(['a']).add(ee.Dictionary({b: 'c'}))); // [\"a\",{\"b\":\"c\"}]\n\n// 0: a\n// 1: Image (1 band)\nprint(ee.List(['a']).add(ee.Image.constant(1)));\n\n// [\"a\",{\"type\":\"ImageCollection\",\"bands\":[]}]\nprint(ee.List(['a']).add(ee.ImageCollection([])));\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\nprint(ee.List([]).add('b').getInfo()) # ['b']\nprint(ee.List(['a']).add('b').getInfo()) # ['a', 'b']\nprint(ee.List(['a']).add(ee.String('b')).getInfo()) # ['a', 'b']\n\nprint(ee.List(['a']).add(1).getInfo()) # ['a', 1]\nprint(ee.List(['a']).add(ee.Number(1)).getInfo()) # ['a', 1]\n\nprint(ee.List(['a']).add(True).getInfo()) # ['a', True]\n\nprint(ee.List(['a']).add([]).getInfo()) # ['a', []]\nprint(ee.List(['a']).add(ee.List([])).getInfo()) # ['a', []]\nprint(ee.List(['a']).add(['b']).getInfo()) # ['a', ['b']]\nprint(ee.List(['a']).add(ee.List(['b'])).getInfo()) # ['a', ['b']]\n\nprint(ee.List(['a']).add(ee.Dictionary()).getInfo()) # ['a', {}]\n\n# ['a', {'b': 'c'}]\nprint(ee.List(['a']).add(ee.Dictionary({'b': 'c'})).getInfo())\n\n# 0: a\n# 1: Image (1 band)\nprint(ee.List(['a']).add(ee.Image.constant(1)).getInfo())\n\n# [\"a\", {\"type\":\"ImageCollection\", \"bands\":[]}]\nprint(ee.List(['a']).add(ee.ImageCollection([])).getInfo())\n```"]]