Files
CM95/codex/ARCHITECTURE.md
2026-09-02 09:50:12 +08:00

56 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 架构设计
## 数据流
CM93 原始目录
→ SourceScanner
→ DictionaryLoader
→ CellBinaryReader
→ FeatureDecoder
→ CoverageResolver
→ PrecisionProjection
→ ChartFeature Model
→ MySQLBatchWriter
→ MySQL 母数据库
## 分层
### `cm93`
只负责格式解析和坐标/几何语义,不知道 MySQL。
### `model`
定义稳定中间模型。
### `database`
负责 MySQL 5.7 写入、事务、批量提交和恢复。
### `cli`
只做命令组织。
## 数据库与 CM93 边界
写入数据库以后:
- geometry 已标准化为 WGS84 经纬度;
- 原始 CM93 元数据仍保留;
- 后续 PBF builder 不需要理解 CM93 二进制。
## Cell 事务
每个 cell 为独立事务边界:
DISCOVERED → IMPORTING → DONE
失败:
IMPORTING → FAILED
再次运行时:
- DONE 默认跳过;
- FAILED 可重试;
- 强制参数可重新导入指定 cell。
## Geometry
母数据库保留标准化 geometry,但不依赖 geometry 作为唯一事实来源。
原始记录和 source index 是审计入口。