公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
图片信息和元数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
输出图片对象,以探索波段名称、投影信息、属性和其他元数据。以下示例演示了如何输出整套图片元数据,以及如何以编程方式请求特定元数据元素。
Code Editor (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
Python 设置
如需了解 Python API 以及如何使用 geemap
进行交互式开发,请参阅
Python 环境页面。
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
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\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```"]]