Google Earth Engine (GEE) Class

class terragon.google_earth_engine.GEE(credentials=None)

Bases: Base

The class for Google Earth Engine downloads. The package geedim will be used to download the images and they are stored intermedialtly in .tif format.

Parameters:
  • Base – Base class defining the interface and some common methods

  • credentials (dict) – unused, kept for compatibility, defaults to None

download(img_col)

Download the prepared images from the GEE ImageCollection, store them as temporary .tif files and return them as a xarray.Dataset. If create_minicube is set to True, a xarray.Dataset will be returned, otherwise a list of filenames will be returned. if rm_tmp_files is set to True, the temporary files will be removed after creating the xarray.Dataset.

Parameters:

img_col (ee.ImageCollection) – ee.ImageCollection to download

Return type:

typing.Union[xarray.core.dataset.Dataset, typing.List]

Returns:

xarray.Dataset or list of filenames

retrieve_collections(query={}, fields=[])

Not implemented, because GEE does not have a collection endpoint.

Parameters:
  • query (dict) – query to filter the collections for in style ‘{<key>:<regex>}’, defaults to {}

  • fields (list[str]) – list of fields to include in the response, defaults to []

Raises:

NotImplementedError – GEE does not have a collection endpoint

Return type:

None

search(*args, rm_tmp_files=True, **kwargs)

Search for items in the GEE collections, return the items and their meta data, and store the parameters in the class in order to access them later in the download function. For a description of the args/kwargs parameters see the Base class function.

Parameters:
  • rm_tmp_files – remove temporarily downloaded files after creating the minicube, defaults to True

  • args/kwargs – Parameters which are handled by the parent class, these parameters are the same for all data providers. See the ‘Base’ class for more information.

Raises:

ValueError – when parameters are missing or in the wrong format

Return type:

ee.ImageCollection

Returns:

ee.ImageCollection