0
点赞
收藏
分享

微信扫一扫

在Google Earth Engine(GEE)中利用人口数据进行分析


今天来分享下如何在GEE中利用人口数据进行分析,在GEE调用的数据为"WorldPop/GP/100m/pop"
分析山西省2001年到2020年人口的增长变化情况
GEE调用代码如下:

var roi = ee.FeatureCollection('users/lilei655123/shanxi')
Map.centerObject(roi,6)
var clipToCol = function(image){
return image.clip(roi);
};
// import worldpop data
var worldpop = ee.ImageCollection("WorldPop/GP/100m/pop").filterBounds(roi).map(clipToCol)
.filter(ee.Filter.eq('country', 'CHN')).select('population')
print(worldpop)
var start = ee.Date.fromYMD(2020,1,1);
var end = ee.Date.fromYMD(2020,12,31);
var worldpop2020 = ee.Image(worldpop.filterDate(start,end).mean());
worldpop2020 = worldpop2020.clip(roi);
Map.addLayer(worldpop2020,{min:0,max:100,palette: ['24126c', '1fff4f', 'd4ff50']},"population 2020");
var chart =
ui.Chart.image.seriesByRegion
({
imageCollection:worldpop,
regions: roi,
reducer: ee.Reducer.sum(),
scale: 100,
xProperty: 'system:time_start'
})
.setSeriesNames(['population'])
.setOptions({
title: 'population dynamics',
hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
vAxis: {
title: 'total population',
titleTextStyle: {italic: false, bold: true}
},
lineWidth: 5,
colors: ['e37d05'],
curveType: 'function'
});
print(chart);
//导出影像数据函数
function exportImage(image, region, fileName) {
Export.image.toDrive({
image: image,
description: fileName,
fileNamePrefix: fileName,
folder: "population",
scale: 100,
region: roi,
maxPixels: 1e13,
fileFormat:"GeoTIFF",
crs: "EPSG:4326"
});
}
//获取每幅影像对应的时间
var indexList = worldpop.reduceColumns(ee.Reducer.toList(), ["system:index"]).get("list");
print("indexList", indexList);

//循环导出影像,用影像时间对其命名
indexList.evaluate(function(indexs) {
for (var i=0; i<indexs.length; i++) {
var image = worldpop.filter(ee.Filter.eq("system:index", indexs[i]))
.first()
.int16()
exportImage(image, roi, "Worldpop-"+indexs[i]);
}
});

可视化结果:

在Google Earth Engine(GEE)中利用人口数据进行分析_数据


图中颜色为绿色的区域,表示人口密度越大

统计结果

在Google Earth Engine(GEE)中利用人口数据进行分析_数据_02


点击“run”,即可批量下载

在Google Earth Engine(GEE)中利用人口数据进行分析_大数据_03


声明:仅供学习使用!如果对你有帮助的话记得给小编点个赞

**更多内容请关注微信公众号“生态遥感监测笔记”


举报

相关推荐

0 条评论