公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
圖片資訊和中繼資料
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
列印圖片物件,探索頻帶名稱、投影資訊、屬性和其他中繼資料。以下範例說明如何列印整組圖片中繼資料,以及如何以程式輔助方式要求特定中繼資料元素。
程式碼編輯器 (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 環境」頁面,瞭解 Python API 和如何使用 geemap
進行互動式開發。
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
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間: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```"]]