植被覆盖度提取,长时间序列1984-2025年,任意时间,任意区域均可!!!! 下载 Landsat 系列影像,NDVI图像,NDWI图像,NDSI图像,FVC植被覆盖度图像套Google Earth

📅 2026/7/16 1:27:22
植被覆盖度提取,长时间序列1984-2025年,任意时间,任意区域均可!!!! 下载 Landsat 系列影像,NDVI图像,NDWI图像,NDSI图像,FVC植被覆盖度图像套Google Earth
植被覆盖度提取长时间序列1984-2025年任意时间任意区域均可下载 Landsat 系列影像NDVI图像NDWI图像NDSI图像FVC植被覆盖度图像111下面给你一套Google Earth EngineGEE完整代码直接复制就能运行支持1984–2025 年任意时间、任意区域下载 Landsat 系列影像自动计算 NDVI、NDWI、NDSI、FVC植被覆盖度一键生成结果并导出到 Google Drive一、核心代码GEE 脚本// // 1. 基础配置研究区、时间范围、参数// // 【修改1】你的研究区上传 shapefile 后在 Assets 中引用或用点/面绘制vartableee.FeatureCollection(projects/ee-你的GEE账号/assets/你的研究区文件);// 【修改2】时间范围示例1984-2025 年可按需修改varstartYear1984;varendYear2025;varstartDateee.Date.fromYMD(startYear,1,1);varendDateee.Date.fromYMD(endYear,12,31);// 研究区可视化Map.centerObject(table,6);Map.addLayer(table,{color:grey},Study Area);// // 2. Landsat 影像预处理Landsat 5/7/8/9 合并// // 缩放因子函数functionapplyScaleFactors(image){varopticalBandsimage.select(SR_B.).multiply(0.0000275).add(-0.2);varthermalBandsimage.select(ST_B.*).multiply(0.00341802).add(149.0);returnimage.addBands(opticalBands,null,true).addBands(thermalBands,null,true);}// 云掩膜函数QA 波段去云functionmaskLandsat(image){varqaimage.select(QA_PIXEL);varcloudShadowBitMask(13);varcloudsBitMask(15);varmaskqa.bitwiseAnd(cloudShadowBitMask).eq(0).and(qa.bitwiseAnd(cloudsBitMask).eq(0));returnimage.updateMask(mask);}// 统一波段名称方便后续计算varbandNames[SR_B1,SR_B2,SR_B3,SR_B4,SR_B5,SR_B7,ST_B6];varnewNames[blue,green,red,NIR,SWIR1,SWIR2,thermal];// 加载 Landsat 系列影像并合并varL5ee.ImageCollection(LANDSAT/LT05/C02/T1_L2).filterDate(startDate,endDate).filterBounds(table).map(applyScaleFactors).map(maskLandsat).select([SR_B1,SR_B2,SR_B3,SR_B4,SR_B5,SR_B7,ST_B6],newNames);varL7ee.ImageCollection(LANDSAT/LE07/C02/T1_L2).filterDate(startDate,endDate).filterBounds(table).map(applyScaleFactors).map(maskLandsat).select([SR_B1,SR_B2,SR_B3,SR_B4,SR_B5,SR_B7,ST_B6],newNames);varL8ee.ImageCollection(LANDSAT/LC08/C02/T1_L2).filterDate(startDate,endDate).filterBounds(table).map(applyScaleFactors).map(maskLandsat).select([SR_B2,SR_B3,SR_B4,SR_B5,SR_B6,SR_B7,ST_B10],newNames);varL9ee.ImageCollection(LANDSAT/LC09/C02/T1_L2).filterDate(startDate,endDate).filterBounds(table).map(applyScaleFactors).map(maskLandsat).select([SR_B2,SR_B3,SR_B4,SR_B5,SR_B6,SR_B7,ST_B10],newNames);// 合并所有影像varlandsatee.ImageCollection(L5.merge(L7).merge(L8).merge(L9));print(Landsat 影像数量:,landsat.size());// // 3. 指数计算函数NDVI / NDWI / NDSI / FVC// // NDVI归一化植被指数functionaddNDVI(image){varndviimage.normalizedDifference([NIR,red]).rename(NDVI);returnimage.addBands(ndvi);}// NDWI归一化水体指数functionaddNDWI(image){varndwiimage.normalizedDifference([green,NIR]).rename(NDWI);returnimage.addBands(ndwi);}// NDSI归一化雪指数functionaddNDSI(image){varndsiimage.normalizedDifference([green,SWIR1]).rename(NDSI);returnimage.addBands(ndsi);}// FVC植被覆盖度像元二分模型functionaddFVC(image){varndviimage.select(NDVI);// 用研究区 NDVI 的 5% 和 95% 分位数作为裸土和完全植被端元可按需修改varndviStatsndvi.reduceRegion({reducer:ee.Reducer.percentile([5,95]),geometry:table,scale:30,maxPixels:1e13});varndviSoilee.Number(ndviStats.get(NDVI_p5));varndviVegee.Number(ndviStats.get(NDVI_p95));varfvcndvi.subtract(ndviSoil).divide(ndviVeg.subtract(ndviSoil)).clamp(0,1).rename(FVC);returnimage.addBands(fvc);}// 对所有影像添加指数varlandsatWithIndexlandsat.map(addNDVI).map(addNDWI).map(addNDSI).map(addFVC);// // 4. 按年合成示例每年 NDVI 最大值合成可按需修改// varyearsee.List.sequence(startYear,endYear);varyearListyears.map(function(year){varstartee.Date.fromYMD(year,1,1);varendee.Date.fromYMD(year,12,31);varannualMaxlandsatWithIndex.filterDate(start,end).select([NDVI,NDWI,NDSI,FVC]).max().set(year,year);returnannualMax;});varannualCompositeee.ImageCollection(yearList);// 示例显示 2020 年 NDVI 合成结果varndvi2020annualComposite.filter(ee.Filter.eq(year,2020)).first().clip(table);Map.addLayer(ndvi2020.select(NDVI),{min:-0.2,max:0.8,palette:[blue,white,green]},2020 NDVI);// // 5. 导出结果到 Google Drive// // 导出单一年份影像示例2020 年Export.image.toDrive({image:ndvi2020,description:Landsat_Indices_2020,folder:GEE_Output,scale:30,region:table,fileFormat:GeoTIFF,maxPixels:1e13});// 【可选】批量导出所有年份 NDVI循环导出years.getInfo().forEach(function(year){varimgannualComposite.filter(ee.Filter.eq(year,year)).first().clip(table);Export.image.toDrive({image:img.select(NDVI),description:NDVI_year,folder:GEE_Output_NDVI,scale:30,region:table,fileFormat:GeoTIFF,maxPixels:1e13});});二、使用步骤照着做就能跑通上传研究区把你的研究区 Shapefile 上传到 GEE Assets复制路径替换代码中第3行的projects/ee-你的GEE账号/assets/你的研究区文件。修改时间范围按需修改startYear和endYear比如只做 2000-2020 年就改成startYear2000, endYear2020。运行代码点击 Run先看控制台输出的影像数量是否正常地图上会显示研究区和示例 NDVI 图层。导出结果运行后在右侧 Tasks 面板点击 Run影像会自动导出到你的 Google Drive。三、指数说明方便你写论文指数公式含义NDVI(NIR - Red) / (NIR Red)归一化植被指数反映植被覆盖与生长状况NDWI(Green - NIR) / (Green NIR)归一化水体指数提取水体范围NDSI(Green - SWIR1) / (Green SWIR1)归一化雪指数区分积雪与其他地物FVC(NDVI - NDVIsoil) / (NDVIveg - NDVIsoil)植被覆盖度基于像元二分模型取值0-1