R/raster_as_ee.R
stars_as_ee.Rd
Convert a stars or stars-proxy object into an EE Image object
stars_as_ee( x, assetId, command_line_tool_path = NULL, overwrite = FALSE, monitoring = TRUE, bucket = NULL, quiet = FALSE )
x | stars or stars-proxy object to be converted into an ee$Image. |
---|---|
assetId | Character. Destination asset ID for the uploaded file. |
command_line_tool_path | Character. Path to the Earth Engine command line
tool (CLT). If NULL, rgee assumes that CLT is set in the system PATH.
(ignore if |
overwrite | Logical. If TRUE, the assetId will be overwritten. |
monitoring | Logical. If TRUE the exportation task will be monitored. |
bucket | Character. Name of the GCS bucket. |
quiet | Logical. Suppress info message. |
An ee$Image object
Other image upload functions:
raster_as_ee()
if (FALSE) { library(rgee) library(stars) ee_Initialize(gcs = TRUE) # Get the filename of a image tif <- system.file("tif/L7_ETMs.tif", package = "stars") x <- read_stars(tif) assetId <- sprintf("%s/%s",ee_get_assethome(),'stars_l7') # # Method 1 # # 1. Move from local to gcs # gs_uri <- local_to_gcs(x = tif, bucket = 'rgee_dev') # # 2. Pass from gcs to asset # gcs_to_ee_image( # x = x, # overwrite = TRUE, # gs_uri = gs_uri, # assetId = assetId #) # # OPTIONAL: Monitoring progress # ee_monitoring() # # OPTIONAL: Display results # ee_stars_01 <- ee$Image(assetId) # Map$centerObject(ee_stars_01) # Map$addLayer(ee_stars_01) # # Method 2 # ee_stars_02 <- stars_as_ee( # x = x, # overwrite = TRUE, # assetId = assetId, # bucket = "rgee_dev" # ) # Map$centerObject(ee_stars_02) # Map$addLayer(ee_stars_02) }