AI Earth —— 影像加载Landsat 7 影像以2012年山西省和2018年浙江省为例

本次我们分别采用Landsat7 和8加载全年影像以2012年山西省和2018年浙江省为例

这里值得注意的是:

两种模式下项目数据互通

切换开发者模式后,工具箱模式下的项目数据将同步代入,两种模式下的栅格、矢量遥感数据互通互联。

代码:

#初始化程序
import aie
aie.Authenticate()
aie.Initialize()


# 指定需要检索的区域
feature_collection = aie.FeatureCollection('China_Province') \
                        .filter(aie.Filter.eq('province', '山西省'))
geometry = feature_collection.geometry()
# 指定检索数据集,可设置检索的空间和时间范围,以及属性过滤条件(如云量过滤等)
dataset = aie.ImageCollection('LANDSAT_LE07_E02_T1_L2') \
             .filterBounds(geometry) \
             .filterDate('2012-01-01', '2012-12-31') \
             .filter(aie.Filter.lte('eo:cloud_cover', 10.0)) \
             .limit(10)

#设定中心点
map = aie.Map(
    center=feature_collection.getCenter(),
    height=800,
    zoom=7
)
vis_params = {
    'bands': ['SR_B3', 'SR_B2', 'SR_B1'],
    'min': 8000,
    'max': 13000,
}

#加载图层
map.addLayer(
    dataset,
    vis_params,
    'True Color (321)',
    bounds=dataset.getBounds()
)
map

总体上来说这里的机载速度还是相对较慢,也有可能是影像缺失,总之2012年Landsat 7 影像效果非常差。

 

 同样我们看一下Landsat 8 C2数据:

import aie
aie.Authenticate()
aie.Initialize()
# 指定需要检索的区域
feature_collection = aie.FeatureCollection('China_Province') \
                        .filter(aie.Filter.eq('province', '浙江省'))
geometry = feature_collection.geometry()
# 指定检索数据集,可设置检索的空间和时间范围,以及属性过滤条件(如云量过滤等)
dataset = aie.ImageCollection('LANDSAT_LC08_C02_T1_L2') \
             .filterBounds(geometry) \
             .filterDate('2018-01-01', '2018-12-31') \
             .filter(aie.Filter.lte('eo:cloud_cover', 10.0)) \
             .limit(10)
map = aie.Map(
    center=feature_collection.getCenter(),
    height=800,
    zoom=7
)
vis_params = {
    'bands': ['SR_B4', 'SR_B3', 'SR_B2'],
    'min': 8000,
    'max': 13000,
}
map.addLayer(
    dataset,
    vis_params,
    'True Color (432)',
    bounds=dataset.getBounds()
)
map

这里是浙江省的地图,感觉即使加载全年的影像依旧很少 ,因为我们这里使用了limit(10)

 当我们将其云量筛选和影像10去掉之后的结果:

             #.filter(aie.Filter.lte('eo:cloud_cover', 10.0)) \
             #.limit(10)

大家注意,这里的地图是固定的,也就是说每当你运行一个代码块,地图就会发生变化,除非你把所有的代码块放在一起进行加载。

猜你喜欢

转载自blog.csdn.net/qq_31988139/article/details/127253972