Calls geedim Initialize() method. This method should be called at the beginning of each session.

gd_initialize(
  private_key_file = NULL,
  credentials = NULL,
  cloud_api_key = NULL,
  url = "https://earthengine-highvolume.googleapis.com",
  http_transport = NULL,
  project = NULL,
  quiet = FALSE
)

gd_is_initialized(...)

Arguments

private_key_file

character. Optional: Path to JSON file containing service account credentials. (Deprecated in v0.3.0: use GOOGLE_APPLICATION_CREDENTIALS environment variable instead. If provided and GOOGLE_APPLICATION_CREDENTIALS is not set, the file path will be used to set that environment variable.)

credentials

Default: NULL uses Google Application Default Credentials (ADC) to find credentials automatically. Can be set to a pre-existing credential object if needed.

cloud_api_key

An optional API key to use the Cloud API. Default: NULL.

url

The base url for the EarthEngine REST API to connect to. Defaults to "High Volume" endpoint: "https://earthengine-highvolume.googleapis.com"

http_transport

The HTTP transport method to use when making requests. Default: NULL

project

The client project ID or number to use when making API calls. Default: NULL

quiet

Suppress error messages on load? Default: FALSE

...

Additional arguments passed to gd_initialize()

Value

gd_initialize(): try-error (invisibly) on error.

gd_is_initialized(): logical. TRUE if initialized successfully.

Details

Authentication is handled automatically by Google Application Default Credentials (ADC). When credentials is NULL (the default), the underlying Python libraries will automatically search for credentials in the following order:

  1. GOOGLE_APPLICATION_CREDENTIALS environment variable (if set)

  2. User credentials from gcloud auth application-default login

  3. Attached service account (when running on Google Cloud infrastructure)

The deprecated private_key_file parameter is provided for backward compatibility. If specified and GOOGLE_APPLICATION_CREDENTIALS is not already set, the file path will be used to set that environment variable for the Python libraries to discover.

Examples

if (FALSE) { # \dontrun{
gd_initialize()
} # }
gd_is_initialized()
#> [1] FALSE