Learn R Programming

rgee (version 0.2.0)

ee_upload_file_to_gcs: Upload local files to google cloud storage

Description

Upload images or tables into google cloud storage for EE asset ingestion tasks.

Usage

ee_upload_file_to_gcs(x, bucket = NULL,
  selenium_params = getOption("rgee.selenium.params"), clean = FALSE,
  reinit = FALSE, quiet = FALSE)

Arguments

x

filename (character), sf or stars object.

bucket

bucketname you are uploading to

selenium_params

List. Optional parameters when bucket is NULL. Parameters for setting selenium. See details.

clean

Logical; Whether is TRUE cache will cleaned, see Details.

reinit

Logical; run ee_Initialize(gcs=TRUE) before start to upload

quiet

Logical. Suppress info message.

Value

Character indicating the full name of the x argument inside gs://earthengine-uploads/

Details

It is necessary, for uploading process, get authorization to read & write into a Google Cloud Storage (GCS) bucket. Earth Engine provides a provisional for free space into GCS through gs://earthengine-uploads/. If the bucket argument is absent, this function will use Selenium driver for getting access to the URI mentioned bellow. The process for getting access to gs://earthengine-uploads/ was written entirely in Python and is as follow:

  • 1. Connecting to https://code.earthengine.google.com/ through selenium.

  • 2. Download all the cookies and saved in a request object.

  • 3. Get the URL for ingest the data temporarily.

  • 4. Create the request headers.

  • 5. Upload the x argument to GCS via POST request.