AI Earth - Image Loading Landsat 7 images take Shanxi Province in 2012 and Zhejiang Province in 2018 as examples

This time, we use Landsat7 and 8 to load images of the whole year, taking Shanxi Province in 2012 and Zhejiang Province in 2018 as examples

It's worth noting here:

Project data exchange in two modes

After switching the developer mode, the project data in the toolbox mode will be substituted synchronously, and the raster and vector remote sensing data in the two modes will be interconnected.

Code:

#初始化程序
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

Generally speaking, the airborne speed here is relatively slow, and there may be missing images. In short, the 2012 Landsat 7 image quality is very poor.

 

 Also let's take a look at the Landsat 8 C2 data:

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

Here is the map of Zhejiang Province. It feels that even if the images are loaded throughout the year, there are still very few images, because we use the limit (10) here.

 The result when we filter its cloud cover and remove image 10:

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

Note that the map here is fixed, which means that every time you run a code block, the map changes unless you load all the code blocks together.

 

 

Guess you like

Origin blog.csdn.net/qq_31988139/article/details/127253972