Learn R Programming

rgee (version 0.5.0)

gcs_to_ee_image: Move a GeoTIFF image from GCS to their EE assets

Description

Move a GeoTIFF image from GCS to their EE assets

Usage

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

Arguments

x

stars object.

gs_uri

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

assetId

Character. What 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.

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.

Examples

Run this code
# NOT RUN {
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,
  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_sf_02 <- stars_as_ee(x = x,
                        assetId = assetId,
                        bucket = "rgee_dev")
Map$centerObject(ee_sf_02)
Map$addLayer(ee_sf_02)
# }

Run the code above in your browser using DataLab