Learn R Programming

rgeedim (version 0.4.0)

gd_initialize: Initialize geedim

Description

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

Usage

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(..., quiet = TRUE)

Value

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

gd_is_initialized(): logical. TRUE if initialized successfully.

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 will check GOOGLE_CLOUD_QUOTA_PROJECT, GOOGLE_CLOUD_PROJECT then GCLOUD_PROJECT environment variables.

quiet

Suppress error messages? Default: TRUE

...

Additional arguments passed to gd_initialize()

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)

In a headless environment (e.g. CI/CD), use GOOGLE_APPLICATION_CREDENTIALS to specify the service account key file path and GOOGLE_CLOUD_QUOTA_PROJECT to specify the project ID responsible for quota and billing.

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.

See Also

gd_authenticate()

Examples

Run this code
if (FALSE) {
gd_initialize()
}
gd_is_initialized()

Run the code above in your browser using DataLab