- 高德 GeoJSON 参考流程: `scripts/lib/gaode-junction-reference.js` 与 `scripts/inspect-junction-reference.js` 将 GCJ-02 参考转换为 WGS84, 按 node id/最近距离关联 OSM, 支持普通路口面和 `complex-cluster` 两种匹配。 - 复合路口模板 `complex-junction-v1`: `scripts/lib/complex-junction.js` 用参考 几何校准 core 半径, 生成路口面、进口路面、斑马线、停止线、角部圆角与安全岛; 拓扑/信号/连接全部沿用 OSM/native。 - 车道中心线控制要素避让: `compileLaneCenterlines` 现接收模板已产出的斑马线/停止线, 新增 `trimLaneOutsideControls` 按到路口中心的半径定向裁剪; 标线源几何同步裁剪, 不再 越过斑马线继续画到核心区。拓扑几何不变, connector 集合前后一致。 - 复合路口人行道转角: `buildComplexJunctionGeometry` 沿已定义的路缘生成 2m 宽转角带, 复用圆角曲线, 通过 `islands` 通道并入 `sidewalk_surface`; 自交或坐标非有限时报 `complex-junction-sidewalk-corner-fallback` 并跳过。 - 新增诊断: `complex-junction-configured-radius-ignored`、 `lane-centerline-fully-inside-control`、`complex-junction-sidewalk-corner-fallback`。 - 死码清理: 移除未被调用的 `clusterApproachRing`。 - spec 更新: `.trellis/spec/pipeline/cli-and-stages.md` 复合路口小节补充控制要素 避让顺序、人行道转角契约、Validation 矩阵三行; 索引新增导航。 - 任务产物 `08-19-gaode-junction-reference`: 8 条验收标准全部实测记录, Scope Drift / Verification Log / Known Gaps 三节沉淀本次工作。 Regression: test:native-road / test:road-workbench / test:preflight / test:native-preview-traffic / test:package-contract / test:traffic-signals / test:gaode-junction-reference 全绿; road:check ok=true, errors=[]。
4.0 KiB
4.0 KiB
Validation Implementation Plan
进度标记于 2026-08-21。
- Add a read-only reference inspection utility or library helper that validates GeoJSON,
converts GCJ-02 to WGS84, computes bounds/center, and associates the sample with OSM node
8005332807. —scripts/lib/gaode-junction-reference.js+scripts/inspect-junction-reference.js - Add focused tests for coordinate conversion, malformed input rejection, spatial association,
and the no-reference fallback. —
npm run test:gaode-junction-reference - Add a diagnostic comparison between the reference footprint and native
intersection_surface.geojson, including center offset, envelope overlap, and approach headings. — 复杂路口的面写在road_surface.geojson(complex_part)而非intersection_surface, 原实现匹配不到、恒返回nativeIntersection: null。已扩展为可回落到复杂路口簇 (新增--native-road-surface/--cluster-id,schema 升至 v2)。 - Add a reference-backed, parameterized junction template and dispatch it only for
explicitly enabled samples. — 实际实现为
complex-junction-v1,非原计划的 cross 模板, 范围变更见 prd.md「Scope Drift」。 - Preserve connector, movement, signal, and stop-line generation; validate containment against the new surface. — A/B 实测通过,数据见 prd.md「Verification Log」。
- Run native-road, preflight, preview-traffic, and package-contract tests, plus the sample
comparison. Inspect the generated overlay/diagnostic manually.
— 2026-08-21 全绿:
test:gaode-junction-reference、test:native-road、test:road-workbench、test:preflight、test:native-preview-traffic、test:package-contract、test:traffic-signals, 外加road:check→ok: true, errors: []。人工视觉确认仍待用户。 - Stop at validation. Do not commit, and do not modify the source OSM or reference GeoJSON. — 未 commit;参考 GeoJSON 未改; 源 OSM 有改动但来自人工 JOSM 编辑,非管线写入。
本次会话追加的修复(2026-08-21)
- 车道中心线与车道标线越过斑马线:
compileLaneCenterlines现接收模板已产出的斑马线/停止线, 新增trimLaneOutsideControls(按到路口中心的半径定向后再裁剪,因为车道几何两种朝向都存在)。 拓扑几何coordinates保持完整,仅裁剪发布几何与标线源几何。 实测越线要素 20 → 0,分隔线越界 2 → 0,connector 356 / movement 370 前后一致。 - 新增诊断
complex-junction-configured-radius-ignored、lane-centerline-fully-inside-control。 - 删除死函数
clusterApproachRing。 - 复杂路口人行道转角(
complex-junction.js):直条带被裁在簇边界后,相邻两臂的步行带 各自留一个断头,中间整个楔形无覆盖。现沿圆角已定义的路缘补一条 2 m 宽转角带。- 复用同一函数作用域内已算好的
curve/tangents/edges/apex,不重新拟合曲线 - 新增
armCarriesSidewalk(按臂的外向方向翻转道路自身的sidewalkLeft/Right)、edgeRunToRadius、offsetPolylineAwayFromCenter、ringSelfIntersects - 经
islands通道并入generatedComplexSidewalks - 自交或几何无效时跳过并报
complex-junction-sidewalk-corner-fallback,不硬塞坏几何 - 实测:人行道要素 7 → 8;生成角 1(平分线 286°,241°→331°,57 顶点);无自交; 与两侧条带均相接;面积采样 331 点中 0 点落在车行道内
- 限制:全区 139 条路仅 3 条带人行道,4 个角中只有 286° 两侧齐备, 其余 3 个角当前不产出,缺少验证样本
- 复用同一函数作用域内已算好的
Rollback Points
- Delete/disable the optional reference configuration to restore the default native path.
- Remove only the reference diagnostic output; existing native-road outputs remain authoritative.
- Do not overwrite existing layers until the comparison is accepted.