-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathimage_metadata.py
31 lines (21 loc) · 896 Bytes
/
image_metadata.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import ee
import geemap
# Create a map centered at (lat, lon).
Map = geemap.Map(center=[40, -100], zoom=4)
image = ee.Image('LANDSAT/LC8_L1T/LC80440342014077LGN00')
bandNames = image.bandNames()
print('Band names: ', bandNames.getInfo()) # ee.List
b1proj = image.select('B1').projection()
print('Band 1 projection: ', b1proj.getInfo()) # ee.Projection
b1scale = image.select('B1').projection().nominalScale()
print('Band 1 scale: ', b1scale.getInfo()) # ee.Number
b8scale = image.select('B8').projection().nominalScale()
print('Band 8 scale: ', b8scale.getInfo()) # ee.Number
properties = image.propertyNames()
print('Metadata properties: ', properties.getInfo()) # ee.List
cloudiness = image.get('CLOUD_COVER')
print('CLOUD_COVER: ', cloudiness.getInfo()) # ee.Number
date = ee.Date(image.get('system:time_start'))
print('Timestamp: ', date.getInfo()) # ee.Date
# Display the map.
Map