Method: projects.assets.create
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tạo một thành phần.
Bạn có thể tạo các loại thành phần sau: * FOLDER
: Không được chỉ định trường nào trong asset
. * IMAGE
: Để tạo một thành phần được COG hỗ trợ, hãy sử dụng image.importExternal
. Hãy xem https://developers.google.com/earth-engine/Earth_Engine_asset_from_cloud_geotiff để biết thêm thông tin chi tiết. * IMAGE_COLLECTION
: Chỉ có thể chỉ định các trường startTime
, endTime
và properties
.
Yêu cầu HTTP
POST https://earthengine.googleapis.com/v1/{parent=projects/*}/assets
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
parent |
string
Bắt buộc. Thành phần mẹ của tập hợp thành phần (ví dụ: "projects/*").
Việc uỷ quyền yêu cầu quyền IAM sau đây trên tài nguyên parent đã chỉ định:
earthengine.assets.create
|
Tham số truy vấn
Thông số |
assetId |
string
Mã của thành phần cần tạo. Tương đương với tên nhưng không có "projects/*/assets" (ví dụ: users/[USER]/[ASSET]).
|
overwrite |
boolean
Cho phép ghi đè thành phần hình ảnh hay không.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của EarthEngineAsset
.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một thực thể EarthEngineAsset
mới tạo.
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/earthengine
https://www.googleapis.com/auth/cloud-platform
Để biết thêm thông tin, hãy xem OAuth 2.0 Overview.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eCreates an Earth Engine asset with the specified ID and type (FOLDER, IMAGE, or IMAGE_COLLECTION).\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with \u003ccode\u003eearthengine.assets.create\u003c/code\u003e permission on the parent resource.\u003c/p\u003e\n"],["\u003cp\u003eAllows specification of \u003ccode\u003estartTime\u003c/code\u003e, \u003ccode\u003eendTime\u003c/code\u003e, \u003ccode\u003eproperties\u003c/code\u003e, and \u003ccode\u003ecloudStorageLocation\u003c/code\u003e for image assets.\u003c/p\u003e\n"],["\u003cp\u003eOptionally overwrites existing image assets using the \u003ccode\u003eoverwrite\u003c/code\u003e query parameter.\u003c/p\u003e\n"],["\u003cp\u003eUses a POST request to the \u003ccode\u003eearthengine.googleapis.com\u003c/code\u003e endpoint with asset details in the request body.\u003c/p\u003e\n"]]],["Asset creation is initiated via a POST request to `https://earthengine.googleapis.com/v1/{parent=projects/*}/assets`. The request requires the `earthengine.assets.create` IAM permission. Assets can be `FOLDER`, `IMAGE`, or `IMAGE_COLLECTION`, each with specific allowable fields. `assetId` and `overwrite` can be set in query parameters. The request body defines the `EarthEngineAsset`. A successful response returns the newly created `EarthEngineAsset`. Authorization requires either `earthengine` or `cloud-platform` OAuth scopes.\n"],null,["# Method: projects.assets.create\n\nCreates an asset.\n\nThe following asset types are createable: \\* `FOLDER`: No fields in `asset` may be specified. \\* `IMAGE`: To create a COG-backed asset, use `image.importExternal` instead. See \u003chttps://developers.google.com/earth-engine/Earth_Engine_asset_from_cloud_geotiff\u003e for more details. \\* `IMAGE_COLLECTION`: Only the fields `startTime`, `endTime`, and `properties` may be specified.\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1/{parent=projects/*}/assets`\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 asset collection (e.g., \"projects/\\*\"). Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `earthengine.assets.create` |\n\n### Query parameters\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| `assetId` | `string` The ID of the asset to create. Equivalent to name but without the \"projects/\\*/assets\" (e.g., users/\\[USER\\]/\\[ASSET\\]). |\n| `overwrite` | `boolean` Whether to allow overwriting an image asset. |\n\n### Request body\n\nThe request body contains an instance of [EarthEngineAsset](/earth-engine/reference/rest/v1/projects.assets#EarthEngineAsset).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [EarthEngineAsset](/earth-engine/reference/rest/v1/projects.assets#EarthEngineAsset).\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/cloud-platform`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]