Compare commits

...

2 Commits

Author SHA1 Message Date
OpenAI Codex
ed5de0752f 完善 Full PBF 跨机器重建配置 2026-08-06 15:42:15 +08:00
OpenAI Codex
d0ef394eac 补充 Full 重建代码节点追溯 2026-08-06 15:39:08 +08:00
3 changed files with 31 additions and 18 deletions

View File

@@ -10,7 +10,8 @@
- 原始海图来源:全国 `newpec` PBF - 原始海图来源:全国 `newpec` PBF
- 语义来源MySQL `pbf_analysis` - 语义来源MySQL `pbf_analysis`
- 固定规则包:`navsea-core` - 固定规则包:`navsea-core`
- 固定代码节点Git commit `6d72340` - 历史固定代码节点Git commit `6d72340`
- 当前专用分支对应节点Git commit `5cb0eea`
本文用于以后重新生成与 `pbf-delivery-full-20260418-rebuild` 业务内容等价的全国 Full PBF。 本文用于以后重新生成与 `pbf-delivery-full-20260418-rebuild` 业务内容等价的全国 Full PBF。
@@ -72,13 +73,13 @@ tile.mapple-on.jp__newpec-mvt-20260106__z___x___y_.pbf/tiles
### 2.4 固定代码版本 ### 2.4 固定代码版本
2026-04-18 全国分片重建时,固定使用的是当时的 HEAD 版本。对应可追溯节点: 当前可重建分支已经包含全国 Full 生成器、规则包、semantic 后处理和审计代码。当前分支节点
```text ```text
6d72340 guard high-extent tile reencoding full-semantic-extentfix-baseline @ d0ef394
``` ```
当前工作区的 `navsea_tile_builder.py` 已经包含后续修改,不能用于严格复建该历史基线。应使用独立 Git worktree同时固定 历史上用于 2026-04-18 重建的源节点仍记录为 `6d72340`。如果需要严格复现历史代码,可额外 fetch 该节点;如果目标是重建当前 Full 基线,直接使用当前分支即可。当前分支固定包含
- `navsea_tile_builder.py` - `navsea_tile_builder.py`
- `navsea_mapping_registry.py` - `navsea_mapping_registry.py`
@@ -93,7 +94,7 @@ MySQL pbf_analysis 语义表
+ +
navsea-core 映射规则 navsea-core 映射规则
固定 6d72340 代码节点 当前 `full-semantic-extentfix-baseline` 代码节点
按 z0-8 / z9-10 / z11 / z12 分片重建 按 z0-8 / z9-10 / z11 / z12 分片重建
@@ -124,28 +125,36 @@ navsea-core 映射规则
/home/wwwroot/pbf-delivery-full-rebuild-candidate /home/wwwroot/pbf-delivery-full-rebuild-candidate
``` ```
### 4.2 建立固定代码 worktree ### 4.2 使用当前分支代码
```bash ```bash
cd /root/sourceserver/pbf cd /root/sourceserver/pbf
git worktree add --detach /tmp/navsea-full-rebuild-code 6d72340 git switch --detach full-semantic-extentfix-baseline
``` ```
检查固定版本: 检查固定版本:
```bash ```bash
git -C /tmp/navsea-full-rebuild-code rev-parse HEAD git rev-parse HEAD
``` ```
期望 `6d72340` 开头 期望 `d0ef394` 或该分支后续更新后的提交
### 4.3 设置路径变量 ### 4.3 设置路径变量
```bash ```bash
export REPO=/root/sourceserver/pbf export REPO=/root/sourceserver/pbf
export CODE=/tmp/navsea-full-rebuild-code export CODE=$REPO
export PY=/root/sourceserver/pbf/.venv/bin/python export PY=$REPO/.venv/bin/python
# 按目标机器实际情况设置NAVSEA_DB_SOCKET 为空时使用 TCP。
export NAVSEA_DB_HOST=127.0.0.1
export NAVSEA_DB_PORT=3306
export NAVSEA_DB_USER=root
export NAVSEA_DB_PASSWORD='请填入数据库密码'
export NAVSEA_DB_NAME=pbf_analysis
export NAVSEA_DB_SOCKET=/tmp/mysql.sock
export SOURCE=/home/wwwroot/newpec/exported_auto/tile.mapple-on.jp__newpec-mvt-20260106__z___x___y_.pbf/tiles export SOURCE=/home/wwwroot/newpec/exported_auto/tile.mapple-on.jp__newpec-mvt-20260106__z___x___y_.pbf/tiles
export REFERENCE=/home/wwwroot/pbf-delivery-full-20260415 export REFERENCE=/home/wwwroot/pbf-delivery-full-20260415
@@ -468,7 +477,8 @@ $PY navsea_full_aoi_visual_audit.py \
固定重建要素为: 固定重建要素为:
```text ```text
代码节点6d72340 历史代码节点6d72340
当前分支节点5cb0eea
数据库pbf_analysis 当前确认未修改的数据 数据库pbf_analysis 当前确认未修改的数据
规则包navsea-core 规则包navsea-core
原始 PBFnewpec-mvt-20260106 原始 PBFnewpec-mvt-20260106

View File

@@ -4,6 +4,7 @@ import argparse
import hashlib import hashlib
import json import json
import math import math
import os
import re import re
import struct import struct
from collections import defaultdict from collections import defaultdict
@@ -221,12 +222,12 @@ def normalize_release_canonical_object_type(source_layer: str, canonical_object_
@dataclass(frozen=True) @dataclass(frozen=True)
class DbConfig: class DbConfig:
host: str = "localhost" host: str = os.getenv("NAVSEA_DB_HOST", "localhost")
port: int = 3306 port: int = int(os.getenv("NAVSEA_DB_PORT", "3306"))
user: str = "root" user: str = os.getenv("NAVSEA_DB_USER", "root")
password: str = "2chi9ks2" password: str = os.getenv("NAVSEA_DB_PASSWORD", "")
database: str = "pbf_analysis" database: str = os.getenv("NAVSEA_DB_NAME", "pbf_analysis")
unix_socket: str | None = "/tmp/mysql.sock" unix_socket: str | None = os.getenv("NAVSEA_DB_SOCKET", "/tmp/mysql.sock") or None
@dataclass(frozen=True) @dataclass(frozen=True)

View File

@@ -6,3 +6,5 @@ eccodes>=1.7
mercantile>=1.2 mercantile>=1.2
mapbox-vector-tile>=2.1 mapbox-vector-tile>=2.1
PyMySQL>=1.1 PyMySQL>=1.1
Pillow>=10.0
cryptography>=42.0