1- # weather -map
1+ # jma-wind -map
22
33
44気象庁のGPVデータをRGBエンコーディングしたPNGに変換し、可視化するサンプルです。
55
6+ ## 概要
7+ - MapLibre GLとDeck.gl、weatherlayers-glを利用して、風向・風速データを地図上に可視化します。
8+ - 風データは[ ` public/wind_data.png ` ] ( public/wind_data.png ) を利用しています。
9+
610## 風データPNGのエンコーディングについて
711- 風速データ(U, V成分)をPNG画像にエンコードしています。
812- ** RチャンネルにU成分、GチャンネルにV成分** を割り当てています。
913- データが存在しない部分は** Aチャンネル(アルファ)を0** にしています。
1014- 詳細仕様は [ weatherlayers-gl公式ドキュメント] ( https://docs.weatherlayers.com/weatherlayers-gl/data-sources#supported-data-types ) および [ データフォーマット] ( https://docs.weatherlayers.com/weatherlayers-gl/data-sources#supported-data-formats ) を参照してください。
1115
12- ## 概要
13- - MapLibre GLとDeck.gl、weatherlayers-glを利用して、風向・風速データを地図上に可視化します。
14- - 風データは[ ` public/wind_data.png ` ] ( public/wind_data.png ) を利用しています。
15- - 地図スタイルはGeoloniaのスタイルを使用しています。
16+
1617
1718## デモ
19+ ![ スクリーンショット 2025-07-16 22 57 07] ( https://github.com/user-attachments/assets/66ff21e4-4aeb-440f-ba8e-5f74ed26240a )
20+
21+ ## サンプルコード
22+
23+ ```
24+ map.on('load', async () => {
25+
26+ const image = await WeatherLayers.loadTextureData('./wind_data.png');
27+
28+ const deckOverlay = new MapboxOverlay({
29+ interleaved: true,
30+ layers: [
31+ new WeatherLayers.ParticleLayer({
32+ id: 'particle',
33+ numParticles: 5000,
34+ maxAge: 10,
35+ speedFactor: 30,
36+ width: 2.0,
37+ opacity: 0.03,
38+ image: image,
39+ imageType: 'VECTOR',
40+ bounds: [-180, -90, 180, 90],
41+ imageUnscale: [-128, 127],
42+ }),
43+ ]
44+ });
45+
46+ map.addControl(deckOverlay);
47+ });
48+ ```
1849
1950## セットアップ
2051
@@ -36,12 +67,6 @@ npm run dev
3667
3768ブラウザで ` http://localhost:5173 ` を開いて地図を確認できます。
3869
39- ## 主なファイル構成
40- - ` index.html ` : アプリのエントリーポイント
41- - ` src/main.js ` : 地図と風データの描画ロジック
42- - ` src/style.css ` : スタイルシート
43- - ` public/wind_data.png ` : 風データ画像
44-
4570## 使用技術
4671- [ MapLibre GL JS] ( https://maplibre.org/ )
4772- [ Deck.gl] ( https://deck.gl/ )
0 commit comments