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

Description Usage Arguments Value Examples

View source: R/utils-upload.R

Description

Move a GeoTIFF image from GCS to their EE assets

Usage

1
2
3
4
5
6
gcs_to_ee_image(
  manifest,
  overwrite = FALSE,
  command_line_tool_path = NULL,
  quiet = FALSE
)

Arguments

manifest

Character. manifest upload file. See ee_utils_create_manifest_image.

overwrite

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

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").

quiet

Logical. Suppress info message.

Value

Character. The Earth Engine asset ID.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Not run: 
library(rgee)
library(stars)
ee_Initialize("csaybar", gcs = TRUE)

# 1. Read GeoTIFF file and create a output filename
tif <- system.file("tif/L7_ETMs.tif", package = "stars")
x <- read_stars(tif)
assetId <- sprintf("%s/%s",ee_get_assethome(),'stars_l7')

# # 2. From local to gcs
# gs_uri <- local_to_gcs(
#   x = tif,
#   bucket = 'rgee_dev' # Insert your own bucket here!
# )
#
# # 3. Create an Image Manifest
# manifest <- ee_utils_create_manifest_image(gs_uri, assetId)
#
# # 4. From GCS to Earth Engine
# gcs_to_ee_image(
#   manifest = manifest,
#   overwrite = TRUE
# )
#
# # OPTIONAL: Monitoring progress
# ee_monitoring()
#
# # OPTIONAL: Display results
# ee_stars_01 <- ee$Image(assetId)
# # ee_stars_01$bandNames()$getInfo()
# Map$centerObject(ee_stars_01)
# Map$addLayer(ee_stars_01, list(min = 0, max = 255, bands = c("b3", "b2", "b1")))

## End(Not run)

csaybar/rgee documentation built on March 11, 2021, 5:48 a.m.