Skip to content

Add weather extension for GRIB2 and NOAA GFS#1108

Open
onnimonni wants to merge 3 commits intoduckdb:mainfrom
onnimonni:add-weather-extension
Open

Add weather extension for GRIB2 and NOAA GFS#1108
onnimonni wants to merge 3 commits intoduckdb:mainfrom
onnimonni:add-weather-extension

Conversation

@onnimonni
Copy link
Contributor

New Extension: weather

Read GRIB2 weather data and query NOAA GFS forecasts directly from DuckDB.

Features

  • read_grib(path) - Read GRIB2 files from local paths or HTTP URLs
  • noaa_gfs_forecast_api() - Query NOAA GFS forecasts with SQL WHERE filter pushdown
  • Weather macros - Temperature, wind, pressure, humidity conversions and descriptions
  • H3 integration - Works with DuckDB H3 extension for spatial indexing

Repository

https://github.com/onnimonni/duckdb-weather

Requirements

  • Rust toolchain (for GRIB2 parsing)
  • Excluded platforms: windows_amd64_mingw, wasm_*

Data Sources

  • NOAA GFS: Global, 0.25° resolution, 4x daily, 16-day forecast
  • License: Public Domain (NOAA data), MIT (extension)

Example

-- Query NOAA GFS forecast
SELECT variable, level, round(kelvin_to_celsius(AVG(value)), 1) as temp_c
FROM noaa_gfs_forecast_api()
WHERE run_date = current_date
  AND forecast_hour = 24
  AND variable = 'temperature'
  AND level = '2m'
  AND latitude BETWEEN 61 AND 62
  AND longitude BETWEEN 23 AND 24
GROUP BY variable, level;

@carlopi
Copy link
Collaborator

carlopi commented Jan 28, 2026

Hey, thanks for the contribution, I am not exactly sure what's off with the build time error, but one way to side step that is skipping the linux_amd64_musl build.

Could you also possibly open an issue regarding the issue? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants