pysepal.scripts.gee_interface.GEEInterface#
- class pysepal.scripts.gee_interface.GEEInterface(session=None, use_sepal_headers=False)[source]#
A unified interface for Earth Engine operations.
If a session is provided at initialization, custom EESession-based calls are used. Otherwise, the default Earth Engine API methods are invoked.
Methods
A unified interface for Earth Engine operations.
Close the GEEInterface and clean up resources.
Create a folder in Earth Engine assets, blocking until done.
Asynchronously create a folder in Earth Engine assets.
Factory for GEETask bound to this interface's loop, with callbacks wired.
Export an image to an asset, blocking until done.
Asynchronously export an image to an asset.
Export an image to Google Drive, blocking until done.
Asynchronously export an image to Google Drive.
Export a FeatureCollection to an asset, blocking until done.
Asynchronously export a FeatureCollection to an asset.
Export a FeatureCollection to Google Drive, blocking until done.
Asynchronously export a FeatureCollection to Google Drive.
Get an asset by its ID, blocking until done.
Asynchronously get an asset by its ID.
Get assets in a specified folder, blocking until done.
Asynchronously get assets in a specified folder.
Get the assets folder path, blocking until done.
Asynchronously get the assets folder path.
Get info for an Earth Engine object, blocking until done.
Asynchronously get_info for an Earth Engine object.
Synchronously get info for multiple Earth Engine objects in batch.
Asynchronously get info for multiple Earth Engine objects in batch.
Get map ID for an Earth Engine image, blocking until done.
Asynchronously get map ID for an Earth Engine image.
Get a task by its ID, blocking until done.
Asynchronously get a task by its ID.
Check if a task is running by its name, blocking until done.
Asynchronously check if a task is running by its name.
- Parameters:
session (EESession | None)
- GEEInterface.__init__(session=None, use_sepal_headers=False)[source]#
A unified interface for Earth Engine operations.
If a session is provided at initialization, custom EESession-based calls are used. Otherwise, the default Earth Engine API methods are invoked.
- Parameters:
session (EESession | None)
- GEEInterface.create_folder(folder_path)[source]#
Create a folder in Earth Engine assets, blocking until done.
- Parameters:
folder_path (str)
- Return type:
Dict
- async GEEInterface.create_folder_async(folder_path)[source]#
Asynchronously create a folder in Earth Engine assets.
- Parameters:
folder_path (str)
- Return type:
Dict
- GEEInterface.create_task(func, key=None, on_progress=None, on_done=None, on_error=None, on_finally=None)[source]#
Factory for GEETask bound to this interface’s loop, with callbacks wired.
- Parameters:
func (Callable[[...], Coroutine[Any, Any, R]])
key (str | None)
on_progress (Callable[[float, str], None] | None)
on_done (Callable[[R], None] | None)
on_error (Callable[[Exception], None] | None)
on_finally (Callable[[], None] | None)
- Return type:
GEETask[R]
- GEEInterface.export_image_to_asset(image, asset_id, description='myExportImageTask', region=None, scale=None, crs=None, crs_transform=None, max_pixels=None, pyramid_policy=None, priority=None)[source]#
Export an image to an asset, blocking until done.
- Parameters:
image (Image)
asset_id (str)
description (str)
region (Geometry | None)
scale (float | None)
crs (str | None)
crs_transform (List[float] | None)
max_pixels (int | None)
pyramid_policy (str | None)
priority (int | None)
- Return type:
str
- async GEEInterface.export_image_to_asset_async(image, asset_id, description='myExportTableTask', max_pixels=None, grid=None, request_id=None, workload_tag=None, priority=None, region=None, scale=None, crs=None, crs_transform=None, pyramid_policy=None)[source]#
Asynchronously export an image to an asset.
- Parameters:
image (Image)
asset_id (str)
description (str)
max_pixels (int | None)
grid (dict | None)
request_id (str | None)
workload_tag (str | None)
priority (int | None)
region (Geometry | LinearRing | Polygon | str | None)
scale (float | None)
crs (str | None)
crs_transform (dict | None)
pyramid_policy (str | None)
- Return type:
str
- GEEInterface.export_image_to_drive(image, description='myExportImageTask', folder=None, filename_prefix=None, dimensions=None, region=None, scale=None, crs=None, crs_transform=None, max_pixels=None, skip_empty_tiles=None, file_format=ImageFileFormat.GEO_TIFF, format_options=None, priority=None)[source]#
Export an image to Google Drive, blocking until done.
- Parameters:
image (Image)
description (str)
folder (str | None)
filename_prefix (str | None)
dimensions (str | None)
region (Geometry | None)
scale (float | None)
crs (str | None)
crs_transform (List[float] | None)
max_pixels (int | None)
skip_empty_tiles (bool | None)
file_format (str | None)
format_options (Dict | None)
priority (int | None)
- Return type:
str
- async GEEInterface.export_image_to_drive_async(image, description='myExportImageTask', folder=None, filename_prefix=None, dimensions=None, region=None, scale=None, crs=None, crs_transform=None, max_pixels=None, skip_empty_tiles=None, file_format=ImageFileFormat.GEO_TIFF, format_options=None, priority=None)[source]#
Asynchronously export an image to Google Drive.
- Parameters:
image (Image)
description (str)
folder (str | None)
filename_prefix (str | None)
dimensions (str | None)
region (Geometry | None)
scale (float | None)
crs (str | None)
crs_transform (List[float] | None)
max_pixels (int | None)
skip_empty_tiles (bool | None)
file_format (str | None)
format_options (Dict | None)
priority (int | None)
- Return type:
str
- GEEInterface.export_table_to_asset(collection, asset_id, description='myExportTableTask', selectors=None, max_vertices=None, priority=None)[source]#
Export a FeatureCollection to an asset, blocking until done.
- Parameters:
collection (FeatureCollection)
asset_id (str)
description (str)
selectors (list | None)
max_vertices (int | None)
priority (int | None)
- Return type:
str
- async GEEInterface.export_table_to_asset_async(collection, asset_id, description='myExportTableTask', selectors=None, max_vertices=None, priority=None)[source]#
Asynchronously export a FeatureCollection to an asset.
- Parameters:
collection (FeatureCollection)
asset_id (str)
description (str)
selectors (list | None)
max_vertices (int | None)
priority (int | None)
- Return type:
str
- GEEInterface.export_table_to_drive(collection, fileFormat, fileNamePrefix='', folder=None, description='myExportTableTask', selectors=None, max_vertices=None, priority=None)[source]#
Export a FeatureCollection to Google Drive, blocking until done.
- Parameters:
fileFormat (TableFileFormat)
fileNamePrefix (str)
folder (str | None)
description (str)
selectors (list | None)
max_vertices (int | None)
priority (int | None)
- Return type:
str
- async GEEInterface.export_table_to_drive_async(collection, file_format, filename_prefix='', folder=None, description='myExportTableTask', selectors=None, max_vertices=None, priority=None)[source]#
Asynchronously export a FeatureCollection to Google Drive.
- Parameters:
file_format (TableFileFormat)
filename_prefix (str)
folder (str | None)
description (str)
selectors (list | None)
max_vertices (int | None)
priority (int | None)
- GEEInterface.get_asset(asset_id, not_exists_ok=False)[source]#
Get an asset by its ID, blocking until done.
- Parameters:
asset_id (str)
not_exists_ok (bool)
- Return type:
Dict
- async GEEInterface.get_asset_async(asset_id, not_exists_ok=False)[source]#
Asynchronously get an asset by its ID.
- Parameters:
asset_id (str)
not_exists_ok (bool)
- Return type:
Dict
- GEEInterface.get_assets(folder='')[source]#
Get assets in a specified folder, blocking until done.
- Parameters:
folder (str)
- Return type:
Dict
- async GEEInterface.get_assets_async(folder='')[source]#
Asynchronously get assets in a specified folder.
- Parameters:
folder (str)
- Return type:
List[Dict]
- GEEInterface.get_folder()[source]#
Get the assets folder path, blocking until done.
- Return type:
str
- async GEEInterface.get_folder_async()[source]#
Asynchronously get the assets folder path.
- Return type:
str
- GEEInterface.get_info(ee_object=None, tag=None, timeout=None, serialized_object=None)[source]#
Get info for an Earth Engine object, blocking until done.
- Parameters:
ee_object (ComputedObject | None)
tag (Any | None)
timeout (float | None)
- Return type:
Dict
- async GEEInterface.get_info_async(ee_object=None, tag=None, serialized_object=None)[source]#
Asynchronously get_info for an Earth Engine object.
- Parameters:
ee_object (ComputedObject | None)
tag (Any | None)
- Return type:
Dict
- GEEInterface.get_info_batch(ee_objects, timeout=305.0)[source]#
Synchronously get info for multiple Earth Engine objects in batch.
- Parameters:
ee_objects (List[ComputedObject])
timeout (float | None)
- Return type:
List
- async GEEInterface.get_info_batch_async(ee_objects)[source]#
Asynchronously get info for multiple Earth Engine objects in batch.
- Parameters:
ee_objects (List[ComputedObject])
- Return type:
List
- GEEInterface.get_map_id(ee_image, vis_params=None, bands=None, format=None, timeout=None)[source]#
Get map ID for an Earth Engine image, blocking until done.
- Parameters:
ee_image (Image)
vis_params (MapTileOptions | None)
bands (str | None)
format (str | None)
timeout (float | None)
- Return type:
Dict
- async GEEInterface.get_map_id_async(ee_image, vis_params=None, bands=None, format=None)[source]#
Asynchronously get map ID for an Earth Engine image.
- Parameters:
ee_image (Image)
vis_params (MapTileOptions | None)
bands (str | None)
format (str | None)
- Return type:
Dict
- GEEInterface.get_task(task_id)[source]#
Get a task by its ID, blocking until done.
- Parameters:
task_id (str)
- Return type:
Task | None
- async GEEInterface.get_task_async(task_id)[source]#
Asynchronously get a task by its ID.
- Parameters:
task_id (str)
- Return type:
Task | None