Move a GeoTIFF image from GCS to their EE assets

gcs_to_ee_image(
  x,
  gs_uri,
  assetId,
  overwrite = FALSE,
  properties = NULL,
  command_line_tool_path = NULL,
  start_time = "1970-01-01",
  end_time = "1970-01-01",
  pyramiding_policy = "MEAN",
  quiet = FALSE
)

Arguments

x

An object of class stars or stars-proxy.

gs_uri

Character. It represents the full name of the GeoTIFF file of x in a GCS bucket.

assetId

Character. How to call the file once uploaded to the Earth Engine Asset. e.g. users/datacolecfbf/mydatacollection.

overwrite

Logical. If TRUE, the assetId will be overwritten if it exists.

properties

List. Set of parameters to be set up as properties of the EE object.

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 via is not defined as "gcs_to_asset").

start_time

Character. Sets the start time property to a number or date.

end_time

Character. Sets the end time property to a number or date.

pyramiding_policy

The pyramid reduction policy to use.

quiet

Logical. Suppress info message.

Value

Character. The Earth Engine asset ID.

Examples

if (FALSE) {
library(rgee)
library(sf)
ee_Initialize(gcs = TRUE)

# Create sf object
nc <- st_read(system.file("shape/nc.shp", package="sf"))
assetId <- sprintf("%s/%s",ee_get_assethome(),'sf_nc')

# Method 1
# 1. Pass the sf to a zip file
zipfile <- ee_utils_shp_to_zip(nc)

# # 2. From local to gcs
# gs_uri <- local_to_gcs(x = zipfile, bucket = 'rgee_dev')

# # 3. Pass the sf to a zip file
# gcs_to_ee_table(
#    gs_uri = gs_uri,
#    overwrite = TRUE,
#    assetId = assetId
# )

# # OPTIONAL: Monitoring progress
# ee_monitoring()

# # OPTIONAL: Display results
# ee_sf_01 <- ee$FeatureCollection(assetId)
# Map$centerObject(ee_sf_01)
# Map$addLayer(ee_sf_01)

# # Method 2
# ee_sf_02 <- sf_as_ee(x = nc,
#                       assetId = assetId,
#                       overwrite = TRUE,
#                       bucket = "rgee_dev",
#                       via = 'gcs')
# Map$centerObject(ee_sf_02)
# Map$addLayer(ee_sf_02)
}