fix(B04): 배수유역·유입·배수 컨텍스트도 shapefile 노선을 읽게 한다
실측(2026-08-31): 업로드 후 화면에서 "계획 노선 CSV를 읽지 못했습니다: ...shp" 경고가 반복됐다. find_planned_route_file 은 shapefile을 우선 돌려주는데 받는 쪽이 아직 read_planned_route_csv 였다 - 확장자 분기가 없는 판독기라 .shp 를 CSV로 열다 실패하고 노선 없이 진행했다. 앞선 커밋에서 Service_Chain, SheetSurface, Router_GIS 는 바꿨으나 아래 세 곳을 놓쳤다(조사 당시 grep 출력이 잘려 목록에서 빠졌다): - B04_PreProcess_Router_Watershed.py (2곳) - B04_PreProcess_Router_Inflow.py - common_util_drainage_context.py 셋 다 read_planned_route 로 바꿨다 - CSV/shapefile을 확장자로 갈라 읽는다. 검증: ruff check 통과, tmp/tests 302 passed (잔여 실패 11건은 기존 실패로 HEAD 사본에서 동일 재현). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ from B05_Profile.B05_Profile_Repository import get_surface_crs_epsg
|
||||
from common_util.common_util_route_geometry import (
|
||||
StructureCandidate,
|
||||
find_planned_route_file,
|
||||
read_planned_route_csv,
|
||||
read_planned_route,
|
||||
)
|
||||
from common_util.common_util_storage import resolve_stored_project_path
|
||||
from common_util.common_util_wamis_rainfall import (
|
||||
@@ -172,7 +172,7 @@ async def _prepare(project_id: UUID) -> dict[str, Any] | JSONResponse:
|
||||
status_code=404,
|
||||
content={"status": "error", "message": "계획 노선 파일이 업로드되지 않았습니다."},
|
||||
)
|
||||
planned = read_planned_route_csv(route_file)
|
||||
planned = read_planned_route(route_file)
|
||||
if planned is None or len(planned.vertices) < 2:
|
||||
return JSONResponse(
|
||||
status_code=400,
|
||||
@@ -246,7 +246,7 @@ def _route_center_lonlat(stored_path: str, fallback_epsg: int | None) -> tuple[f
|
||||
route_file = find_planned_route_file(_route_input_dir(stored_path))
|
||||
if route_file is None:
|
||||
return None
|
||||
planned = read_planned_route_csv(route_file)
|
||||
planned = read_planned_route(route_file)
|
||||
if planned is None or not planned.vertices:
|
||||
return None
|
||||
middle = planned.vertices[len(planned.vertices) // 2]
|
||||
|
||||
Reference in New Issue
Block a user