Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

commented out prefixing of assetId with "projects/earthegine-legacy/assets/"#311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
bbest wants to merge1 commit intor-spatial:master
base:master
Choose a base branch
Loading
frombbest:rm-earthengine-legacy-asset-naming

Conversation

@bbest
Copy link

Hi@saybar et al,

Thank you for this awesome package! 📦 🚀

I was having trouble uploading vectorsf polygons into Earth Engine assets and noticed some odd prefixing of the proposed assetId with"projects/earthengine-legacy/assets/", so I commented that out, and it now works.

Example with my own user-specific paths:

devtools::install_github("ecoquants/offhabr")if (!require(librarian))  install.packages("librarian")librarian::shelf(  devtools, sf, rgee)ee_Initialize(gcs = TRUE)ee_x <- st_read(system.file("shape/nc.shp", package = "sf"))fc_zones <- rgee::sf_as_ee(  ee_x,   via        = "gcs_to_asset",  assetId    = "projects/ee-offhab/assets/fc_nc",  bucket     = "offhab_lyrs",  proj       = "EPSG:4326",  monitoring = T,  quiet      = F)

@bbest
Copy link
Author

So now I see how this is weirdly specified inAsset IDs and names - Manifest Upload  |  Google Earth Engine  |  Google Developers:

The asset name in the manifest needs to be slightly different from the asset ID visible elsewhere in Earth Engine. To upload assets whose asset IDs start with users/some_user or projects/some_project, the asset name in the manifest must have the string projects/earthengine-legacy/assets/ prepended to the ID. For example, EE asset ID users/username/my_geotiff should be uploaded using the name projects/earthengine-legacy/assets/users/username/my_geotiff.

Yes, this means that IDs like projects/some_projects/some_asset get converted into names where projects is mentioned twice: projects/earthengine-legacy/assets/projects/some_projects/some_asset. This is confusing but necessary to conform to the Google Cloud API standards.

However when I updated the path accordingly in themanifest_json it didn't work:

gcs_to_ee_image(manifest_json,overwrite=T,quiet=F)

Result in EE Tasks:

Asset name: projects/earthengine-legacy/assets/projects/ee-offhab/assets/im_zones_v1bID: AC2DKC3UHM7OEAVGVYXLUFFSPhase: FailedRuntime: 0s (started 2023-01-13 14:21:12 +0100)Attempted 1 timeError: Not an assetserver id: 'projects/ee-offhab/assets' (Error code: 3)

So perhaps the GEE policy changed to no longer use that prefix without updating the documentation.

@csaybar
Copy link
Collaborator

Hi@bbest, sorry for the late reply, and thanks for the PR.

I can reproduce your previous example without errors:

library(rgee)library(sf)ee_Initialize(gcs=TRUE)ee_x<- st_read(system.file("shape/nc.shp",package="sf"))#ee_utils_sak_validate(bucket = "rgeedev2")fc_zones<- sf_as_ee(ee_x,via="gcs_to_asset",assetId="users/csaybar/demo2",bucket="rgeedev2",proj="EPSG:4326",monitoring=T,quiet=F)

It seems that I'm not considering GEE project users. I will take a deep look on the weekend. Did you find a workaround?. What do you get after running this?:

ee_get_assethome()

@bbest
Copy link
Author

Hi@csaybar,

So sorry for dropping out of touch on this. Yes, I believe you identified the issue with the special treatment ofuser asset paths (i.e., starting withusers/) versusproject asset paths (i.e., starting withprojects/).

I see how this has a broader systemic implications throughout the code to accomodate. I'd like to help with this, but not sure how soon I can revisit this.

PS Here's the output of:

ee_get_assethome()
[1] "users/ben-ecoquants"

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@bbest@csaybar

[8]ページ先頭

©2009-2025 Movatter.jp