EEDAI - Google Earth Engine Data API Image
Driver short name
New in version 2.4.
The driver supports read-only operations to access image content, using Google Earth Engine REST API.
This driver supports georeferencing
Dataset name syntax
The minimal syntax to open a datasource is :
where asset is something like projects/earthengine-public/assets/COPERNICUS/S2/20170430T190351_20170430T190351_T10SEG, and band_names a comma separated list of band names (typically indicated by subdatasets on the main image)
The following open options are available :
ASSET=<string>: To specify the asset if not specified in the connection string.
BANDS=value: Comma separated list of band names.
PIXEL_ENCODING=[AUTO/PNG/JPEG/AUTO_JPEG_PNG/GEO_TIFF/NPY]: Format in which to request pixels.
BLOCK_SIZE=<integer>: Defaults to
256. Size of a GDAL block, which is the minimum unit to query pixels.
The following authentication methods can be used:
Service account private key file, through the
Finally if none of the above method succeeds, the code will check if the current machine is a Google Compute Engine instance, and if so will use the permissions associated to it (using the default service account associated with the VM). To force a machine to be detected as a GCE instance (for example for code running in a container with no access to the boot logs), you can set
The following configuration options are available :
EEDA_BEARER=value: Authentication Bearer value to pass to the API. This option is only useful when the token is computed by external code. The bearer validity is typically one hour from the time where it as been requested.
EEDA_BEARER_FILE=<filename>: Similar to
EEDA_BEARERoption, except than instead of passing the value directly, it is the filename where the value should be read.
GOOGLE_APPLICATION_CREDENTIALS=<file.json>: Service account private key file that contains a private key and client email
EEDA_PRIVATE_KEY=value: RSA private key encoded as a PKCS#8 PEM file, with its header and footer. Used together with
EEDA_CLIENT_EMAILto use OAuth2 Service Account authentication. Requires GDAL to be built against libcrypto++ or libssl.
EEDA_PRIVATE_KEY_FILE=<filename>: Similar to
EEDA_PRIVATE_KEYoption, except than instead of passing the value directly, it is the filename where the key should be read.
CPL_MACHINE_IS_GCE=[YES/NO]: Defaults to
YES, forces GDAL to consider the current machine to be a a Google Compute Engine instance. May be needed for code running in a container with no access to the boot logs.
The driver expose overviews, following a logic of decreasing power of 2 factors, until both dimensions of the smallest overview are lower than 256 pixels.
When all bands don't have the same georeferencing, resolution, CRS or image dimensions, the driver will expose subdatasets. Each subdataset groups together bands of the same dimension, extent, resolution and CRS.
The driver will expose metadata reported in "properties" as dataset-level or band-level metadata.
By default (
PIXEL_ENCODING=AUTO), the driver will request pixels in a
format compatible of the number and data types of the bands. The PNG,
JPEG and AUTO_JPEG_PNG can only be used with bands of type Byte.
Get metadata on an image:
gdalinfo "EEDAI:" -oo ASSET=projects/earthengine-public/assets/COPERNICUS/S2/20170430T190351_20170430T190351_T10SEG --config EEDA_CLIENT_EMAIL "my@email" --config EEDA_PRIVATE_KEY_FILE my.pem
gdalinfo "EEDAI:projects/earthengine-public/assets/COPERNICUS/S2/20170430T190351_20170430T190351_T10SEG" --config EEDA_CLIENT_EMAIL "my@email" --config EEDA_PRIVATE_KEY_FILE my.pem