Spaces:
Paused
Paused
Download python/spatial_toolkit_py/workflows.py from abhirsc/spatial-toolkit-r: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/spaces/abhirsc/spatial-toolkit-r/resolve/main/python/spatial_toolkit_py/workflows.py
- Command line
-
hf download hf://spaces/abhirsc/spatial-toolkit-r/python/spatial_toolkit_py/workflows.py
-
curl -L -o workflows.py https://huggingface.co/spaces/abhirsc/spatial-toolkit-r/resolve/main/python/spatial_toolkit_py/workflows.py
697 Bytes
| from .inspection import get_spatial_metadata, raster_quality_report | |
| def get_workflow_catalog() -> dict: | |
| return { | |
| "raster_qc": { | |
| "name": "Raster quality control", | |
| "description": "Inspect CRS, extent, resolution, bands, and values.", | |
| "steps": ["metadata", "quality_report"], | |
| } | |
| } | |
| def run_named_workflow(workflow_name: str, raster: str) -> dict: | |
| catalog = get_workflow_catalog() | |
| if workflow_name not in catalog: | |
| raise ValueError(f"Unknown workflow: {workflow_name}") | |
| return { | |
| "metadata": get_spatial_metadata(raster), | |
| "quality_report": raster_quality_report(raster).to_dict(orient="records"), | |
| } | |