fix(765-3): 두 벌 = 같은 평면 노선 — 예상노선을 설계 지형으로 먼저 잘라 적고 다른 지형 벌도 그 노선으로 지음
- 검증_sub5 실측: 수치지형도 벌이 수치지형도로 자른 긴 노선(2110 m)으로 지어져 공유 예상노선(라이다로 자름 · 1377 m)과 어긋남 → 그 벌 [초기화] 뒤 초기 폴리라인이 예상노선(라이다)으로 다시 지어져 노선 1359.6 m · 종횡단 2110 m 로 갈림 - 예상노선(공유 · 추천 열쇠)은 하나 · 설계 지형으로 자름 → 옛 지형 칩처럼 평면 노선 같고 지형만 다름 - 다른 지형 벌 끝에 예상노선 지우던 길 걷음(먼저 적으니 필요 없음) - 시험 test_765_design_sets 체인 차례에 예상노선 먼저 적기 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -390,7 +390,6 @@ async def run_preprocess_chain(
|
||||
mark_designing,
|
||||
read_design_failure,
|
||||
)
|
||||
from common_util.common_util_route_geometry import expected_route_csv_path
|
||||
from common_util.common_util_storage import resolve_stored_project_path
|
||||
from common_util.common_util_surface_confirmation import (
|
||||
design_terrain,
|
||||
@@ -416,9 +415,9 @@ async def run_preprocess_chain(
|
||||
missing = "sheet" if design == "las" else "las"
|
||||
sets.note_unbuilt(root, missing, f"{missing} 지표면 모델 없음 — 한 벌만")
|
||||
else:
|
||||
# 예상노선(공유)은 설계 지형 벌이 씀 — 다른 지형으로 자른 것이 남지 않게
|
||||
expected = expected_route_csv_path(root)
|
||||
had_expected = expected.is_file()
|
||||
# 예상노선(공유 · 추천이 씀)은 설계 지형으로 자른 것 하나 — 먼저 적어 두면 두 벌이 같은
|
||||
# 평면 노선으로 지어짐(지형만 다름 · 다른 지형 벌 [초기화]도 같은 노선)
|
||||
await _seed_expected_route(project_id, root, params)
|
||||
try:
|
||||
async with pool.acquire() as connection:
|
||||
model_id = await sets.switch_terrain(connection, project_id, other)
|
||||
@@ -438,8 +437,6 @@ async def run_preprocess_chain(
|
||||
await sets.clear_active_set(connection, root, str(project_id))
|
||||
sets.note_unbuilt(root, other, f"짓기 오류: {exc}")
|
||||
finally:
|
||||
if not had_expected:
|
||||
expected.unlink(missing_ok=True)
|
||||
async with pool.acquire() as connection:
|
||||
await sets.switch_terrain(connection, project_id, design)
|
||||
marks.append((f"{other} 벌", time.perf_counter()))
|
||||
@@ -456,6 +453,26 @@ async def run_preprocess_chain(
|
||||
schedule_precompute(project_id) # 추천은 지형 · 예정노선만 씀 — 실패 길에도(763-3)
|
||||
|
||||
|
||||
async def _seed_expected_route(project_id: UUID, root: Path, surface: dict[str, Any]) -> None:
|
||||
"""예상노선 정본을 설계 지형으로 잘라 적음(없을 때만 · 자동 체인 2.5 와 같은 값)."""
|
||||
from common_util.common_util_route_geometry import expected_route_csv_path, write_route_csv
|
||||
from config.config_db import get_db_pool
|
||||
|
||||
path = expected_route_csv_path(root)
|
||||
if path.is_file():
|
||||
return
|
||||
async with get_db_pool().acquire() as connection, connection.cursor() as cursor:
|
||||
await cursor.execute(
|
||||
"SELECT route_start_m, route_end_m FROM projects WHERE id = %s", (str(project_id),)
|
||||
)
|
||||
row = await cursor.fetchone()
|
||||
points = await asyncio.to_thread(
|
||||
_planned_route_points_in_project_crs, root, surface, (row[0], row[1]) if row else None
|
||||
)
|
||||
if points:
|
||||
write_route_csv(path, points)
|
||||
|
||||
|
||||
async def _ensure_initial_polyline(
|
||||
project_id: UUID, project_root: Path, points: list[dict[str, float]]
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user