Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
20190824 Leaflet+WebGL
Search
Yuzo Matsuzawa
August 24, 2019
Programming
410
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20190824 Leaflet+WebGL
Presentation for FOSS4G TOKAI 2019
Yuzo Matsuzawa
August 24, 2019
More Decks by Yuzo Matsuzawa
See All by Yuzo Matsuzawa
20191115.pdf
frogcat
0
120
20190924DA-JPSxMapTile.pdf
frogcat
0
72
20190705GNJP2
frogcat
1
94
SotMJP2018-retroscope
frogcat
1
290
Retroscope by leaflet
frogcat
2
4.3k
Other Decks in Programming
See All in Programming
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
510
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
450
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
500
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
570
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
480
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
21
21k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
200
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
170
Jetpack Compose Mechanisms
skydoves
2
630
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
120
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Statistics for Hackers
jakevdp
799
230k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
610
Faster Mobile Websites
deanohume
310
32k
Transcript
Leaflet + WebGL インディゴ株式会社 松澤有三 2019.08.24 FOSS4G TOKAI 2019 1
前回 2 ・FOSS4G 2015 Tokyo ・Leaflet + SVG Mask
その後 3 2016 2018 2017 ・GitHub / Qiita @frogcat ・FOSS4G
Advent Calendar ・ブラウザ上でのタイル活用
今回 4 ・FOSS4G TOKAI 2019 ・Leaflet + WebGL GPUを活用した ブラウザで使用できる
計算資源としての WebGL Tensorflow.js, Web GPU Cesium, mapbox-gl-js etc. 3D/2.5D グラフィックスの 高速な描画のために 使用するのが一般的
基本① 段彩図 5 左:国土地理院標高PNGタイル RGB が標高値に対応している 右: WebGLで生成した段彩図 標高値から色を計算して着色
6 地理院地図 「自分で作る色別標高図」 このくらいの計算負荷だと WebGL なしでもなんとかなる
基本② 陰影図 7 左:国土地理院標高PNGタイル RGB が標高値に対応している 右: WebGLで生成した陰影図 ピクセルごとに法線ベクトルを計算 して光源となす角度をもとに着色
8 ひなたGIS 計算方法を工夫すると WebGL なしでもなんとかなる 1x1 ピクセル単位で計算すると 256x256 の計算が必要になる上に、 タイルの端のほうで隣接ピクセルがなくてノイズが
生じるといった問題がある 2x2ピクセルを最小単位とすると 2x2ピクセルから法線ベクトルが計算できるので 端の問題がなくなる。 また、計算量が 64x64 に削減できる。 デメリットは陰影の解像度の粗さ。
9 Mapbox GL JS 陰影は WebGL で動的に生成される 陰影を制御するためのさまざまなオプション
基本③ 等高線 10 左:国土地理院標高PNGタイル RGB が標高値に対応している 右: WebGLで生成した等高線 標高値を等高線間隔で割った整数部 が隣接ピクセルのものと違う場合は
on
11 Canvas でもなんとかなるが もっさりとしている
基本④ 全部入り 12 左:国土地理院標高PNGタイル RGB が標高値に対応している 右: WebGLで生成した段彩+陰影+等高線 全部を Canvas
でやろうとすると さすがに計算負荷が見逃せない
? 13 利用者ニーズに応じた 多種タイルの整備 単一の標高タイルの提供 利用者環境での処理 表示・重畳 自由度 低い カスタマイズ
自由 整備更新 たいへん ニーズに 応えるにも 限界が とりあえず DEM さえ あればOK (自治体の持つ高精度DEMがオープンデータになるといいな)
応用① CS立体図 14 左:国土地理院標高PNGタイル RGB が標高値に対応している 右: WebGLで生成したCS立体図 Curvature (曲率)
と Slope (傾斜) を 計算して着色、地理院淡色地図に重畳
応用② CS立体図 (最新版) 15 左:国土地理院標高PNGタイル RGB が標高値に対応している 右: WebGLで生成したCS立体図 オリジナルに近づけるために
多段の平滑化に対応
16 Curvature Slope Curvature Slope 平滑化 平滑化 ひとつのフレームで処理 複数のフレームで処理
応用③ frogcat/flood 17 選択したエリアが 均一に水没した状態から 水が低いほうに収束する アニメーション
18 計算 初期 水量 水量 描画 計算 水量 描画 計算
水量 描画 無限ループで計算&描画 秒間数十フレーム 程度の描画性能
応用④ ジオリファレンス 19 WebGL と Turf.js を使った ブラウザ完結のジオリファレンス 手元の画像をドラッグ&ドロップ してマーカーをドラッグするだけ
結果はブラウザの File API を 使って PNG タイル画像群として ローカル保存 2019/09/14,15@国立国会図書館
まとめ 20 WebGL • ブラウザで使える高速な計算資源 利用 • 用途はいろいろ • サーバサイド処理の移譲
• あたらしい用途の開拓など 弱点 • 学習が大変 • OpenGL Shading Language ? • Tensorflow.js ? その他のトピック • WebGL2, Web GPU • WebGL 系地図ライブラリへのコント リビュート、プラグイン開発 • Service Worker, Offscreen Canvas https://github.com/frogcat/foss4g-tokai-2019