首先,GEE为用户提供了三个存储空间,google drive、google assets、以及google cloud storage。
1.数据的上传
关于GEE的介绍有很多,主要使用的是Code Editor界面。进入之后数据的上传是在GEE界面左侧窗口的assets中,一共提供250G的存储,数量不超过10000个文件。
从类型中可以看出,可以上传tif文件和shp文件和表格文件,注意在上传shp文件的时候按照要求,需要四个文件(.shp \ .shx \ .dbf \ .prj)或者将四个文件打包为zip上传。
但无论是哪种文件格式,需要遵循的规则是:
- 文件的名称和本地的存放不要有中文;
- 文件格式最好是utf-8格式;
- 单个文件不超过10G;
- 上传过程不能关闭浏览器;
- 最好的WGS84投影,EPSG:4326
2. 数据的下载
数据下载命令运行完成之后在右侧界面点击Run即可。
- 在GEE运行的程序将被保存到google drive中,导出数据后下载即可。但是免费内存只有15G。
Google Drive: https://drive.google.com/drive/my-drive
example:
// Load a landsatimage and select three bands.
var landsat= ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_123032_20140515')
.select(['B4', 'B3', 'B2']);
// Create a geometry representing an export region.
var geometry = ee.Geometry.Rectangle([116.2621, 39.8412, 116.4849, 40.01236]);
// Export the image, specifying scale and region.
Export.image.toDrive({
image: landsat,
description: 'image To Drive Example',
scale: 30,
region: geometry
});
关于参数的具体解释,可以在左侧窗口的Docs中输入Export.image.toDrive查看。其它命令也是如此。
2. Assets一般是上传数据,需要处理大量数据的时候也可以将数据下载到assets中暂存之后进行分析,建议自己的高精度产品数据尽量不要上传。下载数据到Assets:
example:
// Load a landsatimage and select three bands.
var landsat= ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_123032_20140515')
.select(['B4', 'B3', 'B2']);
// Create a geometry representing an export region.
var geometry = ee.Geometry.Rectangle([116.2621, 39.8412, 116.4849, 40.01236]);
// Get band 4 from the Landsat image, copy it.
var band4 = landsat.select('B4').rename('b4_mean')
.addBands(landsat.select('B4').rename('b4_sample'))
.addBands(landsat.select('B4').rename('b4_max'));
// Export the image to an Earth Engine asset.
Export.image.toAsset({
image: band4,
description: 'image To Asset Example',
assetId: 'exampleExport',
scale: 30,
region: geometry,
pyramidingPolicy: {
'b4_mean': 'mean',
'b4_sample': 'sample',
'b4_max': 'max'
}
});
- Google Cloud Storage应用较少,不做介绍
案例引用:
1.《遥感云计算与科学分析——应用与实践》——董金玮等