AI Earth 设置了研究区域,这里也筛选了.filterBounds(feature_collection) \,为什么显示全球的图像啊?
aie.Authenticate()
aie.Initialize()
feature_collection = aie.FeatureCollection('China_Province') \
.filter(aie.Filter.eq('province', '四川省'))
image_collection = aie.ImageCollection('MODIS_MOD17A2H_006') \
.filterBounds(feature_collection) \
.filterDate('2018-10-01', '2018-10-31') \
reduce_image = image_collection.reduce(aie.Reducer.mean())
print(reduce_image.getInfo())
map = aie.Map(
center=reduce_image.getCenter(),
height=800,
zoom=7
)
vis_params = {
'bands': ['Gpp', 'PsnNet', 'Psn_QC'],
'min': 8000,
'max': 13000,
}
map.addLayer(
reduce_image,
vis_params,
'reduce image',
bounds=reduce_image.getBounds()
)
map
这个问题可能是由于在设置研究区域后,没有正确地将筛选条件应用到图像图层上。请确保在创建图像图层时使用了filterBounds(feature_collection)
函数,并在后续操作中保持这个筛选条件。
以下是一个简化的示例,展示了如何在AI Earth中设置研究区域并筛选图像:
var feature_collection = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
// 这里填写研究区域的坐标
]
}
}
]
};
filterBounds
函数筛选图像:var image_layer = new aiearth.layers.ImageryLayer({
source: new aiearth.sources.EsriImagery()
});
image_layer.filterBounds(feature_collection);
map.addLayer(image_layer);
请确保在实际操作中替换feature_collection
中的坐标为您的研究区域坐标。如果问题仍然存在,请检查其他图层或操作是否影响了图像图层的显示范围。
我们提供的MODIS是“全球一张图”,你按任何一个region区域检索(filterBounds),搜到的都是全球影像。你的代码里,需要对搜出来的image_collection进行镶嵌和按区域裁剪,才能得到研究区
具体可以参考:https://engine-aiearth.aliyun.com/#/portal/case/10302 此回答整理自钉群“AI Earth地球科学云平台交流群”
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。