Skip to main content
Loading navigation
Back to prompt library

Build a STAC Agricultural Drought Vegetative Loss Assessor — implementation

Linked challenge: Build a STAC Agricultural Drought Vegetative Loss Assessor

Prompt source

implementation74 lines11 sectionsNo variables1 code block
## Build
Quantify vegetation stress over commercial crop fields using multi-temporal STAC Catalog items. Compute vegetation anomaly percentiles across the growing season to assist in agricultural claim evidence preparation.

## User
Agricultural Claims Investigator

## Workflow
1. Ingest field parcel boundaries and historical normal NDVI reference curves.
2. Query STAC API for Sentinel-2 cloud-free Item collections over the target growing cycle.
3. Calculate parcel-level average NDVI and compute seasonal biomass deficit percentages.
4. Assemble an objective crop loss claim evidence report with direct STAC asset links.

## Interface
Web interface displaying parcel NDVI time-series charts alongside thumbnails retrieved from STAC assets.

## Data
Access public STAC APIs for Sentinel-2 COGs (e.g., Earth Search) or load local mock STAC collection directories.
Starter examples below are synthetic. They are not downloaded records.

## Source
[STAC specification](https://raw.githubusercontent.com/radiantearth/stac-spec/master/README.md)
Interrogates STAC Item collections, bounding boxes, and asset links for multispectral bands as specified in STAC standard.

## Tools
anthropic-claude, pystac-client, rasterio.
Claude analyzes complex multi-temporal vegetation anomaly trends and synthesizes objective, structured claim evidence memos.
Hosted Claude API for expert-level interpretation and structured summarization of seasonal crop vigor curves.

## 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
- Queries STAC Items matching parcel geometry and seasonal date range.
- Calculates mean NDVI deficit compared to baseline expected reference value.
- Formats output containing all parent STAC Collection IDs and asset hrefs.

## Starter Examples
```json
[
  {
    "input": {
      "_record_type": "simplified synthetic app record",
      "parcel_id": "PARCEL-KS-771",
      "crop_type": "Winter Wheat",
      "baseline_ndvi": 0.72,
      "stac_observations": [
        {
          "item_id": "S2A_20230501",
          "mean_ndvi": 0.45
        },
        {
          "item_id": "S2A_20230515",
          "mean_ndvi": 0.42
        }
      ]
    },
    "expected_output": {
      "parcel_id": "PARCEL-KS-771",
      "mean_observed_ndvi": 0.435,
      "deficit_percentage": 39.58,
      "loss_evidence_grade": "SUBSTANTIAL_ANOMALY"
    }
  },
  {
    "input": {
      "_record_type": "simplified synthetic app record",
      "parcel_id": "PARCEL-KS-772",
      "crop_type": "Winter Wheat",
      "baseline_ndvi": 0.7,
      "stac_observations": []
    },
    "expected_output": {
      "parcel_id": "PARCEL-KS-772",
      "mean_observed_ndvi": null,
      "deficit_percentage": null,
      "loss_evidence_grade": "NO_OBSERVATIONS"
    }
  }
]
```

## Safety
Vegetative deficit reports are evidence preparation materials and do not constitute formal adjuster appraisal or claim settlement.
Use mock external writes. Require human review before any real deployment.