当前位置:网站首页>GEE|求NDVI改进版
GEE|求NDVI改进版
2022-06-09 18:28:00 【difizuhvovs】
上午为了能只筛选出TPP列的影像,费了好大劲看json转string和object的equal,其实只需要.filter(ee.Filter.eq('MGRS_TILE', "44TPP"));就够了。
把TPP的影像导出又发现实在太大了,每个影像100多M,于是决定导出NDVI,因为是单波段的。
于是重新修改了下求NDVI并导出的代码,更加简洁而且不会被月份限制住了,只要有好的影像都可以求NDVI并下载。
var batch = require('users/fitoprincipe/geetools:batch');
var imageCollection = s2_col.filterDate('2021-05-01', '2021-10-01')
.filterBounds(roi)
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 10))
.filter(ee.Filter.eq('MGRS_TILE', "44TPP"));
var s2_ndvi = function(image) {
return image.addBands(image.normalizedDifference(["B8", "B4"]).rename("NDVI"));
};
var ndvi = imageCollection.map(s2_ndvi).select("NDVI");
var imageList = ndvi.toList(imageCollection.size());
var imageListSize = imageList.size().getInfo();
print(imageList);
print(imageListSize);
// var visParams = {bands: ['B4', 'B3', 'B2'],min: 0,max: 3000,gamma: 1.4,};
var visParam = {
min: 0, max: 1, palette: ['2892c7', 'a0c29b', 'fafa64', 'fa8d34', 'e81014']};
for(var i=0;i<imageListSize;i++){
var image = ee.Image(imageList.get(i));
var ndvi_clip = image.clip(roi);
Map.addLayer(ndvi_clip, visParam, image.get("system:index").getInfo());
}
Map.centerObject(roi,9);
Map.addLayer(roi,{
color:'FFFF00'});
batch.Download.ImageCollection.toDrive(ndvi,"agesx_ndvi", {
scale: 10,
crs: "EPSG:4536",
region: roi,
maxPixels:1e13
})
边栏推荐
猜你喜欢
随机推荐
如何搭建组态王与欧姆龙PLC之间无线Host-Link通信?
Using go to crack rar compressed file with password
JsonPath-教程
Golang Foundation (5)
Vulkan specification notes (I) Chapter 1 to Chapter 6
What should I do if the RTMP stream address returned by easynvr non demand streaming cannot be played?
[work with notes] multiple coexistence of ADB, sound card, network card and serial port of Tina system
如何让我们的自建站点拥有自定义域名(1)
MySQL启动失败的原因是什么及如何解决
Redis source code learning-05_ Dictionary, hash table
Pytorch set random seed
Golang Foundation (1)
陈某的技术交流群招人~
详解MySQL索引
3 个注解,优雅的实现微服务鉴权
基于FPGA的SD卡读写设计及仿真verilog
WSL 挂载U盘
mysql数据库角色如何创建
直播预告 | 在阿里云 ESSD 云盘上部署 PolarDB for PostgreSQL 集群
Deep understanding of JVM and GC


![[work with notes] multiple coexistence of ADB, sound card, network card and serial port of Tina system](/img/c9/e57db5cbcd0599717f551c591a86a5.png)






