workflow
A workflow representation and methods on workflows
WorkflowId Objects
Section titled “WorkflowId Objects”class WorkflowId()A wrapper around a workflow UUID
__init__
Section titled “__init__”def __init__(workflow_id: UUID | str) -> NoneCreate a new WorkflowId from an UUID or uuid as str
from_response
Section titled “from_response”@classmethoddef from_response(cls, response: geoc.IdResponse) -> WorkflowIdCreate a WorkflowId from an http response
RasterStreamProcessing Objects
Section titled “RasterStreamProcessing Objects”class RasterStreamProcessing()Helper class to process raster stream data
read_arrow_ipc
Section titled “read_arrow_ipc”@classmethoddef read_arrow_ipc(cls, arrow_ipc: bytes) -> pa.RecordBatchRead an Arrow IPC file from a byte array
process_bytes
Section titled “process_bytes”@classmethoddef process_bytes(cls, tile_bytes: bytes | None) -> RasterTile2D | NoneProcess a tile from a byte array
merge_tiles
Section titled “merge_tiles”@classmethoddef merge_tiles(cls, tiles: list[xr.DataArray]) -> xr.DataArray | NoneMerge a list of tiles into a single xarray
Workflow Objects
Section titled “Workflow Objects”class Workflow()Holds a workflow id and allows querying data
get_result_descriptor
Section titled “get_result_descriptor”def get_result_descriptor() -> ResultDescriptorReturn the metadata of the workflow result
workflow_definition
Section titled “workflow_definition”def workflow_definition(timeout: int = 60) -> geoc.WorkflowReturn the workflow definition for this workflow
get_dataframe
Section titled “get_dataframe”def get_dataframe(bbox: QueryRectangle, timeout: int = 3600, resolve_classifications: bool = False) -> gpd.GeoDataFrameQuery a workflow and return the WFS result as a GeoPandas GeoDataFrame
wms_get_map_as_image
Section titled “wms_get_map_as_image”def wms_get_map_as_image(bbox: QueryRectangle, raster_colorizer: RasterColorizer, spatial_resolution: SpatialResolution) -> Image.ImageReturn the result of a WMS request as a PIL Image
plot_json
Section titled “plot_json”def plot_json(bbox: QueryRectangle, spatial_resolution: SpatialResolution | None = None, timeout: int = 3600) -> geoc.WrappedPlotOutputQuery a workflow and return the plot chart result as WrappedPlotOutput
plot_chart
Section titled “plot_chart”def plot_chart(bbox: QueryRectangle, spatial_resolution: SpatialResolution | None = None, timeout: int = 3600) -> VegaLiteQuery a workflow and return the plot chart result as a vega plot
get_array
Section titled “get_array”def get_array(bbox: QueryRectangle, spatial_resolution: SpatialResolution | None = None, timeout=3600, force_no_data_value: float | None = None) -> np.ndarrayQuery a workflow and return the raster result as a numpy array
Parameters
Section titled “Parameters”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.
get_xarray
Section titled “get_xarray”def get_xarray(bbox: QueryRectangle, spatial_resolution: SpatialResolution | None = None, timeout=3600, force_no_data_value: float | None = None) -> xr.DataArrayQuery a workflow and return the raster result as a georeferenced xarray
Parameters
Section titled “Parameters”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.
download_raster
Section titled “download_raster”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) -> NoneQuery a workflow and save the raster result as a file on disk
Parameters
Section titled “Parameters”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.
get_provenance
Section titled “get_provenance”def get_provenance(timeout: int = 60) -> list[ProvenanceEntry]Query the provenance of the workflow
metadata_zip
Section titled “metadata_zip”def metadata_zip(path: PathLike | BytesIO, timeout: int = 60) -> NoneQuery workflow metadata and citations and stores it as zip file to path
save_as_dataset
Section titled “save_as_dataset”def save_as_dataset(query_rectangle: QueryRectangle, name: None | str, display_name: str, description: str = "", timeout: int = 3600) -> TaskInit task to store the workflow result as a layer
raster_stream
Section titled “raster_stream”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)
raster_stream_into_xarray
Section titled “raster_stream_into_xarray”async def raster_stream_into_xarray(query_rectangle: RasterQueryRectangle, clip_to_query_rectangle: bool = False, open_timeout: int = 60) -> xr.DataArrayStream the workflow result into memory and output a single xarray.
NOTE: You can run out of memory if the query rectangle is too large.
vector_stream
Section titled “vector_stream”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
vector_stream_into_geopandas
Section titled “vector_stream_into_geopandas”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.GeoDataFrameStream 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.
register_workflow
Section titled “register_workflow”def register_workflow(workflow: dict[str, Any] | WorkflowBuilderOperator, timeout: int = 60) -> WorkflowRegister a workflow in Geo Engine and receive a WorkflowId
workflow_by_id
Section titled “workflow_by_id”def workflow_by_id(workflow_id: UUID | str) -> WorkflowCreate a workflow object from a workflow id
get_quota
Section titled “get_quota”def get_quota(user_id: UUID | None = None, timeout: int = 60) -> geoc.QuotaGets a user’s quota. Only admins can get other users’ quota.
update_quota
Section titled “update_quota”def update_quota(user_id: UUID, new_available_quota: int, timeout: int = 60) -> NoneUpdate a user’s quota. Only admins can perform this operation.
data_usage
Section titled “data_usage”def data_usage(offset: int = 0, limit: int = 10) -> list[geoc.DataUsage]Get data usage
data_usage_summary
Section titled “data_usage_summary”def data_usage_summary(granularity: geoc.UsageSummaryGranularity, dataset: str | None = None, offset: int = 0, limit: int = 10) -> pd.DataFrameGet data usage summary