diff --git a/B05_wf2_Route/B05_wf2_Route_Router_Drainage.py b/B05_wf2_Route/B05_wf2_Route_Router_Drainage.py index fabb361a..359fe649 100644 --- a/B05_wf2_Route/B05_wf2_Route_Router_Drainage.py +++ b/B05_wf2_Route/B05_wf2_Route_Router_Drainage.py @@ -123,7 +123,10 @@ async def _prepare(project_id: UUID) -> dict[str, Any] | JSONResponse: content={"status": "error", "message": "확정된 경로가 없습니다."}, ) points = await get_route_points(connection, int(route["id"])) - epsg = await get_surface_crs_epsg(connection, project_id) + surface_model_id = route.get("surface_model_id") + epsg = await get_surface_crs_epsg( + connection, project_id, int(surface_model_id) if surface_model_id else 0 + ) vertices = build_route_vertices(points) if len(vertices) < 2: @@ -132,7 +135,7 @@ async def _prepare(project_id: UUID) -> dict[str, Any] | JSONResponse: content={"status": "error", "message": "노선 좌표가 부족합니다."}, ) - source_crs = epsg or "EPSG:5186" + source_crs = f"EPSG:{epsg}" if epsg else "EPSG:5186" 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)