feat: compile S-52 vector area patterns

This commit is contained in:
OpenAI Codex
2026-09-17 17:43:10 +08:00
parent 3d9befc3f2
commit 6de980d47f
2 changed files with 258 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
# CM95 S-52 AP 矢量纹理阶段报告 v1
## 结论
已建立 S-52 `AP(...)` vector-only pattern 到 MapLibre fill-pattern 的编译路径。
全国 Dataset 1 实际使用的 AP 中:
- bitmap pattern 继续复用 OpenCPN 原 atlas;
- vector-only pattern 共 10 种,10/10 编译成功;
- 未对 bitmap+vector 双定义资源重复生成。
vector-only pattern:
`PRTSUR01 / QUESMRK1 / MARCUL02 / VEGATN03 / SNDWAV01 / ICEARE04 / FSHFAC03 / TSSJCT02 / AIRARE02 / VEGATN04`。
## 实现
新增 `tools/cm95_s52_vector_pattern_sprite.py`:
1. 读取全国实际 `pattern_resource_counts`;
2. 只选择 vector-only pattern;
3. 解析实际 HPGL `SP/SW/PU/PD/CI`;
4. 按 DAY_BRIGHT 色表生成透明 PNG;
5. 追加至现有 Symbol + Pattern + LC Sprite。
## 福冈湾回归
`z12/3531/1641` 实际包含:
- `PRTSUR01 ×31`
- `QUESMRK1 ×5`
v12 浏览器实际验证:
- `s52-ap-prtsur01` rendered features = 19(当前视口)
- `s52-ap-quesmrk1` rendered features = 2(当前视口)
- `map.hasImage(ap-PRTSUR01)` = true
- `map.hasImage(ap-QUESMRK1)` = true
- 页面 READY;唯一 HTTP 404 为 `favicon.ico`。
## 边界
正式 style compiler 后续应根据 `s52_area_pattern_code` 自动生成 fill-pattern layer,不应长期手工维护 v12 中的验证层。