이미지 정보 및 메타데이터

이미지 객체를 출력하여 밴드 이름, 투영 정보, 속성, 기타 메타데이터를 살펴봅니다. 다음 예에서는 전체 이미지 메타데이터 세트를 출력하고 특정 메타데이터 요소를 프로그래매틱 방식으로 요청하는 방법을 보여줍니다.

메타데이터 가져오기

코드 편집기 (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