公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
Export.map.toCloudStorage
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建批量任务,以将图片导出为矩形地图块金字塔,以便与 Web 地图查看器搭配使用。地图图块将附带一个用于使用 Google Maps API 显示这些图块的参考 index.html 文件,以及一个用于在 Google 地球中打开地图的 earth.html 文件。
用法 | 返回 |
---|
Export.map.toCloudStorage(image, description, bucket, fileFormat, path, writePublicTiles, maxZoom, scale, minZoom, region, skipEmptyTiles, mapsApiKey, bucketCorsUris, priority) | |
参数 | 类型 | 详细信息 |
---|
image | 图片 | 要导出为图块的图片。 |
description | 字符串,可选 | 任务的简明易懂的名称。默认为“myExportMapTask”。 |
bucket | 字符串,可选 | 要写入的目标存储分区。 |
fileFormat | 字符串,可选 | 地图图块的文件格式,可以是“自动”“png”或“jpg”。默认为“auto”,表示不透明图块将编码为“jpg”,而具有透明度的图块将编码为“png”。 |
path | 字符串,可选 | 用作输出路径的字符串。末尾的“/”是可选的。默认为任务的说明。 |
writePublicTiles | 布尔值,可选 | 是否写入公开图块,而不是使用存储分区的默认对象 ACL。默认为 true,要求调用者是相应存储分区的所有者。 |
maxZoom | 数字,可选 | 要导出的地图图块的最大缩放级别。 |
scale | 数字,可选 | 以每像素米数表示的最大图片分辨率,可替代“maxZoom”。系统会将比例转换为赤道上最合适的最高缩放级别。 |
minZoom | 数字,可选 | 要导出的地图图块的可选最小缩放级别。默认值为 0。 |
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。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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,[]]