GEE开发之Modis_NDWI数据分析和获取
- 0 数据介绍
- NDWI介绍
- MOD09GA介绍
- 1 NDWI天数据下载
- 2 NDWI月数据下载
- 3 NDWI年数据下载
前言:本文主要介绍Modis下的NDWI数据集的获取。归一化差异水指数 (NDWI) 对植被冠层液态水含量的变化很敏感。它来自近红外波段和第二个红外波段,可用时约为 1.24μm,否则为最接近的可用红外波段。
0 数据介绍
NDWI介绍
归一化差异水指数 (NDWI) 对植被冠层液态水含量的变化很敏感。它来自近红外波段和第二个红外波段,可用时约为 1.24μm,否则为最接近的可用红外波段。其值范围为 -1.0 到 1.0。有关详细信息,请参阅 Gao (1996) 。该产品由 MODIS/006/MOD09GA 表面反射率合成图生成。
链接:https://developers.google.com/earth-engine/datasets/catalog/MODIS_MOD09GA_006_NDWI#description
数据集引用
ee.ImageCollection(“MODIS/MOD09GA_006_NDWI”)
MOD09GA介绍
MODIS 表面反射率产品提供了表面光谱反射率的估计值,因为它是在没有大气散射或吸收的情况下在地面测量的。低水平数据针对大气气体和气溶胶进行了校正。MOD09GA 版本 6.1 在正弦投影的每日网格 L2G 产品中提供了 1-7 波段,包括 500m 反射率值和 1km 观测和地理位置统计数据。
数据集引用
ee.ImageCollection(“MODIS/061/MOD09GA”)
1 NDWI天数据下载
var geometry = ee.FeatureCollection('users/www1573979951/luyixian');
Map.centerObject(geometry,6);
var dataset = ee.ImageCollection("MODIS/MOD09GA_006_NDWI")
.filter(ee.Filter.date('2020-01-01', '2020-01-03'))
.filterBounds(geometry)
.select('NDWI');
var colorizedVis = {
min: 0.0,
max: 1.0,
palette: ['0000ff', '00ffff', 'ffff00', 'ff0000', 'ffffff'],
};
function exportImageCollection(imgCol) {
var indexList = imgCol.reduceColumns(ee.Reducer.toList(), ["system:index"]).get("list");
indexList.evaluate(function(indexs) {
for (var i=0; i<indexs.length; i++) {
var image = imgCol.filter(ee.Filter.eq("system:index", indexs[i])).first();
image = image.clip(geometry);
Map.addLayer(image, colorizedVis, indexs[i]);//查看具体的遥感影像
//tif数据下载
Export.image.toDrive({
image: image,
description: 'modis_ndwi_'+indexs[i],
fileNamePrefix: 'modis_ndwi_'+indexs[i],
folder: 'Modis',
region: geometry,
scale: 500,
crs: "EPSG:4326",
maxPixels: 1e13
});
}
});
}
exportImageCollection(dataset);
2 NDWI月数据下载
var geometry = ee.FeatureCollection('users/www1573979951/luyixian');
var dataset = ee.ImageCollection("MODIS/MOD09GA_006_NDWI");
for(var i=2018;i<=2020;i++){
for(var j=1;j<=12;j++){
var data_collection = null;
switch(j){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
data_collection = dataset.filterDate(i+'-'+j+'-01',i+'-'+j+'-31').select('NDWI');
break;
case 4:
case 6:
case 9:
case 11:
data_collection = dataset.filterDate(i+'-'+j+'-01',i+'-'+j+'-30').select('NDWI');
break;
case 2:
data_collection = dataset.filterDate(i+'-'+j+'-01',i+'-'+j+'-28').select('NDWI');
break;
}
var YR_collection = data_collection.mean().clip(geometry);
Export.image.toDrive({
image: YR_collection,
description: i+'-'+j,
fileNamePrefix: i+'-'+j,
scale: 500,
region: geometry,
crs: "EPSG:4326",//地理投影WGS1984
maxPixels: 1e13,
folder: 'Modis'
})
}
}
3 NDWI年数据下载
var geometry = ee.FeatureCollection('users/www1573979951/HN_full');
var dataset = ee.ImageCollection("MODIS/MOD09GA_006_NDWI");
for(var i=2000;i<=2000;i++){
var data_collection = dataset.filterDate(i+'-01-01',i+'-12-31').select('NDWI');
print(data_collection)
var YR_collection = data_collection.mean().clip(geometry);
Export.image.toDrive({
image: YR_collection,
description: "HN_NDWI-"+i,
fileNamePrefix: "HN_NDWI-"+i,
scale: 500,
region: geometry,
maxPixels: 1e13,
crs: "EPSG:4326",//投影方式
folder: 'Modis'
});
}