Skip to content

processing_graph

A processing graph representation and methods on processing graphs

class ProcessingGraphId()

A wrapper around a processing graph UUID

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

Create a new ProcessingGraphId from an UUID or uuid as str

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

Create a ProcessingGraphId 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 ProcessingGraph()

Holds a processing graph id and allows querying data

def get_result_descriptor() -> ResultDescriptor

Return the metadata of the processing graph result

def definition(timeout: int = 60) -> geoc.ProcessingGraph

Return the definition of this processing graph

@deprecated("Use `ProcessingGraph.definition` instead.",
category=DeprecationWarning)
def workflow_definition(timeout: int = 60) -> geoc.ProcessingGraph

Deprecated: use ProcessingGraph.definition instead.

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

Query a processing graph and return the WFS result as a GeoPandas GeoDataFrame

The computation ID from the server response is attached as an attribute. Access via: df.attrs.get('computation_id')

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 processing graph and return the plot chart result as WrappedPlotOutput

If spatial_resolution is set, raster inputs are read at the coarsest overview level that is not coarser than it, which is faster but less exact. Otherwise, they are read at their native resolution.

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

Query a processing graph 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 processing graph 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 processing graph 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 processing graph 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 processing graph

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

Query processing graph 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 processing graph result as a layer

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

Stream the processing graph 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 processing graph 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 processing graph 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 processing graph 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_processing_graph(processing_graph: dict[str, Any]
| ProcessingGraphBuilderOperator,
timeout: int = 60) -> ProcessingGraph

Register a processing graph in Geo Engine and receive a ProcessingGraph

def processing_graph_by_id(processing_graph_id: UUID | str) -> ProcessingGraph

Create a processing graph object from a processing graph id

@deprecated("Use `register_processing_graph` instead.",
category=DeprecationWarning)
def register_workflow(workflow: dict[str, Any]
| ProcessingGraphBuilderOperator,
timeout: int = 60) -> ProcessingGraph

Deprecated: use register_processing_graph instead.

@deprecated("Use `processing_graph_by_id` instead.",
category=DeprecationWarning)
def workflow_by_id(workflow_id: UUID | str) -> ProcessingGraph

Deprecated: use processing_graph_by_id instead.

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

def data_usage_for_computation(computation_id: UUID) -> int

Get data usage for a specific computation