Informations et métadonnées sur l'image
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Imprimez des objets image pour explorer les noms de bandes, les informations de projection, les propriétés et d'autres métadonnées. Les exemples suivants montrent comment imprimer l'ensemble des métadonnées d'image, ainsi que comment demander des éléments de métadonnées spécifiques par programmation.
Éditeur de code (JavaScript)
// Load an image.
var image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318');
// Display all metadata.
print('All metadata:', image);
// Get information about the bands as a list.
var bandNames = image.bandNames();
print('Band names:', bandNames); // ee.List of band names
// Get projection information from band 1.
var b1proj = image.select('B1').projection();
print('Band 1 projection:', b1proj); // ee.Projection object
// Get scale (in meters) information from band 1.
var b1scale = image.select('B1').projection().nominalScale();
print('Band 1 scale:', b1scale); // ee.Number
// Note that different bands can have different projections and scale.
var b8scale = image.select('B8').projection().nominalScale();
print('Band 8 scale:', b8scale); // ee.Number
// Get a list of all metadata properties.
var properties = image.propertyNames();
print('Metadata properties:', properties); // ee.List of metadata properties
// Get a specific metadata property.
var cloudiness = image.get('CLOUD_COVER');
print('CLOUD_COVER:', cloudiness); // ee.Number
// Get version number (ingestion timestamp as microseconds since Unix epoch).
var version = image.get('system:version');
print('Version:', version); // ee.Number
print('Version (as ingestion date):',
ee.Date(ee.Number(version).divide(1000))); // ee.Date
// Get the timestamp and convert it to a date.
var date = ee.Date(image.get('system:time_start'));
print('Timestamp:', date); // ee.Date
Configuration de Python
Consultez la page
Environnement Python pour en savoir plus sur l'API Python et l'utilisation de geemap
pour le développement interactif.
import ee
import geemap.core as geemap
Colab (Python)
# Load an image.
image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318')
# All metadata.
display('All metadata:', image)
# Get information about the bands as a list.
band_names = image.bandNames()
display('Band names:', band_names) # ee.List of band names
# Get projection information from band 1.
b1_proj = image.select('B1').projection()
display('Band 1 projection:', b1_proj) # ee.Projection object
# Get scale (in meters) information from band 1.
b1_scale = image.select('B1').projection().nominalScale()
display('Band 1 scale:', b1_scale) # ee.Number
# Note that different bands can have different projections and scale.
b8_scale = image.select('B8').projection().nominalScale()
display('Band 8 scale:', b8_scale) # ee.Number
# Get a list of all metadata properties.
properties = image.propertyNames()
display('Metadata properties:', properties) # ee.List of metadata properties
# Get a specific metadata property.
cloudiness = image.get('CLOUD_COVER')
display('CLOUD_COVER:', cloudiness) # ee.Number
# Get version number (ingestion timestamp as microseconds since Unix epoch).
version = image.get('system:version')
display('Version:', version) # ee.Number
display(
'Version (as ingestion date):',
ee.Date(ee.Number(version).divide(1000)).format(),
) # ee.Date
# Get the timestamp.
ee_date = ee.Date(image.get('system:time_start'))
display('Timestamp:', ee_date) # ee.Date
# Date objects transferred to the client are milliseconds since UNIX epoch;
# convert to human readable date with ee.Date.format().
display('Datetime:', ee_date.format()) # ISO standard date string
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003eThis guide demonstrates how to access and print image metadata in Earth Engine, including band names, projection details, properties, and timestamps.\u003c/p\u003e\n"],["\u003cp\u003eUsers can retrieve specific metadata elements programmatically using methods like \u003ccode\u003ebandNames()\u003c/code\u003e, \u003ccode\u003eprojection()\u003c/code\u003e, \u003ccode\u003enominalScale()\u003c/code\u003e, \u003ccode\u003epropertyNames()\u003c/code\u003e, and \u003ccode\u003eget()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eCode examples are provided in both JavaScript and Python, showcasing how to obtain metadata such as band information, projection details, scale, metadata properties, cloud cover, and ingestion timestamps.\u003c/p\u003e\n"],["\u003cp\u003eDifferent bands within an image may have varying projections and scales, highlighting the importance of accessing band-specific metadata.\u003c/p\u003e\n"],["\u003cp\u003eThe guide utilizes an example Landsat 8 image to illustrate the metadata retrieval process, enabling users to adapt the techniques for their specific datasets.\u003c/p\u003e\n"]]],["The content demonstrates how to access and display image metadata using Earth Engine's JavaScript and Python APIs. Key actions include loading an image, printing all its metadata, and extracting specific information such as band names, projection details, and band scales. It also showcases retrieving metadata properties like cloud cover and version number, alongside converting timestamps to human-readable dates, using the `ee.Date` function and formatting it with `.format()`.\n"],null,["# Image Information and Metadata\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [Run in Google Colab](https://colab.research.google.com/github/google/earthengine-community/blob/master/guides/linked/generated/image_info.ipynb) | [View source on GitHub](https://github.com/google/earthengine-community/blob/master/guides/linked/generated/image_info.ipynb) |\n\nPrint image objects to explore band names, projection information, properties, and other\nmetadata. The following examples demonstrate printing the entire set of image metadata\nas well as requesting specific metadata elements programmatically.\n\nGetting metadata\n----------------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Load an image.\nvar image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318');\n\n// Display all metadata.\nprint('All metadata:', image);\n\n// Get information about the bands as a list.\nvar bandNames = image.bandNames();\nprint('Band names:', bandNames); // ee.List of band names\n\n// Get projection information from band 1.\nvar b1proj = image.select('B1').projection();\nprint('Band 1 projection:', b1proj); // ee.Projection object\n\n// Get scale (in meters) information from band 1.\nvar b1scale = image.select('B1').projection().nominalScale();\nprint('Band 1 scale:', b1scale); // ee.Number\n\n// Note that different bands can have different projections and scale.\nvar b8scale = image.select('B8').projection().nominalScale();\nprint('Band 8 scale:', b8scale); // ee.Number\n\n// Get a list of all metadata properties.\nvar properties = image.propertyNames();\nprint('Metadata properties:', properties); // ee.List of metadata properties\n\n// Get a specific metadata property.\nvar cloudiness = image.get('CLOUD_COVER');\nprint('CLOUD_COVER:', cloudiness); // ee.Number\n\n// Get version number (ingestion timestamp as microseconds since Unix epoch).\nvar version = image.get('system:version');\nprint('Version:', version); // ee.Number\nprint('Version (as ingestion date):',\n ee.Date(ee.Number(version).divide(1000))); // ee.Date\n\n// Get the timestamp and convert it to a date.\nvar date = ee.Date(image.get('system:time_start'));\nprint('Timestamp:', date); // ee.Date\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# Load an image.\nimage = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318')\n\n# All metadata.\ndisplay('All metadata:', image)\n\n# Get information about the bands as a list.\nband_names = image.bandNames()\ndisplay('Band names:', band_names) # ee.List of band names\n\n# Get projection information from band 1.\nb1_proj = image.select('B1').projection()\ndisplay('Band 1 projection:', b1_proj) # ee.Projection object\n\n# Get scale (in meters) information from band 1.\nb1_scale = image.select('B1').projection().nominalScale()\ndisplay('Band 1 scale:', b1_scale) # ee.Number\n\n# Note that different bands can have different projections and scale.\nb8_scale = image.select('B8').projection().nominalScale()\ndisplay('Band 8 scale:', b8_scale) # ee.Number\n\n# Get a list of all metadata properties.\nproperties = image.propertyNames()\ndisplay('Metadata properties:', properties) # ee.List of metadata properties\n\n# Get a specific metadata property.\ncloudiness = image.get('CLOUD_COVER')\ndisplay('CLOUD_COVER:', cloudiness) # ee.Number\n\n# Get version number (ingestion timestamp as microseconds since Unix epoch).\nversion = image.get('system:version')\ndisplay('Version:', version) # ee.Number\ndisplay(\n 'Version (as ingestion date):',\n ee.Date(ee.Number(version).divide(1000)).format(),\n) # ee.Date\n\n# Get the timestamp.\nee_date = ee.Date(image.get('system:time_start'))\ndisplay('Timestamp:', ee_date) # ee.Date\n\n# Date objects transferred to the client are milliseconds since UNIX epoch;\n# convert to human readable date with ee.Date.format().\ndisplay('Datetime:', ee_date.format()) # ISO standard date string\n```"]]