公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
Method: projects.maps.create
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建一个 ID,用于渲染显示计算结果的地图图块。生成的 ID 应作为 GetTile
请求的一部分使用。
此属性与 GetTile
结合使用。调用 maps.create
会提供一个表达式和一些输出选项。maps.create
的结果是一个地图 ID,表示的是评估该表达式并应用这些选项后得到的图片。随后,可以调用 GetTile
来获取生成图片的任意位置和缩放级别下的某个图块的图片数据。地图 ID 的有效期为中等时间(几个小时)。
这对端点最常见的用例是使用某些计算输出的可视化结果填充地图视口。为此,计算输出必须满足对请求的图片格式的一些合理要求。具体而言,JPEG 或 PNG 格式要求有 1 个或 3 个输出波段,并且剪裁值超出 0-255 范围。
HTTP 请求
POST https://earthengine.googleapis.com/v1/{parent=projects/*}/maps
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
必需。映射集合的父级(例如“projects/*”)。
必须对指定的资源 parent 具有以下 IAM 权限才能进行授权:
|
查询参数
参数 |
workloadTag |
string
用户提供的用于跟踪此计算的代码。
|
请求正文
请求正文包含一个 EarthEngineMap
实例。
响应正文
如果成功,响应正文将包含一个新创建的 EarthEngineMap
实例。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/earthengine
https://www.googleapis.com/auth/earthengine.readonly
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/cloud-platform.read-only
如需了解详情,请参阅 OAuth 2.0 Overview。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003e\u003ccode\u003emaps.create\u003c/code\u003e generates a unique map ID for rendering map tiles based on a provided computation.\u003c/p\u003e\n"],["\u003cp\u003eThe generated map ID can be used with \u003ccode\u003eGetTile\u003c/code\u003e requests to retrieve image data for specific map locations and zoom levels.\u003c/p\u003e\n"],["\u003cp\u003eOutput data for JPEG or PNG formats must have 1-3 bands with values within the 0-255 range.\u003c/p\u003e\n"],["\u003cp\u003eMap IDs are temporary and remain valid for a few hours.\u003c/p\u003e\n"],["\u003cp\u003eThis functionality is commonly used to display visualizations of computational results on a map.\u003c/p\u003e\n"]]],["`maps.create` generates a map ID by evaluating an expression and applying output options. This ID, valid for a few hours, is used with `GetTile` to retrieve image data for tiles at specific locations and zoom levels. This process visualizes computation outputs, requiring JPEG or PNG formats with one or three bands, and 0-255 value range. The `POST` request requires an IAM permission. It includes a `workloadTag` and uses a specific `parent` path parameter.\n"],null,["# Method: projects.maps.create\n\nCreates an ID that can be used to render map tiles showing the results of a computation. The resulting ID should be used as part of `GetTile` requests.\n\nThis is used in conjunction with `GetTile`. A call to `maps.create` provides an expression and some output options. The result of `maps.create` is a map ID that represents an image that is the result of evaluating that expression and applying those options. Subsequently, calls to `GetTile` can be made to get image data for a tile of the resulting image, at any desired location and zoom. The map ID will be valid for a moderate period (a few hours).\n\nThe most common use case for this pair of endpoints is to populate a map viewport with a visualization of the output of some computation. In order for that to be possible, the computation output has to meet some reasonable requirements for the requested image format. In particular, JPEG or PNG format requires that there be one or three output bands, and clips values that are outside the 0-255 range.\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1/{parent=projects/*}/maps`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The parent of the map collection (e.g., \"projects/\\*\"). Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `earthengine.maps.create` |\n\n### Query parameters\n\n| Parameters ||\n|---------------|-------------------------------------------------------|\n| `workloadTag` | `string` User supplied tag to track this computation. |\n\n### Request body\n\nThe request body contains an instance of [EarthEngineMap](/earth-engine/reference/rest/v1/projects.locations.maps#EarthEngineMap).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [EarthEngineMap](/earth-engine/reference/rest/v1/projects.locations.maps#EarthEngineMap).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/earthengine`\n- `\n https://www.googleapis.com/auth/earthengine.readonly`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/cloud-platform.read-only`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]