2.1 文件I/O
2.1.1 上传文件
Step1: 从ArcGIS中export data
到合适位置,压缩为zip格式压缩包
Step2: 在Assets中点击new,image upload
用于上传栅格文件(tif),table upload
用于上传矢量文件
2.1.2 输出表格/矢量
会输出collection的基本信息,因此可以把想输出的东西保存在image/feature的properties中
Export.table.toDrive({
collection: PML_YHS,
description: 'PML in Yeheshan',
fileFormat: 'CSV'
});
2.1.3 输出影像
Export.image.toDrive(image, description, folder, fileNamePrefix,dimensions, region, scale, crs, crsTransform, maxPixels,shardSize, fileDimensions, skipEmptyTiles, fileFormat,formatOptions)
Export.image.toDrive({
image: ndvi,
description: 'ndvi',
scale: 300,
region: Geomtry,
maxPixels: 1e13,
crs: 'EPSG:4326', // 输出数据的投影参考系
fileFormat: 'GeoTIFF' // 输出文件的格式
});
注意:GEE目前不支持直接导出影像集合(imageCollection),如果我们想要导出一个影像集合,那么具体的思路路可以是
- 将所有的影像波段合并到一个影像中,然后导出这张影像
- 循环导出集合中的每一张影像
举例:
//方案一 //ImageCollection中包含5个image,每个image中有13个band:B1-B11、BQA、NDVI var selectCol = l8.filterBounds(roi) .filterDate("2017-8-1", "2017-12-1") .map(function(image) { return image.addBands(image.normalizedDifference(["B5", "B4"]).rename("NDVI")); }) .sort("system:time_start"); //选择一个band,将ImageCollection(5个image)合成一张image,包含5个band //若不选择一个band,那么也会合成一张image,包含5*13=65个band var exportImage = selectCol.select("NDVI").toBands();