Back to prompt library
Build a STAC Agricultural Frost Parametric Verifier — implementation
Linked challenge: Build a STAC Agricultural Frost Parametric Verifier
Prompt source
implementation67 lines11 sectionsNo variables1 code block
## Build
Correlate post-freeze multispectral satellite imagery discovered via STAC catalogs against local cold snap declarations. Fetch assets to validate parametric agricultural crop damage criteria while accounting for cloud-obscured pixel uncertainty.
## User
Crop Insurance Verification Specialist
## Workflow
1. Query STAC collections for post-freeze Sentinel-2 and Landsat surface reflectance scenes.
2. Filter STAC items by cloud cover metadata and download assets to compute vegetation stress indices.
3. Cross-reference spatial crop anomaly boundaries with agricultural parcel registers using geographic tools.
4. Generate a verified parametric frost loss assessment with observation confidence bounds based on cloud interference.
## Interface
Dual-pane dashboard showing downloaded optical imagery, masked cloud layers, and parametric trigger verification matrices.
## Data
Query public Earth observation STAC APIs (such as Earth Search) for imagery URLs. Store sample parcel boundaries in local GeoJSON files.
Starter examples below are synthetic. They are not downloaded records.
## Source
[STAC specification](https://raw.githubusercontent.com/radiantearth/stac-spec/master/README.md)
Queries STAC API to locate relevant Items, inspects cloud cover properties, and utilizes asset links to retrieve raw imagery for analysis.
## Tools
langgraph, pystac-client, rasterio, geopandas.
Orchestrates multi-step spatial querying, downloading, and LLM-based verification pipelines using stateful graph workflows.
Requires an LLM capable of generating geospatial processing code and interpreting formatted parametric claim data.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Parses STAC Item asset links and successfully downloads raster imagery for the specified timeframe.
- Calculates vegetation stress indices from the downloaded imagery to identify crop anomalies against baseline data.
- Identifies and discounts cloud-contaminated pixels to compute and report explicit uncertainty percentages.
## Starter Examples
```json
[
{
"input": {
"parcel_id": "ORCHARD-CITRUS-09",
"stac_item": "S2A_L2A_20230115",
"cloud_cover_pct": 4.2,
"ndvi_anomaly": -0.38,
"freeze_duration_hours": 7.5
},
"expected_output": {
"parcel_id": "ORCHARD-CITRUS-09",
"frost_impact_confirmed": true,
"parametric_threshold_status": "TRIGGERED",
"pixel_confidence_pct": 95.8,
"claim_evidence_status": "VERIFIED"
}
},
{
"input": {
"parcel_id": "ORCHARD-CITRUS-10",
"stac_item": "S2A_L2A_20230116",
"cloud_cover_pct": 48,
"ndvi_anomaly": -0.12,
"freeze_duration_hours": 2
},
"expected_output": {
"parcel_id": "ORCHARD-CITRUS-10",
"frost_impact_confirmed": false,
"parametric_threshold_status": "UNRESOLVED_CLOUD_INTERFERENCE",
"pixel_confidence_pct": 52,
"claim_evidence_status": "FLAGGED_FOR_MANUAL_SURVEY"
}
}
]
```
## Safety
Supplies advisory crop health verification metrics; does not execute direct insurance claim disbursements.
Use mock external writes. Require human review before any real deployment.