Skip to content

workflow

A workflow representation and methods on workflows

class WorkflowId()

A wrapper around a workflow UUID

def __init__(workflow_id: UUID | str) -> None

Create a new WorkflowId from an UUID or uuid as str

@classmethod
def from_response(cls, response: geoc.IdResponse) -> WorkflowId

Create a WorkflowId from an http response

class RasterStreamProcessing()

Helper class to process raster stream data

@classmethod
def read_arrow_ipc(cls, arrow_ipc: bytes) -> pa.RecordBatch

Read an Arrow IPC file from a byte array

@classmethod
def process_bytes(cls, tile_bytes: bytes | None) -> RasterTile2D | None

Process a tile from a byte array

@classmethod
def merge_tiles(cls, tiles: list[xr.DataArray]) -> xr.DataArray | None

Merge a list of tiles into a single xarray

class Workflow()

Holds a workflow id and allows querying data

def get_result_descriptor() -> ResultDescriptor

Return the metadata of the workflow result

def workflow_definition(timeout: int = 60) -> geoc.Workflow

Return the workflow definition for this workflow

def get_dataframe(bbox: QueryRectangle,
timeout: int = 3600,
resolve_classifications: bool = False) -> gpd.GeoDataFrame

Query a workflow and return the WFS result as a GeoPandas GeoDataFrame

def wms_get_map_as_image(bbox: QueryRectangle,
raster_colorizer: RasterColorizer,
spatial_resolution: SpatialResolution) -> Image.Image

Return the result of a WMS request as a PIL Image

def plot_json(bbox: QueryRectangle,
spatial_resolution: SpatialResolution | None = None,
timeout: int = 3600) -> geoc.WrappedPlotOutput

Query a workflow and return the plot chart result as WrappedPlotOutput

def plot_chart(bbox: QueryRectangle,
spatial_resolution: SpatialResolution | None = None,
timeout: int = 3600) -> VegaLite

Query a workflow and return the plot chart result as a vega plot

def get_array(bbox: QueryRectangle,
spatial_resolution: SpatialResolution | None = None,
timeout=3600,
force_no_data_value: float | None = None) -> np.ndarray

Query a workflow and return the raster result as a numpy array

bbox : A bounding box for the query timeout : HTTP request timeout in seconds force_no_data_value: If not None, use this value as no data value for the requested raster data. Otherwise, use the Geo Engine will produce masked rasters.

def get_xarray(bbox: QueryRectangle,
spatial_resolution: SpatialResolution | None = None,
timeout=3600,
force_no_data_value: float | None = None) -> xr.DataArray

Query a workflow and return the raster result as a georeferenced xarray

bbox : A bounding box for the query timeout : HTTP request timeout in seconds force_no_data_value: If not None, use this value as no data value for the requested raster data. Otherwise, use the Geo Engine will produce masked rasters.

def download_raster(
bbox: QueryRectangle,
file_path: str,
timeout=3600,
file_format: str = "image/tiff",
force_no_data_value: float | None = None,
spatial_resolution: SpatialResolution | None = None) -> None

Query a workflow and save the raster result as a file on disk

bbox : A bounding box for the query file_path : The path to the file to save the raster to timeout : HTTP request timeout in seconds file_format : The format of the returned raster force_no_data_value: If not None, use this value as no data value for the requested raster data. Otherwise, use the Geo Engine will produce masked rasters.

def get_provenance(timeout: int = 60) -> list[ProvenanceEntry]

Query the provenance of the workflow

def metadata_zip(path: PathLike | BytesIO, timeout: int = 60) -> None

Query workflow metadata and citations and stores it as zip file to path

def save_as_dataset(query_rectangle: QueryRectangle,
name: None | str,
display_name: str,
description: str = "",
timeout: int = 3600) -> Task

Init task to store the workflow result as a layer

async def raster_stream(query_rectangle: QueryRectangle | RasterQueryRectangle,
open_timeout: int = 60) -> AsyncIterator[RasterTile2D]

Stream the workflow result as series of RasterTile2D (transformable to numpy and xarray)

async def raster_stream_into_xarray(query_rectangle: RasterQueryRectangle,
clip_to_query_rectangle: bool = False,
open_timeout: int = 60) -> xr.DataArray

Stream the workflow result into memory and output a single xarray.

NOTE: You can run out of memory if the query rectangle is too large.

async def vector_stream(
query_rectangle: QueryRectangle,
time_start_column: str = "time_start",
time_end_column: str = "time_end",
open_timeout: int = 60) -> AsyncIterator[gpd.GeoDataFrame]

Stream the workflow result as series of GeoDataFrames

async def vector_stream_into_geopandas(
query_rectangle: QueryRectangle,
time_start_column: str = "time_start",
time_end_column: str = "time_end",
open_timeout: int = 60) -> gpd.GeoDataFrame

Stream the workflow result into memory and output a single geo data frame.

NOTE: You can run out of memory if the query rectangle is too large.

def register_workflow(workflow: dict[str, Any] | WorkflowBuilderOperator,
timeout: int = 60) -> Workflow

Register a workflow in Geo Engine and receive a WorkflowId

def workflow_by_id(workflow_id: UUID | str) -> Workflow

Create a workflow object from a workflow id

def get_quota(user_id: UUID | None = None, timeout: int = 60) -> geoc.Quota

Gets a user’s quota. Only admins can get other users’ quota.

def update_quota(user_id: UUID,
new_available_quota: int,
timeout: int = 60) -> None

Update a user’s quota. Only admins can perform this operation.

def data_usage(offset: int = 0, limit: int = 10) -> list[geoc.DataUsage]

Get data usage

def data_usage_summary(granularity: geoc.UsageSummaryGranularity,
dataset: str | None = None,
offset: int = 0,
limit: int = 10) -> pd.DataFrame

Get data usage summary