公告 :凡是在
2025 年 4 月 15 日 前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格 ,才能繼續存取 Earth Engine。
提供意見
Export.image.toAsset
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
建立批次工作,將影像匯出為點陣圖,並匯出至 Earth Engine 資產。你可以從「工作」分頁啟動工作。
用量 傳回 Export.image.toAsset(image, description , assetId , pyramidingPolicy , dimensions , region , scale , crs , crsTransform , maxPixels , shardSize , priority )
引數 類型 詳細資料 image
圖片 要匯出的圖片。 description
字串 (選用) 使用者可解讀的任務名稱。預設值為「myExportImageTask」。 assetId
字串 (選用) 目的地資產 ID。 pyramidingPolicy
物件 (選用) 要套用至圖片中每個波段的金字塔化政策,以波段名稱做為鍵。值必須是下列其中之一:平均值、樣本、最小值、最大值或眾數。預設值為「mean」。特殊鍵「.default」可用於變更所有頻帶的預設值。 dimensions
Number|String,選填 匯出圖片時使用的尺寸。可接受單一正整數做為最大尺寸,或「WIDTHxHEIGHT」,其中 WIDTH 和 HEIGHT 皆為正整數。 region
Geometry.LinearRing|Geometry.Polygon|String,選用 代表要匯出區域的 LinearRing、Polygon 或座標。這些可以是 Geometry 物件,也可以是序列化為字串的座標。 scale
號碼 (選填) 以每像素公尺為單位的解析度。預設值為 1000。 crs
字串 (選用) 用於匯出圖片的 CRS。 crsTransform
List<Number>|String,選用 用於匯出圖片的仿射轉換。必須定義「crs」。 maxPixels
號碼 (選填) 限制匯出像素數量。根據預設,如果匯出作業超過 1 億像素,系統會顯示錯誤訊息。明確設定這個值可提高或降低這個限制。 shardSize
號碼 (選填) 圖片計算時所用圖塊的大小 (以像素為單位)。預設值為 256。 priority
號碼 (選填) 專案內工作的優先順序。系統會優先排定優先順序較高的工作。必須是介於 0 至 9999 之間的整數。預設值為 100。
範例
程式碼編輯器 (JavaScript)
// A Landsat 8 surface reflectance image.
var image = ee . Image ( 'LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508' )
. select ([ 'SR_B.' ]); // reflectance bands
// A region of interest.
var region = ee . Geometry . BBox ( - 122.24 , 37.13 , - 122.11 , 37.20 );
// Set the export "scale" and "crs" parameters.
Export . image . toAsset ({
image : image ,
description : 'image_export' ,
assetId : 'projects/<project-name>/assets/<asset-name>' , // <> modify these
region : region ,
scale : 30 ,
crs : 'EPSG:5070'
});
// Use the "crsTransform" export parameter instead of "scale" for more control
// over the output grid. Here, "crsTransform" is set to align the output grid
// with the grid of another dataset. To view an image's CRS transform:
// print(image.projection())
Export . image . toAsset ({
image : image ,
description : 'image_export_crstransform' ,
assetId : 'projects/<project-name>/assets/<asset-name>' , // <> modify these
region : region ,
crsTransform : [ 30 , 0 , - 2493045 , 0 , - 30 , 3310005 ],
crs : 'EPSG:5070'
});
// If the export has more than 1e8 pixels, set "maxPixels" higher.
Export . image . toAsset ({
image : image ,
description : 'image_export_maxpixels' ,
assetId : 'projects/<project-name>/assets/<asset-name>' , // <> modify these
region : region ,
scale : 30 ,
crs : 'EPSG:5070' ,
maxPixels : 1e13
});
// The default "pyramidingPolicy" is mean. If data are categorical,
// consider mode.
Export . image . toAsset ({
image : image . select ( 'SR_B5' ),
description : 'image_export_pyramiding' ,
assetId : 'projects/<project-name>/assets/<asset-name>' , // <> modify these
region : region ,
scale : 30 ,
crs : 'EPSG:5070' ,
pyramidingPolicy : { SR_B5 : 'mode' }
});
Python 設定
請參閱
Python 環境 頁面,瞭解 Python API 和如何使用 geemap
進行互動式開發。
import ee
import geemap.core as geemap
Colab (Python)
# A Landsat 8 surface reflectance image.
image = ee . Image (
'LANDSAT/LC08/C02/T1_L2/LC08_044034_20210508'
) . select ([ 'SR_B.' ]) # reflectance bands
# A region of interest.
region = ee . Geometry . BBox ( - 122.24 , 37.13 , - 122.11 , 37.20 )
# Set the export "scale" and "crs" parameters.
task = ee . batch . Export . image . toAsset (
image = image ,
description = 'image_export' ,
assetId = 'projects/<project-name>/assets/<asset-name>' , # <> modify these
region = region ,
scale = 30 ,
crs = 'EPSG:5070'
)
task . start ()
# Use the "crsTransform" export parameter instead of "scale" for more control
# over the output grid. Here, "crsTransform" is set to align the output grid
# with the grid of another dataset. To view an image's CRS transform:
# print(image.projection().getInfo())
task = ee . batch . Export . image . toAsset (
image = image ,
description = 'image_export_crstransform' ,
assetId = 'projects/<project-name>/assets/<asset-name>' , # <> modify these
region = region ,
crsTransform = [ 30 , 0 , - 2493045 , 0 , - 30 , 3310005 ],
crs = 'EPSG:5070'
)
task . start ()
# If the export has more than 1e8 pixels, set "maxPixels" higher.
task = ee . batch . Export . image . toAsset (
image = image ,
description = 'image_export_maxpixels' ,
assetId = 'projects/<project-name>/assets/<asset-name>' , # <> modify these
region = region ,
scale = 30 ,
crs = 'EPSG:5070' ,
maxPixels = 1e13
)
task . start ()
# The default "pyramidingPolicy" is mean. If data are categorical,
# consider mode.
task = ee . batch . Export . image . toAsset (
image = image . select ( 'SR_B5' ),
description = 'image_export_pyramiding' ,
assetId = 'projects/<project-name>/assets/<asset-name>' , # <> modify these
region = region ,
scale = 30 ,
crs = 'EPSG:5070' ,
pyramidingPolicy = { 'SR_B5' : 'mode' }
)
task . start ()
提供意見
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權 ,程式碼範例則為阿帕契 2.0 授權 。詳情請參閱《Google Developers 網站政策 》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-08 (世界標準時間)。
想進一步說明嗎?
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-08 (世界標準時間)。"],[[["Creates a batch task to export an Earth Engine image as a raster to an Earth Engine asset."],["You can specify parameters like the region, scale, CRS, and pyramiding policy for the export."],["Tasks are initiated from the Tasks tab and can be monitored for progress and completion."],["For large exports exceeding 1e8 pixels, the `maxPixels` parameter must be increased to prevent errors."],["Exports can be customized to align with specific grids by utilizing the `crsTransform` parameter alongside `crs`."]]],[]]