使用Google Earth Engine GEE实现MODIS数据批量下载

  • 前言
  • 下载数据代码
  • 批量执行run任务

关注公众号,分享GIS知识、ArcGIS教程、SCI论文与科研日常等

前言

上图是GEE代码编辑器界面,使用JavaScript脚本代码可以编程获取数据进行数据处理等一系列操作。使用GEE:网址链接

使用GEE之前需要对 JavaScript语法 有一定了解,同时,GEE对JavaScript进行了二次封装,包含了自己的各种方法,具体使用是有些差别,其中,GEE在Docs一栏也提供了API文档,可以在编程时方便查看相关函数及参数。如果只是想利用GEE下载个数据啥的,直接网上copy代码就行了。

另外,Asset栏是自己的资产,可以将自己的矢量文件、栅格文件等数据上传到此处。之后就可以使用上传的数据进行后续操作了,比如想获得China范围的MODIS数据。


或者通过界面下方的地图绘制自己需要的区域(geometry变量)导入到工程。

下载数据代码

下面是下载2018-10-10至2018-12-01时间内,geometry4(我自己画的),MOD13A2.006产品的NDVI波段的代码示例。

当然,不止MODIS,GEE中提供了很多数据集的下载。下载的数据输出的是指定分辨率、格式和投影的数据,非常方便。

// get data collection you need and filtered by date and bound infomation and select the NDVI band
var mod13a2NDVI = ee.ImageCollection('MODIS/006/MOD13A2').filterBounds(geometry4).filterDate('2018-10-10', '2018-12-01').select('NDVI');print('Collection: ', mod13a2NDVI);
// num是collection 中的个数,大点没关系,不能比collection中image个数少
var num = 23;
// convert the collection to image list
var list = mod13a2NDVI.toList(num);
print(list);// get the size of image list
// 这里只用list.size()是不对的,还要通过getInfo()获取相应的属性信息,如果没有getInfo(),虽然也能输出count,但是下面的循环不执行,不知道为啥。
var count = list.size().getInfo();
print(count)
// var i = 0 // loop to output all images
for(var i=0;i<count;i++)
{// get the single image from listvar image = ee.Image(list.get(i));print(i,image);// get the id property as the part of filenamesvar id=image.id();print(id);// out namevar name2="NDVI_"+id.getInfo();print(name2)// export the image to your google drive/*各个参数及含义image (Image):The image to export.description (String, optional):A human-readable name of the task. Defaults to "myExportImageTask".folder (String, optional):The Google Drive Folder that the export will reside in.fileNamePrefix (String, optional):The Google Drive filename for the export. Defaults to the description.dimensions (Number|String, optional):The dimensions to use for the exported image. Takes either a single positive integer as the maximum dimension or"WIDTHxHEIGHT" where WIDTH and HEIGHT are each positive integers.region (Geometry.LinearRing|Geometry.Polygon|String, optional):A LinearRing, Polygon, or coordinates representing region to export. These may be specified as the Geometry objects or coordinates serialized as a string. If not specified, the region defaults to the viewport at the time of invocation.scale (Number, optional):Resolution in meters per pixel. Defaults to 1000.crs (String, optional):CRS to use for the exported image.crsTransform (List<Number>|String, optional):Affine transform to use for the exported image. Requires "crs" to be defined.maxPixels (Number, optional):Restrict the number of pixels in the export. By default, you will see an error if the export exceeds 1e8 pixels. Setting this value explicitly allows one to raise or lower this limit.fileFormat:formatOptions*/Export.image.toDrive({image: image, // description: 'imageToCOGeoTiffExample',fileNamePrefix: name2,scale: 1000,maxPixels: 999999999999,// crs:'EPSG:32649',region: geometry4,fileFormat: 'GeoTIFF',formatOptions: {cloudOptimized: true}});
}

批量执行run任务

当批量下载的图像很多时,代码运行后会生成很多run任务,需要点击后将数据保存下来,这时候一个一个点就比较麻烦。提供一个博客介绍的批量执行run任务的方法:博客地址

