Files
CM95/docs/CM95_PBF_Pilot生成器设计_v1.md

206 lines
3.8 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.
# CM95 → NavSea PBF Pilot Generator v1
## 1. 当前阶段
已完成前置门禁:
- CM93 → MySQL 全量 Geometry / Non-Geometry:PASS。
- NavSea 现有 style、semantic sprite、z10–z12 PBF 契约已审计。
- 测试 AOI:`z10/914/385`。
- AOI 中 CM95 数据有效。
- `LIGHTS` relation20 全 AOI 审计:
- LIGHTS total = 96
- with relation20 = 94
- relation20 可安全合成 = 94
- 坐标冲突 = 0
- 无 relation20、必须独立输出 = 2
- 结论:`PASS_RELATION20_PRIMARY_KEY`
本包进入第一版真实生成阶段。
## 2. 架构
```text
CM93 / CM95 source
↓
已冻结 MySQL importer
↓
CM95 MySQL Dataset 1
↓ read-only
Coverage / scale selector
↓
cm95_to_navsea_v1.yaml
↓
navigation relation20 composer
↓
Web Mercator clip / tile quantization
↓
NavSea source-layer
↓
MVT/PBF
```
PBF 生成器不修改 importer、schema 或原始 CM93 数据。
## 3. 第一 AOI 的 scale policy
```text
z10 → C / 1:200,000
fallback B/A/Z
z11 → E / 1:50,000
fallback D/C/B/A/Z
z12 → F / 1:20,000
fallback E/D/C/B/A/Z
```
回退不是简单叠加。
每一级优先使用该 scale 的 `chart_coverage.geom`;细图覆盖过的区域会遮蔽更粗 scale,只在未覆盖部分回退。
因此不会把 F/E/C/B 等多个比例尺的对象全部重复塞进同一 tile。
## 4. extent
为兼容用户提供的当前 NavSea/NEWPEC PBF:
```text
z10 = 4096
z11 = 4096
z12 = 1048576
```
这是 Pilot 明确 policy,而不是从 CM95 上游 PBF“继承”。
## 5. 助航对象合成
主键:
```text
cell_id + attributes._cm93_relation20_raw
```
仅当同一 relation20 组同时存在 `LIGHTS + base component` 时合成。
base component 优先级:
```text
BCNLAT
BCNSPP
BOYSPP
RTPBCN
TOWERS
_extgn
```
同一组只输出一个 `navigation_marks` Feature。
原始组件在 engineering trace 中全部保留。
### 无 relation20 的 LIGHTS
当前 AOI 有 2 个。
规则:
```text
独立输出
不按距离猜测合并
```
## 6. MVT ID
禁止使用 MySQL `chart_feature.id` 作为稳定外部身份。
第一次生成前建立:
```text
build/cm95_fid_manifest_v1.sqlite
```
Manifest 按:
```text
source_relative_path
source_record_index
geometry_type
sounding point_index
```
确定性排序并分配 base ordinal。
最终 MVT numeric id:
```text
base_ord * 16 + geometry_role
```
这样:
- 结果是 signed-int32 范围;
- Dataset 不变时重复构建稳定;
- derived boundary / point-on-surface 有独立稳定 ID;
- MySQL 重建导致自增 id 改变不会影响 PBF ID。
如果 Dataset 的 source SHA 集合发生变化,manifest fingerprint 不匹配,生成器会拒绝继续,要求显式重建。
## 7. Engineering / Delivery
### Engineering
保留:
```text
source_id
source_dataset_id
source_cell
source_record_index
source_object_class
source_geometry_type
native_scale
mapping_rule_id
mapping_status
source_attr_json
```
无法安全映射对象进入:
```text
cm95_unmapped
```
### Delivery
只输出现有 NavSea style source-layer。
字段按当前 delivery allowlist 裁剪。
正式 delivery 不包含 `cm95_unmapped`。
## 8. 当前限制
这是 Pilot,不是全国发布版。
当前需要实测的内容:
1. `mapbox-vector-tile` 在用户 Windows 环境的编码结果;
2. z10/z11/z12 Coverage 回退效果;
3. CM95 和 NEWPEC 内容不同导致的对象数量差异;
4. 航标 icon / label 实际视觉;
5. 未映射对象收敛;
6. hard-gate 对象保全;
7. tile edge buffer;
8. 后续 sector light 的专项 arc 映射。
因此第一轮目标是:
```text
能生成
能被当前 NavSea style 直接打开
对象可追溯
hard-gate 不静默丢
```
而不是第一轮就宣称全国正式发布。