fix(B05 배수유역): 369-2 노선 초안 중 · 저장 분석 낡음 때 [자동 제안] = 지금 노선으로 셈 길

- 저장 분석으로 셈 = 옛 노선 자리(초안) · 409(낡음) 이던 흠 — drainage/live 몸통에 auto 실음
- [배관 배치 초기화]도 같은 고름 · 답 = 관 초안 + 사진첩 한 걸음
- 검증_sub5 실측(live) — all 관 11 · 최대 간격 99 m · add 관 12 · 없음 = 세류선 관 1 + 후보 10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
This commit is contained in:
2026-10-17 12:11:58 +09:00
co-authored by Claude Opus 5.5
parent d816c7c647
commit a24494119f
4 changed files with 68 additions and 11 deletions
@@ -22,7 +22,7 @@ from fastapi.responses import JSONResponse
from B04_PreProcess.B04_PreProcess_Engine_Watershed_Analyze import preview_stages
from B04_PreProcess.B04_PreProcess_Engine_Watershed_Expand import AnalysisStopped
from B04_PreProcess.B04_PreProcess_Engine_Watershed_Export import drainage_dir
from B04_PreProcess.B04_PreProcess_Router_Basins import _build, _payload
from B04_PreProcess.B04_PreProcess_Router_Basins import AUTO_MODES, _build, _payload
from B04_PreProcess.B04_PreProcess_Router_Watershed import _prepare, router
from common_util.common_util_drainage_context import _open_sampler, load_drainage_context
from common_util.common_util_drainage_detail import RoadRouting
@@ -78,7 +78,8 @@ def live_routing(preview: Any, route_xy: list[tuple[float, float]], to_lonlat: A
async def post_drainage_live(
project_id: UUID, payload: dict[str, Any] | None = None
) -> dict[str, Any] | JSONResponse:
"""몸통 = {generation, route: RouteDraft | null(저장 노선), points: 관 목록 | null(자동)}."""
"""몸통 = {generation, route: RouteDraft | null(저장 노선),
points: 관 목록 | null(세류선 교차만), auto: [자동 제안] 방식(all · add · 369) | 없음}."""
body = payload or {}
generation = int(body.get("generation") or 0)
key = str(project_id)
@@ -87,6 +88,9 @@ async def post_drainage_live(
def superseded() -> bool:
return _LATEST_GENERATION.get(key) != generation
auto = body.get("auto")
if auto not in AUTO_MODES:
return JSONResponse(status_code=400, content={"status": "error", "message": "auto 틀림"})
try:
raw = body.get("points")
points = None if raw is None else parse_pipe_points(raw)
@@ -139,7 +143,7 @@ async def post_drainage_live(
[list(to_lonlat(x, y)) for x, y in line.coords] for line in preview.region.split.upstream
]
detail, carried = await asyncio.to_thread(
_build, context.stored_path, live, points, routing, upstream
lambda: _build(context.stored_path, live, points, routing, upstream, auto=auto)
)
if detail is None:
return JSONResponse(