fix(505-1 B05): 추천 노선 미리 셈 = 전처리 체인에서만 · 프로젝트 접근은 저장본 읽기만
- B05 열기(GET /route/plan) 미리 셈 예약 걷음 · 체인 쪽(업로드 · B04 재확정 · B01 사용 범위) 그대로 - 추천 창 기본 갈래(기본 다섯 · 저장 제약 · 종단 켬 · 설계 지형) = 저장본만 · 없으면 409 「전처리를 다시 하면 생깁니다」(판 글 · 토스트) - 사용자가 바꾼 제약 · 비중 · 종단 끔 · 다른 분석 지형 · [재계산] = 그 자리 셈 - 화면이 실은 분석 지형이 설계 지형과 같으면 설계 지형으로 봄 - 저장본 꺼내기 path.touch 걷음 · 초기 종단 지문 노선 파일 칸 걷음(셈이 안 읽음) · 초기 종단 지문 함수 캐시 - B04 _prepare 재투영 · 피클 읽기 · followed_pipes 스레드로 - 시험 test_309_3 새로 · 224_3 · 364_4 · 476_1 새 규칙에 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -238,13 +238,23 @@ async def _prepare(project_id: UUID) -> dict[str, Any] | JSONResponse:
|
||||
)
|
||||
|
||||
# 설계 계통과 같은 프로젝트 좌표계로 맞춘다. 도엽 재투영도 이 좌표계로 간다.
|
||||
source_crs = resolve_project_crs(project_root, route_crs_input=planned.crs_input, db_epsg=epsg)
|
||||
to_lonlat_transformer = Transformer.from_crs(source_crs, "EPSG:4326", always_xy=True)
|
||||
to_metric_transformer = Transformer.from_crs("EPSG:4326", source_crs, always_xy=True)
|
||||
def sheets() -> tuple[Transformer, list[dict[str, Any]], list[dict[str, Any]], str]:
|
||||
source_crs = resolve_project_crs(
|
||||
project_root, route_crs_input=planned.crs_input, db_epsg=epsg
|
||||
)
|
||||
to_metric_transformer = Transformer.from_crs("EPSG:4326", source_crs, always_xy=True)
|
||||
return (
|
||||
Transformer.from_crs(source_crs, "EPSG:4326", always_xy=True),
|
||||
*_metric_sheets(
|
||||
_sheet_dir(stored_path),
|
||||
drainage_dir(stored_path),
|
||||
source_crs,
|
||||
to_metric_transformer,
|
||||
),
|
||||
)
|
||||
|
||||
streams, contour_features, contour_key = _metric_sheets(
|
||||
_sheet_dir(stored_path), drainage_dir(stored_path), source_crs, to_metric_transformer
|
||||
)
|
||||
# 재투영(저장본 없으면 3.8 s) · 피클 읽기는 스레드로 — 이벤트 루프를 안 막음(505-1)
|
||||
to_lonlat_transformer, streams, contour_features, contour_key = await asyncio.to_thread(sheets)
|
||||
return {
|
||||
"route_source": route_file.name,
|
||||
"vertices": planned.vertices,
|
||||
|
||||
Reference in New Issue
Block a user