| Crates.io | rust-grib-decoder |
| lib.rs | rust-grib-decoder |
| version | 0.1.1 |
| created_at | 2025-12-30 09:18:41.298334+00 |
| updated_at | 2025-12-30 09:42:26.781265+00 |
| description | Utilities to decode GRIB2 CCSDS/AEC (template 5.0=42) payloads and extract Section 7 payloads per message. |
| homepage | https://crates.io/crates/rust-grib-decoder |
| repository | https://github.com/hkwk/rust-grib-decoder |
| max_upload_size | |
| id | 2012338 |
| size | 108,519 |
Utilities to decode GRIB2 CCSDS/AEC (template 5.0=42) payloads and to extract Section 7 payloads on a per-message basis.
This crate provides a small, focused set of helpers useful for tooling and CLI utilities:
read_grib2_section7_payloads_by_message(path: &Path) -> Result<Vec<Vec<u8>>, String>read_first_grib2_section7_payload(path: &Path) -> Result<Vec<u8>, String>read_grib2_section5_template42_params_by_message(path: &Path) -> Result<Vec<Option<Template42Params>>, String>decode_template42_rust_from_params_with_payload(...) (pure-Rust rust-aec decoder)probe_all_fields_at_lat_lon(path, lat, lon) — convenience probe helpersummarize_file(path) -> FileSummary and find_candidates_for_param(path, param) — CLI diagnostics helpersAdd to your Cargo.toml (crates.io):
rust-grib-decoder = "0.1"
For local/workspace development use the path override:
# Local development
# rust-grib-decoder = { path = "crates/rust-grib-decoder", default-features = true }
use std::path::Path;
use rust_grib_decoder::{read_first_grib2_latlon_grid, decode_template42_first_message};
let path = Path::new("data.grib2");
let grid = read_first_grib2_latlon_grid(path)?;
if let Ok(Some(values)) = decode_template42_first_message(path, grid.ni, grid.nj) {
println!("Decoded {} samples ({}x{})", values.len(), grid.ni, grid.nj);
}
Before publishing, ensure repository and authors in Cargo.toml are set and a LICENSE file is present.
(See examples/ for runnable examples. This crate includes an extract_param example that shows how to summarize a file, find candidate messages for a parameter like msl or 2t, and decode an interpolated value at a lon/lat: cargo run -p rust-grib-decoder --example extract_param -- file.grib2 msl 113.363 22.962.)