公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
Export.map.toCloudStorage
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
建立批次工作,將圖片匯出為地圖圖塊的矩形金字塔,供網路地圖檢視器使用。地圖圖塊會附上參考用的 index.html 檔案,可使用 Google 地圖 API 顯示圖塊,以及 earth.html 檔案,可在 Google 地球中開啟地圖。
用量 | 傳回 |
---|
Export.map.toCloudStorage(image, description, bucket, fileFormat, path, writePublicTiles, maxZoom, scale, minZoom, region, skipEmptyTiles, mapsApiKey, bucketCorsUris, priority) | |
引數 | 類型 | 詳細資料 |
---|
image | 圖片 | 要匯出為圖塊的圖片。 |
description | 字串 (選用) | 使用者可解讀的任務名稱。預設值為「myExportMapTask」。 |
bucket | 字串 (選用) | 要寫入的目的地 bucket。 |
fileFormat | 字串 (選用) | 地圖圖塊的檔案格式,可以是「auto」、「png」或「jpg」。預設為「auto」,也就是不透明的圖塊會編碼為「jpg」,透明的圖塊則會編碼為「png」。 |
path | 字串 (選用) | 做為輸出路徑的字串。結尾的「/」為選填項目。預設為工作說明。 |
writePublicTiles | 布林值 (選填) | 是否要寫入公開圖塊,而非使用值區的預設物件 ACL。預設為 true,且呼叫端必須是值區的擁有者。 |
maxZoom | 號碼 (選填) | 要匯出地圖圖塊的最大縮放等級。 |
scale | 號碼 (選填) | 以每像素公尺為單位的最大圖片解析度,可做為「maxZoom」的替代值。系統會將比例尺轉換為赤道上最合適的最大縮放等級。 |
minZoom | 號碼 (選填) | 要匯出地圖圖塊的選用最低縮放等級。預設值為零。 |
region | Geometry.LinearRing|Geometry.Polygon|String,選用 | 代表要匯出區域的 LinearRing、Polygon 或座標。這些可以是 Geometry 物件,也可以是序列化為字串的座標。地圖圖塊會在這個幾何圖形所在的矩形區域中產生。 |
skipEmptyTiles | 布林值 (選填) | 如果為 true,則略過寫入空白 (即完全透明) 的地圖圖塊。預設值為 false。僅支援 GeoTIFF 匯出。 |
mapsApiKey | 字串 (選用) | 用於 index.html,初始化 Google Maps API。地圖會移除「僅供開發用途」訊息。 |
bucketCorsUris | List<String> (選用) | 允許從 JavaScript 擷取匯出圖塊的網域清單 (例如 https://code.earthengine.google.com)。將圖塊設為公開,並不足以允許網頁存取,因此您必須明確授予網域存取水桶的權限。這就是跨源資源共享 (CORS)。您可以使用「*」允許所有網域存取,但一般不建議這麼做。詳情請參閱 https://cloud.google.com/storage/docs/cross-origin。 |
priority | 號碼 (選填) | 專案內工作的優先順序。系統會優先排定優先順序較高的工作。必須是介於 0 至 9999 之間的整數。預設值為 100。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eExports an image as map tiles for web map viewers, including an index.html for Google Maps API and earth.html for Google Earth.\u003c/p\u003e\n"],["\u003cp\u003eAllows customization of file format, zoom levels, region, and tile visibility (public or private).\u003c/p\u003e\n"],["\u003cp\u003eOptionally skips empty tiles, provides a Google Maps API key, and sets bucket access for web domains.\u003c/p\u003e\n"],["\u003cp\u003eUses \u003ccode\u003eExport.map.toCloudStorage()\u003c/code\u003e function with parameters for image, destination, format, and various optional configurations.\u003c/p\u003e\n"]]],["This content details how to export an image as a tiled map pyramid for web viewers. The core action is using `Export.map.toCloudStorage` to create a batch task, specifying parameters like the `image`, `bucket`, `fileFormat`, and zoom levels (`minZoom`, `maxZoom`, or `scale`). Optional settings include a task `description`, `region`, `writePublicTiles`, and skipping empty tiles. The function also generates `index.html` (Google Maps API) and `earth.html` (Google Earth) files. Other setting is to establish the `mapsApiKey`, `bucketCorsUris` and the `priority`.\n"],null,[]]