processing_graph
A processing graph representation and methods on processing graphs
ProcessingGraphId Objects
Section titled “ProcessingGraphId Objects”class ProcessingGraphId()A wrapper around a processing graph UUID
__init__
Section titled “__init__”def __init__(processing_graph_id: UUID | str) -> NoneCreate a new ProcessingGraphId from an UUID or uuid as str
from_response
Section titled “from_response”@classmethoddef from_response(cls, response: geoc.IdResponse) -> ProcessingGraphIdCreate a ProcessingGraphId 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
ProcessingGraph Objects
Section titled “ProcessingGraph Objects”class ProcessingGraph()Holds a processing graph id and allows querying data
get_result_descriptor
Section titled “get_result_descriptor”def get_result_descriptor() -> ResultDescriptorReturn the metadata of the processing graph result
definition
Section titled “definition”def definition(timeout: int = 60) -> geoc.ProcessingGraphReturn the definition of this processing graph
workflow_definition
Section titled “workflow_definition”@deprecated("Use `ProcessingGraph.definition` instead.", category=DeprecationWarning)def workflow_definition(timeout: int = 60) -> geoc.ProcessingGraphDeprecated: use ProcessingGraph.definition instead.
get_dataframe
Section titled “get_dataframe”def get_dataframe(bbox: QueryRectangle, timeout: int = 3600, resolve_classifications: bool = False) -> gpd.GeoDataFrameQuery 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')
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 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.
plot_chart
Section titled “plot_chart”def plot_chart(bbox: QueryRectangle, spatial_resolution: SpatialResolution | None = None, timeout: int = 3600) -> VegaLiteQuery a processing graph 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 processing graph 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 processing graph 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 processing graph 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 processing graph
metadata_zip
Section titled “metadata_zip”def metadata_zip(path: PathLike | BytesIO, timeout: int = 60) -> NoneQuery processing graph 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 processing graph 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 processing graph 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 processing graph 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 processing graph 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 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.
register_processing_graph
Section titled “register_processing_graph”def register_processing_graph(processing_graph: dict[str, Any] | ProcessingGraphBuilderOperator, timeout: int = 60) -> ProcessingGraphRegister a processing graph in Geo Engine and receive a ProcessingGraph
processing_graph_by_id
Section titled “processing_graph_by_id”def processing_graph_by_id(processing_graph_id: UUID | str) -> ProcessingGraphCreate a processing graph object from a processing graph id
register_workflow
Section titled “register_workflow”@deprecated("Use `register_processing_graph` instead.", category=DeprecationWarning)def register_workflow(workflow: dict[str, Any] | ProcessingGraphBuilderOperator, timeout: int = 60) -> ProcessingGraphDeprecated: use register_processing_graph instead.
workflow_by_id
Section titled “workflow_by_id”@deprecated("Use `processing_graph_by_id` instead.", category=DeprecationWarning)def workflow_by_id(workflow_id: UUID | str) -> ProcessingGraphDeprecated: use processing_graph_by_id instead.
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
data_usage_for_computation
Section titled “data_usage_for_computation”def data_usage_for_computation(computation_id: UUID) -> intGet data usage for a specific computation