Document current outlook schema behavior
This commit is contained in:
@@ -37,7 +37,7 @@ Canonical schemas emitted after normalization:
|
||||
| `forecast_discussion` | `weather.forecast_discussion.v1` | `WeatherForecastDiscussion` |
|
||||
| `weather_story` | `weather.weather_story.v1` | `WeatherStoryRun` |
|
||||
| `alert` | `weather.alert.v1` | `WeatherAlertRun` |
|
||||
| `outlook` | `weather.outlook.v1` | `WeatherOutlookRun` |
|
||||
| `outlook` | `weather.outlook.v2` | `WeatherOutlookRun` |
|
||||
|
||||
Raw upstream schemas emitted by current sources:
|
||||
|
||||
@@ -220,13 +220,15 @@ Payload type: `WeatherAlertRun`.
|
||||
`references[]` entries contain optional `id`, `identifier`, `sender`, and
|
||||
`sent` fields.
|
||||
|
||||
## `weather.outlook.v1`
|
||||
## `weather.outlook.v2`
|
||||
|
||||
Payload type: `WeatherOutlookRun`.
|
||||
|
||||
The current producer is the SPC convective outlook normalizer. It emits Day 1-3
|
||||
convective outlook polygons for categorical, tornado, hail, and wind products.
|
||||
All timestamps are UTC.
|
||||
convective outlook snapshots for categorical, tornado, hail, and wind products
|
||||
that apply to the configured forecast point. Raw SPC bundles remain complete;
|
||||
canonical outlook payloads are filtered to local polygons. All timestamps are
|
||||
UTC.
|
||||
|
||||
| Field | Type | Required | Notes |
|
||||
|---|---|:---:|---|
|
||||
@@ -236,7 +238,8 @@ All timestamps are UTC.
|
||||
| `longitude` | number | no | Configured point longitude in decimal degrees. |
|
||||
| `asOf` | timestamp | yes | Snapshot time. For SPC, this is the latest outlook issue time when available. |
|
||||
| `issuedAt` | timestamp | no | Latest issue time across outlook features when any feature exists. |
|
||||
| `outlooks` | array | yes | Ordered outlook polygons. |
|
||||
| `outlooks` | array | yes | Ordered outlook polygons containing the configured point. |
|
||||
| `discussions` | array | yes | Run-level day discussions for retained outlook days. |
|
||||
|
||||
`outlooks[]` entries:
|
||||
|
||||
@@ -255,19 +258,53 @@ All timestamps are UTC.
|
||||
| `issuedAt` | timestamp | yes | Feature issue time. |
|
||||
| `expiresAt` | timestamp | yes | Expiration time; currently equal to `validTo`. |
|
||||
| `forecaster` | string | no | SPC forecaster text, when present. |
|
||||
| `headline` | string | no | Matching Day 1-3 print-page product title. |
|
||||
| `summary` | string | no | Text from the print-page `...SUMMARY...` section. |
|
||||
| `discussion` | string | no | Cleaned full print-page product text. |
|
||||
| `sourceUrl` | string | no | GeoJSON product URL for this outlook feature. |
|
||||
| `imageUrl` | string | no | Reserved for provider image URLs; currently empty. |
|
||||
| `containsLocation` | boolean | yes | Whether the configured point is inside or on the boundary of the polygon. |
|
||||
| `containsLocation` | boolean | yes | Always `true` for emitted v2 outlooks. |
|
||||
| `geometry` | object | yes | Compact GeoJSON `Polygon` or `MultiPolygon` geometry. |
|
||||
|
||||
`geometry` preserves the SPC feature geometry as compact GeoJSON using
|
||||
`[longitude, latitude]` coordinate order. `containsLocation` is computed with
|
||||
that geometry and the configured source `latitude`/`longitude`; boundary points
|
||||
count as contained. All outlook polygons are emitted, including polygons that do
|
||||
not contain the configured point.
|
||||
count as contained. Polygons that do not contain the configured point are not
|
||||
included in canonical v2 payloads.
|
||||
|
||||
`discussions[]` entries:
|
||||
|
||||
| Field | Type | Required | Notes |
|
||||
|---|---|:---:|---|
|
||||
| `day` | integer | yes | SPC outlook day, currently `1`, `2`, or `3`. |
|
||||
| `headline` | string | no | Matching Day 1-3 print-page product title. |
|
||||
| `summary` | string | no | Text from the print-page `...SUMMARY...` section. |
|
||||
| `discussion` | string | no | Cleaned full print-page product text. |
|
||||
| `updatedAt` | timestamp | no | Print-page update time, when present. |
|
||||
|
||||
When no SPC polygons apply locally, the run is still emitted with `outlooks: []`
|
||||
and `discussions: []`. Discussions are included only for days represented by at
|
||||
least one retained outlook, and multiple retained outlook types for the same day
|
||||
share one discussion entry.
|
||||
|
||||
### SPC Outlook Supersession
|
||||
|
||||
Consumers should prefer latest-run semantics for current conditions: read the
|
||||
latest `WeatherOutlookRun` for the configured location and use its `outlooks`
|
||||
and `discussions` arrays together.
|
||||
|
||||
Historical SQL consumers that collapse older rows should identify superseded
|
||||
outlooks by `provider`, `product`, `outlookType`, `validFrom`, and `validTo`,
|
||||
then keep rows with the greatest `issuedAt`. `day` and `label` are not identity
|
||||
fields. When multiple retained polygons share that latest `issuedAt`, preserve
|
||||
the full group.
|
||||
|
||||
## Legacy `weather.outlook.v1`
|
||||
|
||||
`weather.outlook.v1` is a historical canonical schema retained as a standards
|
||||
constant for older data and consumers. Current SPC normalization emits
|
||||
`weather.outlook.v2`.
|
||||
|
||||
The v1 payload used `WeatherOutlookRun` and placed `headline`, `summary`, and
|
||||
`discussion` on each `outlooks[]` polygon. It also represented the pre-v2 SPC
|
||||
canonical behavior, where national polygons were preserved in canonical output.
|
||||
|
||||
## Compact Example
|
||||
|
||||
|
||||
Reference in New Issue
Block a user