refactor(510-2 서버 자동 관 옛 길 걷음): auto all · add 갈래 걷음(부르는 곳 0 · detail-basins · drainage/live · build_detail · 저장본 열쇠 · computeDetailBasins 셋째 인자) · 전처리 첫 자동 관 그대로 · test_369 옛 all/add 시험 걷음 · test_b05_structures_router 이관 5 = 가짜 함수를 (legacy, standing) 쌍으로 맞춤

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 13:14:13 +09:00
co-authored by Claude Sonnet 5.5
parent 59c2907b73
commit 7b72dffd60
9 changed files with 39 additions and 144 deletions
+3 -8
View File
@@ -172,25 +172,20 @@ def build_detail(
confirmed_chainages: list[float] | None = None,
routing: RoadRouting | None = None,
upstream_lonlat: list[list[list[float]]] | None = None,
auto: str | None = None,
) -> DrainageDetail | None:
"""B04 분석 결과를 읽어 관 자리를 정하고 세부유역을 나눈다.
`confirmed_chainages`를 주면 그 위치를 관으로 확정하고(사용자 편집 · 빈 목록 = 관 0개), None 이면
B04의 기본 관(세류선 교차)만. 어느 쪽이든 격자 해석은 하지 않는다.
`auto`([자동 제안] · 369) — None = 위 그대로 · "all" = 기본 관 + 최대 간격 보충으로 다시
(확정 목록 무시) · "add" = 확정 목록 + 빈 구간 보충. 관 자리 후보는 어느 길이든 셈.
관 자리 후보(`pipe_candidates`)는 어느 길이든 셈 — [자동 제안](510)이 이 후보를 씀.
`routing` · `upstream_lonlat` 을 주면 파일 대신 그것(「지금 노선으로 셈」 메모리 결과 · 347-2).
"""
routing = routing or read_road_routing(directory)
if routing is None or len(vertices) < 2:
return None
if confirmed_chainages is not None and auto != "all":
if confirmed_chainages is not None:
pipes = pipes_from_chainages(vertices, confirmed_chainages)
if auto == "add":
pipes = [*pipes, *suggest_pipe_positions(vertices, pipes, routing.strength_curve)]
pipes.sort(key=lambda pipe: pipe.chainage_m)
else:
# 저장분의 기본 관은 누가거리만 신뢰한다 — 좌표는 현재 노선 위로 다시 찍는다.
base = [
@@ -203,7 +198,7 @@ def build_detail(
for pipe in routing.base_pipes
]
# 자동 관 자리 = 정수 m · 일반 측점 1 m 안이면 그 측점(234-1) — 확정본(위)은 단추로만
placed = place_pipes(vertices, base, routing.strength_curve, fill=auto is not None)
placed = place_pipes(vertices, base, routing.strength_curve, fill=False)
pipes = snap_candidates(placed, vertices)
if confirmed_chainages:
kept = pipes_from_chainages(vertices, confirmed_chainages)