Skip to main content
Loading navigation
Back to prompt library

Build a Wildfire Defensible Space STAC Asset Verifier — implementation

Linked challenge: Build a Wildfire Defensible Space STAC Asset Verifier

Prompt source

implementation134 lines11 sectionsNo variables1 code block
## Build
Inspect commercial real estate parcels against high-resolution STAC Item metadata and visual assets. Identify vegetation encroachment within defensible perimeter zones to formulate property adaptation plans.

## User
Wildfire Hazard Specialist

## Workflow
1. Load facility boundary GeoJSON and buffer zones at 30 and 100 feet.
2. Query a STAC catalog endpoint for post-dry-season multispectral imagery items.
3. Extract asset URLs and compute vegetative fuel cover within buffer zones.
4. Assemble a defensible space compliance report with prioritized mitigation tasks.

## Interface
Web dashboard showing parcel aerial views overlaid with STAC bounding boxes and calculated buffer vegetation scores.

## Data
Query public Earth search STAC API (e.g., AWS Earth STAC) for Sentinel-2 or NAIP items, or load mock STAC Item JSON fixtures.
Starter examples below are synthetic. They are not downloaded records.

## Source
[STAC specification](https://raw.githubusercontent.com/radiantearth/stac-spec/master/README.md)
Parses STAC Item specifications including properties, assets, and bbox geometry structures defined in the STAC core schema.

## Tools
pydantic-ai, shapely, rasterio.
Pydantic AI enforces type-safe parsing of STAC Item JSON structures and validates structured compliance outputs.
Fast hosted model or local Ollama instance capable of schema-constrained JSON extraction.

## 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
- Accurately constructs 30ft and 100ft buffer geometries around asset footprints.
- Filters STAC Items by bounding box intersection and acquisition date.
- Generates structured hazard ratings conforming to predefined fuel proximity categories.

## Starter Examples
```json
[
  {
    "input": {
      "_record_type": "simplified synthetic app record",
      "facility_id": "FAC-CA-889",
      "footprint": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              0,
              0
            ],
            [
              0,
              10
            ],
            [
              10,
              10
            ],
            [
              10,
              0
            ],
            [
              0,
              0
            ]
          ]
        ]
      },
      "stac_item": {
        "id": "NAIP-2022-CA-01",
        "type": "Feature",
        "bbox": [
          -1,
          -1,
          11,
          11
        ],
        "properties": {
          "datetime": "2022-08-15T00:00:00Z"
        },
        "assets": {
          "visual": {
            "href": "https://example.com/item.tif"
          }
        }
      },
      "canopy_cover_30ft": 0.45
    },
    "expected_output": {
      "facility_id": "FAC-CA-889",
      "defensible_space_compliant": false,
      "risk_tier": "HIGH_ENCROACHMENT",
      "recommended_action": "Clear canopy within 30ft zone"
    }
  },
  {
    "input": {
      "_record_type": "simplified synthetic app record",
      "facility_id": "FAC-CA-890",
      "footprint": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              0,
              0
            ],
            [
              0,
              10
            ],
            [
              10,
              10
            ],
            [
              10,
              0
            ],
            [
              0,
              0
            ]
          ]
        ]
      },
      "stac_item": null,
      "canopy_cover_30ft": 0.05
    },
    "expected_output": {
      "facility_id": "FAC-CA-890",
      "defensible_space_compliant": true,
      "risk_tier": "DATA_DEFICIENT_LOW_CANOPY",
      "recommended_action": "Verify imagery availability"
    }
  }
]
```

## Safety
Outputs are non-binding adaptation guidelines; users must verify physical clearance with local municipal fire marshals.
Use mock external writes. Require human review before any real deployment.