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

本文介绍了如何使用Google Earth Engine(GEE)将影像或表格数据导出到EarthEngine资产。重点讲解了Export.image.toAsset函数的使用,包括参数详细解释,并展示了如何解决在导出过程中遇到的错误。同时提到了导出矢量和视频数据的可能性。
摘要由CSDN通过智能技术生成

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

Google Earth Engine(GEE)——导出数据到Google硬盘和云端存储!和最大像素限制导出_此星光明的博客-CSDN博客导出数据您可以从 Earth Engine 导出图像、地图图块、表格和视频。导出可以发送到您的 Google Drive 帐户,到Google Cloud Storage或新的 Earth Engine 资产。要使用 Google Cloud Storage(一种收费服务),您需要设置一个项目、为该项目启用结算功能并创建一个存储桶。有关说明,请参阅Cloud Storage 快速入门页面。有关存储桶命名的信息,请参阅本指南。导出到 Cloud Storage 存储分区的数据将具有存储分区的..https://blog.csdn.net/qq_31988139/article/details/119846353

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

Export.image.toAsset(image, descriptionassetIdpyramidingPolicydimensionsregionscalecrscrsTransformmaxPixelsshardSize)

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, descriptionassetIdpyramidingPolicydimensionsregionscalecrscrsTransformmaxPixelsshardSize)

还是:

Export.image.toDrive(image, descriptionfolderfileNamePrefixdimensionsregionscalecrscrsTransformmaxPixelsshardSizefileDimensionsskipEmptyTilesfileFormatformatOptions)

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

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

此星光明

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值