TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/OdintheDoggo/GodotNWS/llms.txt
Use this file to discover all available pages before exploring further.
Nws singleton provides seven imagery and broadcast methods that return visual weather products and text data from NWS sources. Some methods return raw PackedByteArray GIF data (requiring a GIF-rendering addon to display), while others decode PNG images directly into ImageTexture resources ready to use in Godot. All methods require location_setup_complete to have fired before calling.
Radar
fetch_radar_gif(velocity: bool)
Fetches an animated radar GIF for the radar station nearest to the configured location from radar.weather.gov. The result is a raw byte buffer, not a decoded texture.
When
false, fetches the base reflectivity loop, which shows precipitation intensity. When true, fetches the base velocity loop, which shows wind motion toward or away from the radar.Signal: radar_fetched(image_buffer)
The raw bytes of the animated radar GIF. Pass this to a GIF-rendering addon to display the animation. It cannot be loaded directly into Godot’s built-in
Image or ImageTexture classes.Godot 4 does not support GIF decoding natively. To render the radar animation in your project, use a GIF-rendering addon from the Godot Asset Library.
Code Example
Forecast Chart
fetch_forecast_chart(index: int)
Fetches one of the Weather Prediction Center (WPC) forecast surface analysis charts as an animated GIF. Three chart periods are available.
Chart period selector. Valid values are
1, 2, or 3, corresponding to the three WPC NOAA forecast chart timeframes available at wpc.ncep.noaa.gov.Signal: chart_fetched(image_buffer)
The raw bytes of the forecast chart GIF. As with radar data, pass this to a GIF-rendering addon rather than attempting to load it as a PNG or JPEG.
Like
fetch_radar_gif, the result is a raw GIF byte buffer and requires a GIF-rendering addon to display.Code Example
Graphicast
fetch_graphicast(index: int)
Fetches a local NWS office graphicast image — a graphical weather summary produced by the local forecast office — and returns it as a decoded ImageTexture. The signal also returns the requested index and the HTTP Last-Modified header so you can detect updates.
The integer index of the graphicast image to fetch. The number of available images varies by NWS office; increment the index until requests begin failing.
Signal: graphicast_fetched(image, index, last_modified)
The graphicast PNG decoded into a ready-to-use
ImageTexture.The index value that was passed to
fetch_graphicast(). Useful when dispatching multiple concurrent requests to match each response to its original call.The value of the HTTP
Last-Modified response header, with the "Last-Modified: " prefix stripped. Use this to detect when images have been updated since your last fetch.Graphicast images are produced by the local NWS forecast office and reflect regional weather summaries. Not all offices produce the same number of graphicasts.
Code Example
Weather Stories
fetch_weather_stories()
Fetches active weather stories from the local NWS forecast office. Weather stories are narrative summaries paired with illustrative images, used by NWS offices to highlight significant weather events. Takes no parameters.
Signal: weather_stories_fetched(stories: Array[WeatherStory])
An array of
WeatherStory resources. Each story includes its image, metadata, and display priority. Fields on each resource:Code Example
Radio Broadcast
fetch_radio_broadcast()
Fetches the NWS radio broadcast text for the configured location, parses the XML into individual forecast paragraphs, and emits them as an array of strings. Takes no parameters.
Signal: radio_broadcast_fetched(Paragraphs: Array[String])
An array of strings, one per forecast paragraph. Each string represents a discrete forecast segment as it would be read on NWS Weather Radio, beginning with a period label such as
"Tonight:" or "Wednesday:".Code Example
US Warning Map
fetch_us_warning_map()
Fetches the national active warning map from weather.gov as a PNG and decodes it into an ImageTexture. The map shows all currently active watches, warnings, and advisories across the contiguous United States. Takes no parameters.
Signal: us_map_fetched(image)
The national warning map decoded as a ready-to-use
ImageTexture.Code Example
Drought Monitor
fetch_drought_monitor()
Fetches the current US Drought Monitor map from droughtmonitor.unl.edu as a PNG and decodes it into an ImageTexture. Takes no parameters.
Signal: drought_fetched(image)
The current drought monitor map decoded as a ready-to-use
ImageTexture.