Python API: fix ee.data.create_assets() when creating parents folders#185
Python API: fix ee.data.create_assets() when creating parents folders#185jbardo wants to merge 1 commit intogoogle:masterfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
import os Replace with your Google Earth Engine project IDPROJECT_ID = "project id" Replace with the path to your folder containing .tif filesFOLDER_PATH = "path to the folder" Function to upload a single imagedef upload_image(image_path, asset_id): Initialize Earth Engineee.Initialize(authenticate=True) Upload the imagetask = ee.batch.Upload.image(image_path, asset_id=asset_id, project=PROJECT_ID) Loop through files in the folder and upload themfor filename in os.listdir(FOLDER_PATH): |
|
Is there any progress on this? We face the same issue. |
When calling ee.data.create_assets() with mk_parents=True, for example via the cli:
earthengine create folder --parents projects/<project_id>/assets/a/b/cwe systematically get the following error:
TypeError: Parameter "name" value "projects/<project_id>/assets" does not match the pattern "^projects/[^/]+/assets/.*$"It seems the code still refers to an outdated organization
user/projectinstead ofprojects/<project_id>/assets.