diff --git a/B05_wf2_Route/B05_wf2_Route_UI_IrregularStations.ts b/B05_wf2_Route/B05_wf2_Route_UI_IrregularStations.ts index 6647bcb5..8a35b54b 100644 --- a/B05_wf2_Route/B05_wf2_Route_UI_IrregularStations.ts +++ b/B05_wf2_Route/B05_wf2_Route_UI_IrregularStations.ts @@ -461,8 +461,19 @@ export function createIrregularStationsSection( // 배관 항목은 통째로 갈아 끼운다 — 정본은 배수유역도의 관 목록이다. // 단, 사용자가 관종·직경을 손으로 바꾼 항목(userSized)은 같은 자리에 다시 올 때 유지한다. const previousPipes = stations.filter(isPipeStation); + const incomingChainages = pipes.map((pipe) => + typeof pipe === "number" ? pipe : pipe.chainage_m, + ); for (let index = stations.length - 1; index >= 0; index -= 1) { - if (isPipeStation(stations[index])) stations.splice(index, 1); + const entry = stations[index]; + // 경로확정 정본(종단 병합분)에서 복원된 항목은 구조물 종류(structureType)가 없다. + // 그 중 정본 관과 같은 자리(±0.5m)인 것은 관의 **복원 유령**이다 — 지금 투영되는 + // 정본 관이 진짜이므로 걷어낸다. 같은 배관이 목록에 2개씩 뜨던 원인(2026-08-06 + // 사용자 보고). 종류를 갖춘 사용자 추가 항목은 자리가 겹쳐도 건드리지 않는다. + const restoredGhost = + entry.structureType === undefined && + incomingChainages.some((chainage) => Math.abs(entry.chainage_m - chainage) < 0.51); + if (isPipeStation(entry) || restoredGhost) stations.splice(index, 1); } pipes.forEach((pipe) => { const chainage = typeof pipe === "number" ? pipe : pipe.chainage_m;