Google Earth Engine(GEE)——Export.image.toAsset/toDrive两者的区别和混用,正确导出分类样本数据到资产assets和引用

简介: Google Earth Engine(GEE)——Export.image.toAsset/toDrive两者的区别和混用,正确导出分类样本数据到资产assets和引用

之前我们介绍过如何将影像或者表格导出到硬盘中,但是如何直接导出到assets中,然后再次调用呢?如果不知道如何导出Google drive


其实,有一个很好的函数就是直接和导出到硬盘当中一样,用的都是export中的函数:

Export.image.toAsset(image, description, assetId, pyramidingPolicy, dimensions, region, scale, crs, crsTransform, maxPixels, shardSize)

Creates a batch task to export an Image as a raster to an Earth Engine asset. Tasks can be started from the Tasks tab.

Arguments:

image (Image):

The image to export.

description (String, optional):

A human-readable name of the task. Defaults to "myExportImageTask".

assetId (String, optional):

The destination asset ID.

pyramidingPolicy (Object, optional):

The pyramiding policy to apply to each band in the image, keyed by band name. Values must be one of: mean, sample, min, max, or mode. Defaults to "mean". A special key,

".default" may be used to change the default for all bands.

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.

shardSize (Number, optional):

Size in pixels of the tiles in which this image will be computed. Defaults to 256.

无论你是什么数据直接将数据利用此函数导出即可,即使你不用这个函数,用Export.image.toDrive也可以,然后在这个界面弹出后直接选择EE ASSET就可以了,但是这里有一个问题(请看第三步:A different Operation was already started with the given request_id.)

第二部就是输入asset的ID地址:

第三步:如果你要导出的内容是样本,在这里选择样本,而不是统计的平均值最大值等

但是这么做的后果就是:

A different Operation was already started with the given request_id. 一个不同的操作已经以给定的request_id开始。

代码:

//folder参数没有再asset中
Export.image.toAsset({
    image: ndvi_before.select("SO3_column_number_density"),
    assetId:r.toString(),
    region:hh,
    scale:1000,
    description: "china_SO2_column_number_density_1000m_8day",
    //folder: 'china_SO2_column_number_density',
  })

问题出在哪里呢?因为函数asset中没有folder这个参数,因为asset中是默认在GEE中的ASSETS中,我降这个东西删掉后再看看。然后就没有出现刚才的错误。

所以你无论用:

Export.image.toAsset(image, description, assetId, pyramidingPolicy, dimensions, region, scale, crs, crsTransform, maxPixels, shardSize)

还是:

Export.image.toDrive(image, description, folder, fileNamePrefix, dimensions, region, scale, crs, crsTransform, maxPixels, shardSize, fileDimensions, skipEmptyTiles, fileFormat, formatOptions)

函数中的参数看清楚就好了!!!

然后,直接在ASSET中调用或者倒入就行了,非常简单:

当然你也可以导出矢量和视频数据:


相关文章
|
数据可视化 定位技术 Sentinel
如何用Google Earth Engine快速、大量下载遥感影像数据?
【2月更文挑战第9天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,批量下载指定时间范围、空间范围的遥感影像数据(包括Landsat、Sentinel等)的方法~
5542 1
如何用Google Earth Engine快速、大量下载遥感影像数据?
|
机器学习/深度学习 算法 数据可视化
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
805 0
|
8月前
|
数据采集 XML 监控
Google Search Console 做SEO分析之“已发现未编入” 与 “已抓取未编入” 有什么区别?
在 Google Search Console (GSC) 中,“已发现 - 尚未编入索引”(Discovered - currently not indexed) 和 “已抓取 - 尚未编入索引”(Crawled - currently not indexed) 是两种不同的状态,如果你的站点也有这两种状态就需要注意优化了。
410 0
|
存储 编解码 数据可视化
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
【2月更文挑战第14天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,按照给定的地表分类数据,对每一种不同的地物类型,分别加以全球范围内随机抽样点自动批量选取的方法~
1332 1
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
|
数据可视化 数据挖掘 数据建模
R语言指数平滑法holt-winters分析谷歌Google Analytics博客用户访问时间序列数据
R语言指数平滑法holt-winters分析谷歌Google Analytics博客用户访问时间序列数据
|
编解码 人工智能 算法
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
342 0
|
编解码 人工智能 数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
438 0
|
编解码
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
286 0
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
946 0
|
传感器 编解码 数据处理
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
538 0

热门文章

最新文章

推荐镜像

更多