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.
print
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Stampa gli argomenti nella console.
Utilizzo | Resi |
---|
print(var_args) | |
Argomento | Tipo | Dettagli |
---|
var_args | VarArgs<Object> | Gli oggetti da stampare. |
Esempi
Editor di codice (JavaScript)
print(1); // 1
print(ee.Number(1)); // 1
print(ee.Array([1])); // [1]
print(ee.ImageCollection('AAFC/ACI').size()); // 10
print(ee.Image('AAFC/ACI/2009')); // Image AAFC/ACI/2009 (1 band)
print(ee.FeatureCollection("NOAA/NHC/HURDAT2/pacific").size()); // 28547
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)
"""There is no dedicated print function for the Earth Engine Python API.
To print Earth Engine objects, use Python's built-in `print` function.
Printing an Earth Engine object in Python prints the serialized request for the
object, not the object itself, so you must call `getInfo()` on Earth Engine
objects to get the desired object from the server to the client. For example,
`print(ee.Number(1).getInfo())`. Note that `getInfo()` is a synchronous
operation. Alternatively, the eerepr library provides rich Earth Engine object
representation; it is included in the geemap library.
"""
print(1) # 1
print(ee.Number(1).getInfo()) # 1
print(ee.Array([1]).getInfo()) # [1]
print(ee.ImageCollection('AAFC/ACI').size().getInfo()) # 10
print(ee.Image('AAFC/ACI/2009').getInfo()) # Image AAFC/ACI/2009 (1 band)
print(
ee.FeatureCollection("NOAA/NHC/HURDAT2/pacific").size().getInfo()
) # 28547
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-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eprint()\u003c/code\u003e displays the provided arguments, including Earth Engine objects and standard data types, in the console.\u003c/p\u003e\n"],["\u003cp\u003eIn JavaScript, \u003ccode\u003eprint()\u003c/code\u003e directly displays Earth Engine objects, while in Python, you typically need to use \u003ccode\u003egetInfo()\u003c/code\u003e or the \u003ccode\u003eeerepr\u003c/code\u003e library for proper visualization.\u003c/p\u003e\n"],["\u003cp\u003eThe function accepts a variable number of arguments (\u003ccode\u003evar_args\u003c/code\u003e) representing the objects to be printed.\u003c/p\u003e\n"],["\u003cp\u003eExamples are provided demonstrating the usage of \u003ccode\u003eprint()\u003c/code\u003e with various Earth Engine objects like \u003ccode\u003eee.Number\u003c/code\u003e, \u003ccode\u003eee.Array\u003c/code\u003e, \u003ccode\u003eee.ImageCollection\u003c/code\u003e, and \u003ccode\u003eee.Image\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `print` function displays objects to the console. It accepts `VarArgs` as input. In JavaScript, `print(var_args)` directly outputs the object's value. In Python, the built-in `print` displays the serialized request for Earth Engine objects. To print the object's value in Python, `.getInfo()` is needed, which synchronously retrieves the object from the server, as in `print(ee.Number(1).getInfo())`. Example cases are shown for numbers, arrays, and image collections.\n"],null,["# print\n\n\u003cbr /\u003e\n\nPrints the arguments to the console.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------|---------|\n| `print(var_args)` | |\n\n| Argument | Type | Details |\n|------------|-------------------|-----------------------|\n| `var_args` | VarArgs\\\u003cObject\\\u003e | The objects to print. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nprint(1); // 1\nprint(ee.Number(1)); // 1\nprint(ee.Array([1])); // [1]\n\nprint(ee.ImageCollection('AAFC/ACI').size()); // 10\nprint(ee.Image('AAFC/ACI/2009')); // Image AAFC/ACI/2009 (1 band)\n\nprint(ee.FeatureCollection(\"NOAA/NHC/HURDAT2/pacific\").size()); // 28547\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\"\"\"There is no dedicated print function for the Earth Engine Python API.\nTo print Earth Engine objects, use Python's built-in `print` function.\nPrinting an Earth Engine object in Python prints the serialized request for the\nobject, not the object itself, so you must call `getInfo()` on Earth Engine\nobjects to get the desired object from the server to the client. For example,\n`print(ee.Number(1).getInfo())`. Note that `getInfo()` is a synchronous\noperation. Alternatively, the eerepr library provides rich Earth Engine object\nrepresentation; it is included in the geemap library.\n\"\"\"\n\nprint(1) # 1\nprint(ee.Number(1).getInfo()) # 1\nprint(ee.Array([1]).getInfo()) # [1]\n\nprint(ee.ImageCollection('AAFC/ACI').size().getInfo()) # 10\nprint(ee.Image('AAFC/ACI/2009').getInfo()) # Image AAFC/ACI/2009 (1 band)\n\nprint(\n ee.FeatureCollection(\"NOAA/NHC/HURDAT2/pacific\").size().getInfo()\n) # 28547\n```"]]