Back to prompt library
Build a Coastal Flood Declaration and DEM Link Correlator — implementation
Linked challenge: Build a Coastal Flood Declaration and DEM Link Correlator
Prompt source
implementation63 lines11 sectionsNo variables1 code block
## Build
Correlate historical OpenFEMA coastal disaster declarations with STAC metadata referencing digital elevation models. Compile asset administrative histories and retrieve elevation metadata links to support subsequent manual engineering reviews.
## User
Coastal Risk Analyst
## Workflow
1. Query OpenFEMA API for historical county-level coastal storm disaster declarations.
2. Retrieve corresponding STAC Items referencing coastal elevation datasets for impacted counties.
3. Extract valid elevation asset URLs from STAC metadata intersecting the asset location bounding box.
4. Generate a coastal administrative history table and data compilation report for engineering review.
## Interface
Web table view displaying coastal assets, county disaster declaration counts, and DEM STAC reference links.
## Data
Query OpenFEMA v2/DisasterDeclarationsSummaries filtering by coastal state/county, and fetch DEM STAC Item metadata from mock SpatioTemporal Asset Catalog files.
Starter examples below are synthetic. They are not downloaded records.
## Source
[FEMA OpenFEMA](https://www.fema.gov/about/openfema/api)
Applies OpenFEMA $select, $filter, and $orderby parameters to isolate coastal storm declarations by county.
## Tools
dspy, requests, pystac, fastapi.
DSPy compiles robust prompt pipelines to extract accurate metadata links and map disaster summaries to asset locations.
Hosted or local model supporting DSPy signature compilation for text and JSON metadata 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
- Fetches disaster declarations filtering by coastal storm incident types and specified counties.
- Extracts valid asset URLs from STAC metadata intersecting the requested asset bounding box.
- Flags compiled records for manual engineering assessment based on non-zero declaration counts.
## Starter Examples
```json
[
{
"input": {
"asset_id": "PORT-DOCK-12",
"county": "CoastalCounty",
"fema_incident_type": "Coastal Storm"
},
"expected_output": {
"asset_id": "PORT-DOCK-12",
"county_declarations": 1,
"dem_stac_href": "https://example.com/dem/12.tif",
"requires_engineering_review": true,
"_record_type": "Simplified synthetic app record, not a complete official schema file"
}
},
{
"input": {
"asset_id": "PORT-WHARF-03",
"county": "InlandCounty",
"fema_incident_type": "Coastal Storm"
},
"expected_output": {
"asset_id": "PORT-WHARF-03",
"county_declarations": 0,
"dem_stac_href": null,
"requires_engineering_review": false,
"_record_type": "Simplified synthetic app record, not a complete official schema file"
}
}
]
```
## Safety
Analysis serves planning studies only; external actions and engineering assessments remain mock or human-reviewed.
Use mock external writes. Require human review before any real deployment.