使用Google Earth Engine (GEE)实现MODIS数据批量下载相关推荐

  1. Google Earth Engine(GEE)批量下载代码(以 NDVI数据为例)

    下载数据先准备工作(具体细节都能查到):科学上网 谷歌邮箱,谷歌邮箱注册GEE账号. 一:导入需要下载边界shp文件. 标题 找到自己的shp文件,导入除了sbx文件的所有文件. 导入成功 命名ass ...

  2. Google Earth Engine(GEE)——可视化动态图

    代码: var geometry = /* color: #d63000 *//* shown: false *//* displayProperties: [{"type": & ...

  3. 基于google earth engine(GEE)下载研究区域影像

    基于google earth engine(GEE)下载研究区域影像 当研究需要Landsat数据时,我们可以通过USGS官网或者地理空间数据云平台下载.由于地理空间数据云目前无法下载到较新的数据,可 ...

  4. Google Earth Engine(GEE)——User memory limit exceeded(2)

    上一次我们已经知道如何去进行避免这种错误的发生,有关详细内容,如果单单只是解决这个问题我们用到的是limit 和 first,上一次的博客在这里: (207条消息) Google Earth Engi ...

  5. Google Earth Engine(GEE) 01-中输入提示快捷键Ctrl+space无法使用的问题

    Google Earth Engine(GEE) 01-中输入提示快捷键Ctrl+space无法使用的问题 GEE中 Ctrl+space组合键用于代码输入快捷提示,能够提高编码的准确度和速度,但是, ...

  6. 关于google earth engine(GEE)的一些想法与大胆预测

    我接触GEE有两年了,GEE留给我的印象是:无所不能. 不管是从庞大的数据量,还是包含遥感的各类算法:随机森林.SVM.CNN,都让人惊讶. 从GEE的云端操作来看,传统遥感需要几个月做出来的全国ND ...

  7. Google Earth Engine (GEE) ——卫星影像的监督分类(svm)

    问题 GEE 提供哪些机器学习技术? 如何对卫星图像进行监督分类? 如何评估分类器的准确性? 如何手动创建自己的几何图形? 目标 练习查找无云图像和使用手绘几何导入 学习训练和应用分类算法所需的基本功 ...

  8. google earth engine GEE批量 run下载插件

    在Google earth engine中,批量导出文件经常遇到多个文件下载的情况,只能一个个点击RUN.这里介绍一款插件,Open Earth Engine extension .该插件的作者是Ma ...

  9. Google Earth Engine (GEE) ——Earth Engine Explorer (EE Explorer)使用最全解析(8000字长文)

    Google 地球引擎简介 Earth Engine Explorer (EE Explorer) 是一个轻量级地理空间图像数据查看器,可以访问Earth Engine Data Catalog 中提 ...

最新文章

  1. JSBinding+SharpKit / 菜单介绍
  2. python 笔记:nltk (标记英文单词词性等)
  3. MatConvnet工具箱文档翻译理解(4)
  4. rac下asm管理的表空间-数据文件的重命名
  5. Nexys4DDR+OV7670实现图像灰度显示系统
  6. mock java_JAVA的mock工具mockito简介
  7. php 实现类似asp.net中的datagridview效果,asp.net中使用DatagridView的增删改方法具体实现...
  8. 用友 NC客户化开发手册
  9. java docx4j 工具和xdocreport工具创建PDF或者word报表
  10. Kevgir靶机渗透——弱口令爆破
  11. Your application has presented a UIAlertController of style UIAlertControllerStyleActionSheet.
  12. Transformer课程 业务对话机器人Rasa 3.x Reaching Out to the User
  13. java中如何添加画板背景图,在AI中怎么把已知图片在新建画板时候作为画板的背景来建立画板啊!...
  14. glDrawElements 绘制立方体共用顶点的法线和UV处理
  15. simplex法(单纯形) 并在python实现简单的应用
  16. 【云驻共创】华为云IoTDA服务下的设备管理流程实操
  17. 大事情!中国限制 AI 算法出口。网友:这是要阻止XX“下跪”
  18. 软件测试员需要学什么?
  19. 自动控制原理上课笔记(不定期更新)
  20. MS10-002补丁按时发布,建议立即安装,防范极光漏洞(KB979352)

热门文章

  1. linux下的strerror文件,linux下错误的捕获:errno和strerror的使用
  2. 4.29 css,js,mysql本周学习简单总结
  3. 目前社会对学前教育的看法
  4. 查准率、查全率与 F1 值
  5. 2020-微信小程序开发学习笔记
  6. python时间格式相互转化
  7. 智联万物,聚量增长 | 小迈科技携手云扩开创移动应用自动化新未来
  8. C语言 rand函数生成随机数
  9. Erp专业知识讲座(云中客的专栏)
  10. response.sendRedirect和setHeader()