[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,91 +2,198 @@
|
||||
id: wiki-2026-0508-cesiumjs
|
||||
title: CesiumJS
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-CESI-001]
|
||||
aliases: [Cesium, Cesium.js]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.94
|
||||
tags: [auto-reinforced, Cesiumjs, WebGL, 3d-mapping, geospatial, visualization]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [3d, geospatial, webgl, frontend, mapping]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: JavaScript / TypeScript
|
||||
framework: WebGL2 / WebGPU
|
||||
---
|
||||
|
||||
# [[CesiumJS|CesiumJS]]
|
||||
# CesiumJS
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "브라우저에 담긴 지구: 웹상에서 거대한 3D 지형, 위성 이미지, 실시간 정밀 데이터를 플러그인 없이도 최고 수준의 성능으로 렌더링하는 오픈소스 기반의 공간 지능형 시각화 플랫폼."
|
||||
## 매 한 줄
|
||||
> **"매 browser 의 3D digital globe + geospatial visualization 의 standard"**. CesiumJS 는 WGS84 ellipsoid 의 정확 globe 의 WebGL/WebGPU 렌더링, 3D Tiles spec 의 reference impl. 2026 도시 digital twin, drone telemetry, satellite tracking, defense visualization 의 dominant choice.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
CesiumJS는 3D 지리 공간 데이터를 웹 브라우저에서 시각화하기 위한 [[JavaScript|JavaScript]] 라이브러리입니다.
|
||||
## 매 핵심
|
||||
|
||||
1. **핵심 강점**:
|
||||
* **WebGL 기반**: 하드웨어 가속을 통해 대규모 3D 데이터를 매끄럽게 처리.
|
||||
* **Precision**: WGS84 좌표계를 직접 사용하여 우주적 규모부터 도시의 미세한 건물까지 정밀하게 표현.
|
||||
* **3D Tiles**: 거대한 데이터를 청크 단위로 나누어 필요한 부분만 스트리밍하는 혁신적 방식. ([[Scalability|Scalability]]와 연결)
|
||||
2. **주요 활용**:
|
||||
* 스마트 시티 디지털 트윈, 항공 경로 실시간 모니터링, 재난 피해 가상 시뮬레이션 등.
|
||||
### 매 핵심 concept
|
||||
- **Viewer**: 모든 widget 의 포함 의 main container
|
||||
- **Scene**: 3D world (globe, sky, atmosphere)
|
||||
- **Camera**: position + heading/pitch/roll, FlyTo 의 지원
|
||||
- **Entity**: high-level data-driven object (point, polygon, model)
|
||||
- **Primitive**: low-level direct GPU 의 access
|
||||
- **3D Tiles**: streaming hierarchical 3D dataset (city, photogrammetry)
|
||||
- **Terrain**: heightmap (Cesium World Terrain, custom)
|
||||
- **Imagery**: tile basemap (Bing, Mapbox, OSM)
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌**: 과거의 웹 지도 정책은 2D 평면 지도 중심이었으나, CesiumJS와 같은 3D 위주의 정책이 등격하며 '공간적 맥락 정책'을 디지털 트윈의 표준으로 만듦(RL Update).
|
||||
- **정책 변화(RL Update)**: 엔비디아 옴니버스나 구글 맵스 3D 타일과의 통합 정책이 강화됨에 따라, 닫힌 시스템이 아닌 '상호운용성 정책(InterOperability)'을 최우선으로 하는 지리 정보 생태계로 진화함.
|
||||
### 매 좌표 system
|
||||
- `Cartesian3`: ECEF (meters from Earth center)
|
||||
- `Cartographic`: lon/lat/height (radians)
|
||||
- `Cesium.Math.toRadians/toDegrees` 의 변환
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Browser|Browser]], [[Geographic-Information-Systems|Geographic-Information-Systems]] (GIS), Simulation, [[Scalability|Scalability]], [[Technical-Architecture|Technical-Architecture]]
|
||||
- **Modern Tech/Tools**: Cesium Ion, Unmanned Traffic [[Management|Management]] (UTM), [[Digital_Twin|Digital Twin]] platforms.
|
||||
---
|
||||
### 매 응용
|
||||
1. 도시 3D digital twin (Photogrammetry / CityGML).
|
||||
2. Drone / vehicle real-time tracking.
|
||||
3. Satellite orbit visualization (CZML).
|
||||
4. Construction BIM overlay.
|
||||
5. Disaster response (flood, wildfire).
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
## 💻 패턴
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### Setup (Vite + npm)
|
||||
```ts
|
||||
import { Viewer, Cartesian3, Math as CMath, Ion } from 'cesium';
|
||||
import 'cesium/Build/Cesium/Widgets/widgets.css';
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
Ion.defaultAccessToken = import.meta.env.VITE_CESIUM_ION_TOKEN;
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
const viewer = new Viewer('cesiumContainer', {
|
||||
terrainProvider: await Cesium.createWorldTerrainAsync(),
|
||||
});
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
viewer.camera.flyTo({
|
||||
destination: Cartesian3.fromDegrees(-122.4194, 37.7749, 5000),
|
||||
orientation: { heading: 0, pitch: CMath.toRadians(-45), roll: 0 },
|
||||
});
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### Entity (point + label)
|
||||
```ts
|
||||
viewer.entities.add({
|
||||
position: Cartesian3.fromDegrees(127.0, 37.5, 100),
|
||||
point: { pixelSize: 12, color: Cesium.Color.YELLOW },
|
||||
label: {
|
||||
text: 'Seoul',
|
||||
font: '14px sans-serif',
|
||||
pixelOffset: new Cesium.Cartesian2(0, -20),
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### 3D Tiles (Photogrammetry city)
|
||||
```ts
|
||||
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(96188);
|
||||
viewer.scene.primitives.add(tileset);
|
||||
await viewer.zoomTo(tileset);
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
// Style 의 적용
|
||||
tileset.style = new Cesium.Cesium3DTileStyle({
|
||||
color: 'color("white", 0.9)',
|
||||
show: '${Height} > 30',
|
||||
});
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### glTF model (vehicle)
|
||||
```ts
|
||||
const drone = viewer.entities.add({
|
||||
position: Cartesian3.fromDegrees(127.0, 37.5, 200),
|
||||
model: {
|
||||
uri: '/models/drone.glb',
|
||||
scale: 1.0,
|
||||
minimumPixelSize: 64,
|
||||
},
|
||||
orientation: Cesium.Transforms.headingPitchRollQuaternion(
|
||||
Cartesian3.fromDegrees(127.0, 37.5, 200),
|
||||
new Cesium.HeadingPitchRoll(0, 0, 0),
|
||||
),
|
||||
});
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### CZML (time-dynamic)
|
||||
```ts
|
||||
const dataSource = await Cesium.CzmlDataSource.load('/data/flight.czml');
|
||||
viewer.dataSources.add(dataSource);
|
||||
viewer.clock.shouldAnimate = true;
|
||||
viewer.trackedEntity = dataSource.entities.values[0];
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
### Real-time WebSocket update
|
||||
```ts
|
||||
const drone = viewer.entities.add({
|
||||
id: 'drone-1',
|
||||
position: new Cesium.SampledPositionProperty(),
|
||||
point: { pixelSize: 8, color: Cesium.Color.RED },
|
||||
});
|
||||
|
||||
const ws = new WebSocket('wss://api/telemetry');
|
||||
ws.onmessage = (e) => {
|
||||
const { lon, lat, alt, t } = JSON.parse(e.data);
|
||||
drone.position.addSample(
|
||||
Cesium.JulianDate.fromIso8601(t),
|
||||
Cartesian3.fromDegrees(lon, lat, alt),
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
### Pick (click → entity)
|
||||
```ts
|
||||
viewer.screenSpaceEventHandler.setInputAction((click) => {
|
||||
const picked = viewer.scene.pick(click.position);
|
||||
if (Cesium.defined(picked) && picked.id) {
|
||||
console.log('Clicked entity:', picked.id.id);
|
||||
}
|
||||
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
||||
```
|
||||
|
||||
### React 의 통합 (Resium)
|
||||
```tsx
|
||||
import { Viewer, Entity, PointGraphics } from 'resium';
|
||||
import { Cartesian3 } from 'cesium';
|
||||
|
||||
export function Globe() {
|
||||
return (
|
||||
<Viewer full>
|
||||
<Entity position={Cartesian3.fromDegrees(127, 37.5, 100)}>
|
||||
<PointGraphics pixelSize={10} />
|
||||
</Entity>
|
||||
</Viewer>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| 정확 WGS84 globe | CesiumJS |
|
||||
| 2D map only | Mapbox / MapLibre |
|
||||
| Photogrammetry city | 3D Tiles + Ion |
|
||||
| Time-series telemetry | CZML + SampledPositionProperty |
|
||||
| React app | Resium wrapper |
|
||||
| Custom shader | Primitive + Material |
|
||||
|
||||
**기본값**: Viewer + Entity (90% case 의 충분).
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[3D Visualization]] · [[Geospatial]]
|
||||
- 변형: [[Three.js]] · [[deck.gl]] · [[MapLibre GL]]
|
||||
- 응용: [[Digital Twin]] · [[Drone Tracking]]
|
||||
- Adjacent: [[WebGL]] · [[WebGPU]] · [[3D Tiles]] · [[glTF]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 3D globe, photogrammetry city, satellite/drone tracking 코드 generation.
|
||||
**언제 X**: 단순 2D map (Mapbox/MapLibre 의 lighter).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Entity 의 수만 개 add**: performance 의 죽음 — 매 Primitive / Cluster 의 사용.
|
||||
- **모든 frame 의 entity 의 recreate**: 매 GC pressure — `position` 의 update.
|
||||
- **Bundle 전체 import**: Cesium 의 매 huge — tree-shake / `cesium-vite` plugin.
|
||||
- **`viewer.scene.requestRender` 의 무시 in `requestRenderMode`**: 매 frame 의 frozen.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Cesium docs, 3D Tiles OGC spec).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — CesiumJS patterns + 3D Tiles + Resium |
|
||||
|
||||
Reference in New Issue
Block a user