feat: add weather map and wind tools

Add get_weather_map, which returns the latest NOAA radar, satellite or
lightning map over an area as an image, choosing a window the image
route accepts and reporting areas outside the product's coverage, and
get_wind, which samples GFS or IFS wind at a location with the wind
layer's own grid sampling.
This commit is contained in:
Sameh Khamis committed 2026-10-01 13:22:16 -07:00
1 parent c43c94ba5f
commit a3aa058569
10 files changed
+385 -14

No files matched your search

+8
View File
@@ -41,3 +41,11 @@ export function thinEvenly(items, max) {
(_, index) => items[Math.round(index * step)],
);
}
/** Base64-encode bytes with the platform's btoa, in chunks. */
export function toBase64(bytes) {
let binary = '';
for (let offset = 0; offset < bytes.length; offset += 0x8000)
binary += String.fromCharCode(...bytes.subarray(offset, offset + 0x8000));
return btoa(binary);
}