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
PLATEAUをCityJSONにしてみた
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ShoYoneda
June 19, 2024
Technology
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PLATEAUをCityJSONにしてみた
ShoYoneda
June 19, 2024
More Decks by ShoYoneda
See All by ShoYoneda
PLATEAUで画像生成AIの構図を自由に指定する方法
soh_mitian
0
170
CityGMLとFBXの連携で地理空間のエンタメ化
soh_mitian
1
1.7k
LiDARスキャン点群の継ぎ接ぎ
soh_mitian
0
300
Other Decks in Technology
See All in Technology
USB PDを使ってスマホを労わりたい
raspython3
0
180
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
290
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
110
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
160
How to Design Configuration for Rails Applications
willnet
1
780
スプシの手作業からの解脱 ~更新はClaude Codeに、見せ方と使い方はGASアプリに任せる~
kentarofujii
0
150
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
770
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
190
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1.1k
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
570
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
450
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
200
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
So, you think you're a good person
axbom
PRO
2
2.2k
Producing Creativity
orderedlist
PRO
348
41k
Git: the NoSQL Database
bkeepers
PRO
433
67k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
A designer walks into a library…
pauljervisheath
211
25k
Transcript
1-"5&"6Λ $JUZ+40/ʹͯ͠Έͨ
)PMMPX#ZUF--$ද ถా ক • Կऀʁ • 8FC • ܈ •
σʔλ • ͍ΖΜͳσʔλΛूΊ͍ͯͬͯ͡ ༡Ϳͷ͕झຯ • σʔλมܥͷϓϩάϥϜॻ͘͜ͱ͕ଟ͍ HollowByte LLC 2 ࣗݾհ こいつ👉
8FCͰ$JUZ(.- ͍ͮΒ͍ͶΜ HollowByte LLC 3
HollowByte LLC 4 8FCͰ$JUZ(.-Λॲཧ͢Δʹ const xmlString = ` <CityModel xmlns="http://www.opengis.net/citygml/2.0"
</CityModel>`; // XMLをパースする const parser = new DOMParser(); const xmlDoc = parser.parseFromString(xmlString, "application/xml"); // 名前空間リゾルバ function nsResolver(prefix) { const ns = { 'gml': 'http://www.opengis.net/gml', 'bldg': 'http://www.opengis.net/citygml/building/2.0' }; return ns[prefix] || null; } // XPathを使⽤して "bldg:measuredHeight" を抽出する const heights = []; const nodesSnapshot = xmlDoc.evaluate('//bldg:measuredHeight', xmlDoc, nsResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (let i = 0; i < nodesSnapshot.snapshotLength; i++) { heights.push(nodesSnapshot.snapshotItem(i).textContent); } console.log(heights); // ["10", "20"] こいつ👉 PLATEAUくらい情報量があると XPathの処理が爆発する
ݫ͍ͬͯ͠ 8FCͰ$JUZ(.-ѻ͏ͷ ݫ͍ͬͯ͠ 👉ͦ͜Ͱ$JUZ+40/ HollowByte LLC 5
• %ࢢϞσϧΛ֨ೲ͢ΔͨΊͷ+40/ϕʔεͷϑΥʔϚοτ • $JUZ+40/ WΦʔϓϯཧۭؒίϯιʔγΞϜ 0($ ͷެࣜඪ४ • ͍ΘΏΔ$JUZ(.-ͷ+40/ͷ൛ •
+40/ϕʔεͳͷͰϓϩάϥϜతʹѻ͍͍͢ • $JUZ(.-ΑΓܰྔ • ฏۉഒίϯύΫτ • $JUZ(.- .# • $JUZ+40/ .# HollowByte LLC 6 $JUZ+40/ͱͳΜͧ
属性 GeoJSON CityJSON ⽬的と⽤途 簡単な地理空間データの表現と共有。主 にウェブマッピングアプリケーションや 軽量なデータ交換に使⽤。 CityGMLでエンコードされた都市モデルデータの効 率的な表現。詳細な3D都市モデルの共有と解析に 適⽤。
データモデル ポイント、ラインストリング、ポリゴン などの基本的な地理空間オブジェクトを 表現。複雑な3Dモデルには不適。 建物、道路、橋梁、トンネルなどの詳細な3D都市 オブジェクトを表現。複雑なジオメトリと属性情 報を持つ。 構造 フィーチャコレクションとしてデータを 格納。各フィーチャはジオメトリとプロ パティを持つ。 CityObjectsとして都市モデルデータを格納。各 CityObjectはジオメトリと属性を持つ。 互換性 広くサポートされており、ほとんどの GISツールやウェブマッピングライブラ リで使⽤。 CityGMLデータのエンコードに特化。主に3D都市 モデルの解析と共有に使⽤。GeoJSONほどの広範 なツールサポートはないが、3D都市モデル分野で は重要。 HollowByte LLC 7 (FP+40/ͱͷҧ͍ͳΜͶΜ CityJSONはGeoJSONより複雑な情報を扱うことを⽬的としている
HollowByte LLC 8 σʔλߏ CityGML CityJSON パッと⾒でCityJSONのほうが良さそうでしょ
CityGML CityJSON function extractAttributesFromCityGML(xmlData, tagName) { const parser = new
DOMParser(); const xmlDoc = parser.parseFromString(xmlData, 'application/xml'); const buildings = xmlDoc.getElementsByTagName('bldg:Building'); const result = []; for (let i = 0; i < buildings.length; i++) { const building = buildings[i]; const id = building.getAttribute('gml:id'); const tagElements = building.getElementsByTagName(tagName); if (tagElements.length > 0) { const value = tagElements[0].textContent; result.push({ id: id, [tagName]: value }); } } return result; } function extractAttributes(cityjson, attributeName) { const result = []; for (const id in cityjson.CityObjects) { const cityObject = cityjson.CityObjects[id]; if (cityObject.attributes[attributeName] !== undefined) { result.push({id: id, attribute: cityObject.attributes[attributeName] }); } } return result; } HollowByte LLC 9 ѻ͏ίʔυྔʢ+BWB4DSJQUʣ 特定の属性を抽出する関数のコード量⽐較 11⾏ 16⾏
HollowByte LLC 10 $JUZ+40/ͷ%දݱ • JSONベースなのでWebとの親和性が⾼い • CityGMLと同様に属性情報を保持
$JUZ(.-ͱҰॹʹ$JUZ+40/Ͱͷ৴ͯ͠Β͑ͨΓɾɾɾʁ ݫ͍͠ʁ ͡Ό͋ͬͪ͜Ͱมث࡞Δ͔͋ɾɾɾ HollowByte LLC 11 ଆ͝ґཔࣄ߲ 👈作ったらたぶん ここで公開する
5IBOLZPV