Guide
Most NWS alerts have no geometry. Here’s how to draw them anyway.
Resolving affectedZones, and the four traps between you and a map.
If you have ever fetched api.weather.gov/alerts/active, tried to
draw the polygons, and ended up with a nearly empty map, this is why.
We measured the live feed while writing this:
ACTIVE NWS ALERTS: 331
with geometry : 44 (13.3%)
geometry is NULL : 287 (86.7%)
Eighty-seven percent of active alerts carry "geometry": null.
Not a bug, not an outage — that is the normal state of the feed.
Why most alerts have no polygon
The National Weather Service issues alerts two different ways.
Storm-based warnings — tornado, severe thunderstorm,
flash flood — are drawn as a polygon around the actual threat. Those
arrive with geometry. In the sample above, all 44 were Polygon.
Zone-based products — advisories, watches, marine warnings — are issued against pre-defined administrative areas: counties, forecast zones, marine zones. The alert does not carry a shape because the shape already exists somewhere else. It carries references.
{
"geometry": null,
"properties": {
"event": "Small Craft Advisory",
"affectedZones": [
"https://api.weather.gov/zones/forecast/LCZ460",
"https://api.weather.gov/zones/forecast/LEZ444"
]
}
}
Which way the ratio falls depends on the weather. A severe-weather outbreak produces hundreds of storm-based polygons. A quiet day is mostly marine advisories — in our sample, 198 of the 287 null-geometry alerts were Small Craft Advisories and 41 were Gale Warnings. On an ordinary day, the zone path is the common path.
So if your map only draws alerts that already have geometry, it works during tornado season and looks broken the rest of the year.
The fix, and then the four traps
The fix is conceptually simple: for every alert with
geometry: null, fetch each URL in affectedZones,
take the geometry from each, and merge.
In that sample this meant resolving 334 distinct zone URLs for 287 alerts — a mean of 1.6 zones per alert, with one alert referencing 28.
That is the easy part. Here is what actually costs you time.
Trap 1: one zone in 334 is a GeometryCollection
We resolved all 334 zones and counted the types:
Polygon 265
MultiPolygon 68
GeometryCollection 1 <- FLZ115
One zone. 0.3% of the sample. If you wrote
if geom["type"] == "Polygon" … elif "MultiPolygon", that
one falls through whatever else you wrote, and the alert
silently disappears from your map.
0.3% is the worst possible frequency for a defect. It is far too rare to appear in a test fixture, and it is guaranteed to arrive eventually.
Flatten it before anything else touches it:
if geom["type"] == "GeometryCollection":
return merge([normalise(g) for g in geom["geometries"]])
This one cost real time, in a way worth describing exactly, because the caching made it much worse — which is the next trap.
Trap 2: cache the zones, but validate what comes back out
Zone boundaries change on the order of years. Refetching 334 of them per request is absurd, so you cache.
We cached them. Then we shipped the GeometryCollection bug
above, which wrote unusable entries into the cache for the affected zones.
Fixing the flattening code did not fix the map — the
bad entries were already stored, and they were served forever after. The
alerts stayed missing until the cache was cleared by hand.
The lesson is narrow and worth stating: validate the shape on read, not just on write.
cached = load(zone_url)
# Not "is something cached" - "is the cached thing drawable".
# A bad entry written by an older version of this code is
# otherwise served forever.
if cached and cached.get("type") in ("Polygon", "MultiPolygon"):
return cached
return refetch(zone_url)
A cache that can only be corrected by hand is a cache that will be wrong for longer than you think.
Trap 3: the payload is enormous, and it is not the detail
Zone geometry is detailed. Across those 334 zones we counted 3,555 rings, averaging 11 per zone, with one zone carrying 164.
The obvious response is to simplify — run Douglas–Peucker and coarsen the tolerance until it fits. That barely moves the number.
The cost is not detail per ring. It is ring count. Coarsening from 0.01° to 0.05° changed the payload very little, because no tolerance can shrink a ring below a closing quadrilateral. A marine zone is a MultiPolygon of every island and rock inside it — thousands of rings that each simplify down to four points and then stop.
What actually worked was dropping rings whose bounding extent is below a threshold. Measured over one national response: 6,089 polygons across 318 alerts, averaging 36 points each, reduced to 1,591 by dropping rings under 0.01°.
# Drop rings too small to be worth drawing,
# THEN simplify what is left.
big = [p for p in polygons if extent(p[0]) >= MIN_RING_DEG]
If you are simplifying geometry and seeing disappointing results, count your rings before you touch your tolerance.
Trap 4: your CDN is probably not compressing it
GeoJSON’s correct content type is application/geo+json.
CloudFront’s automatic compression only applies to content types on its
own list, and application/geo+json is not on it.
So the response ships uncompressed while every header looks right.
plain : 2,463,427 bytes (2.34 MB)
gzip : 702,289 bytes (0.66 MB)
ratio : 3.5x
2.34 MB over a phone connection, silently, because of a content type.
You have two options. Relabel it application/json and get edge
compression back at the cost of correctness, or compress in the origin and
keep both. We compress in the origin, honour Accept-Encoding so
a client that cannot decompress still gets plain JSON, and make sure the
cache policy includes Accept-Encoding in the key so the two
variants do not overwrite each other.
What dropping rings costs, stated plainly
An island smaller than roughly a kilometre inside an alert area stops being drawn. That is a few pixels at any zoom where somebody reads a marine advisory.
The part that makes this acceptable for a safety-adjacent layer: the point-query path is unaffected. Asking “is there a warning where I am” goes to NWS to ask which zones contain the point, and never consults the simplified polygons at all. Only the visual overview loses sub-kilometre islands. The answer to the question a person actually asks stays exact.
If you simplify alert geometry, keep that separation. Simplify what you draw; never simplify what you answer with.
Summary
- ~87% of active alerts have
geometry: null— this is normal, not an error - Resolve
properties.affectedZones, one request per zone, and cache them - Handle
GeometryCollection— about 1 zone in 334, too rare to test into, fatal when it lands - Validate cached shapes on read, or one bad write outlives the fix
- Count rings before tuning tolerance — ring count dominates, not detail
- Check that your CDN compresses
application/geo+json— it probably does not
All figures measured against api.weather.gov and a deployed
endpoint on 4 November 2026. The ratios shift with the weather; the traps do
not.
We run this in production. Splitshot Weather serves NWS alerts as pre-resolved GeoJSON alongside radar, rainfall, lightning, wind and temperature tiles — see the alerts endpoint or the full API docs. NWS data is in the public domain and you are welcome to do all of this yourself; the code above is the shape of what you will need.