From 31a5912833db389d2640875d5ba9d65b36da34c0 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Fri, 16 Oct 2026 11:37:57 +0900 Subject: [PATCH] =?UTF-8?q?feat(=EC=A7=80=ED=98=95=ED=91=9C=EB=B3=B8):=203?= =?UTF-8?q?46-1=20=EC=A7=80=EB=B0=98=EA=B3=A0=20=EC=9E=90=EB=A6=BF?= =?UTF-8?q?=EC=88=98=20=EC=B9=B8=20=E2=80=94=20/route/elevations=20decimal?= =?UTF-8?q?s(=EA=B8=B0=EB=B3=B8=203=20=C2=B7=200~6)=20=C2=B7=20=EA=B3=84?= =?UTF-8?q?=EC=82=B0=20=EB=AC=B6=EC=9D=8C=20=EC=84=9C=EB=B2=84=20=EA=B8=B8?= =?UTF-8?q?=EC=9D=80=206=EC=9E=90=EB=A6=AC=EB=A1=9C=20=EB=B6=80=EB=A6=84(?= =?UTF-8?q?=EA=B2=A9=EC=9E=90=20=EA=B8=B8=EA=B3=BC=20=EA=B0=99=EC=9D=80=20?= =?UTF-8?q?=EA=B0=92)=20=C2=B7=20=EC=8B=9C=ED=97=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Se7ytqbohmBQnfYpwYFnYf --- B05_Profile/B05_Profile_Api_TerrainGrid.ts | 4 +-- B05_Profile/B05_Profile_Router_Terrain.py | 6 ++++- .../tester/test_344_1_terrain_grid_route.py | 27 +++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/B05_Profile/B05_Profile_Api_TerrainGrid.ts b/B05_Profile/B05_Profile_Api_TerrainGrid.ts index 647f5dcad..14d5387c6 100644 --- a/B05_Profile/B05_Profile_Api_TerrainGrid.ts +++ b/B05_Profile/B05_Profile_Api_TerrainGrid.ts @@ -73,7 +73,7 @@ export function designTerrainGridNow(projectId: string): DesignTerrainGrid | nul /** 한 번에 물을 수 있는 점 수 — 서버 `MAX_POINTS` 와 같은 값. */ const ELEVATION_CHUNK = 4000; -/** 계산 묶음 ground 단계에 넣을 격자 · 서버 길(PLAN 346-1). 서버 길 값은 mm 자리(응답 그대로). */ +/** 계산 묶음 ground 단계에 넣을 격자 · 서버 길(PLAN 346-1). 서버 길도 소수 6자리 — 격자 길과 같은 값. */ export function groundStageDeps(projectId: string): Pick { return { grid: () => designTerrainGridNow(projectId), @@ -88,7 +88,7 @@ export function groundStageDeps(projectId: string): Pick return { "status": "success", "project_id": str(project_id), - "z": [None if not ok else round(float(value), 3) for value, ok in zip(z, valid)], + "z": [ + None if not ok else round(float(value), request.decimals) for value, ok in zip(z, valid) + ], "valid": [bool(ok) for ok in valid], } diff --git a/resources/tester/test_344_1_terrain_grid_route.py b/resources/tester/test_344_1_terrain_grid_route.py index 69476e550..05c363bc3 100644 --- a/resources/tester/test_344_1_terrain_grid_route.py +++ b/resources/tester/test_344_1_terrain_grid_route.py @@ -114,3 +114,30 @@ def test_받을_자리_서명은_manifest_구성과_평활(tmp_path): ) assert terrain_router._design_grid({**PARAMS, "method": "tin"}, models, confirmed) is None assert terrain_router._design_grid(PARAMS, models, None) is None + + +def test_지반고_자릿수_기본_3_묶음은_6(tmp_path, monkeypatch): + root = tmp_path + models = root / "B04_PreProcess" / "models" + models.mkdir(parents=True) + x = np.arange(0.0, 11.0) + np.savez( + models / "dtm_csf_smooth.npz", + x=x, + y=x, + z=np.add.outer(x * 0.0, x * 0.1234567), + valid_mask=np.ones((11, 11), dtype=bool), + ) + _patch(monkeypatch, root, None) + + async def params(_connection, _project_id): + return dict(PARAMS) + + monkeypatch.setattr(terrain_router, "get_surface_confirmation_params", params) + ask = terrain_router.ElevationRequest + plain = asyncio.run(terrain_router.read_route_elevations(PID, ask(points=[(5.5, 5.0)]))) + fine = asyncio.run( + terrain_router.read_route_elevations(PID, ask(points=[(5.5, 5.0)], decimals=6)) + ) + assert plain["z"] == [round(5.5 * 0.1234567, 3)] + assert fine["z"] == [round(5.5 * 0.1234567, 6)]