初始化环境
import aie
aie.Authenticate()
aie.Initialize()
Landsat-8
数据检索
指定区域、时间、云量检索
Landsat-8
,并对数据进行去云处理。
region = aie.FeatureCollection('China_Province') \
.filter(aie.Filter.eq('province', '上海市'))
dataset = aie.ImageCollection('LANDSAT_LC08_C02_T1_L2') \
.filterBounds(region) \
.filterDate('2019-06-01', '2019-08-31') \
.filter(aie.Filter.lte('eo:cloud_cover', 10.0))
print(dataset.size().getInfo())
image = dataset.median()
map = aie.Map(
center=image.getCenter(),
height=800,
zoom=7
)
rgb_params = {
'bands': ['SR_B4', 'SR_B3', 'SR_B2'],
'min': 8000,
'max': 13000
}
map.addLayer(
image,
rgb_params,
'raw_img',
bounds = image.getBounds()
)
map
计算
NDVI
ndvi = image.normalizedDifference(['SR_B5', 'SR_B4']).rename(['NDVI'])
ndvi_params = {
'min': -1.0,
'max': 1.0,
'palette': [
'#FFFFFF', '#CE7E45', '#DF923D', '#F1B555', '#FCD163', '#99B718', '#74A901',
'#66A000', '#529400', '#3E8601', '#207401', '#056201', '#004C00', '#023B01',
'#012E01', '#011D01', '#011301'
]
}
map.addLayer(
ndvi,
ndvi_params,
'NDVI',
bounds = image.getBounds()
)
map
计算
Fractional Vegetation
min = aie.Image(-0.38)
max