mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 11:24:00 +00:00
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:
1 parent
c43c94ba5f
commit
a3aa058569
10 files changed
+385
-14
No files matched your search
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user