From 42b63663fa7f0d6ecd7d5d478d7b408c82ebacba Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 28 Oct 2026 07:04:03 +0900 Subject: [PATCH] =?UTF-8?q?fix(D03=20=EA=B2=B9):=20=EC=A7=80=EC=A0=81?= =?UTF-8?q?=EB=8F=84=20=EC=97=B4=EC=87=A0=20=EC=83=81=EC=9E=90=20=EB=B0=98?= =?UTF-8?q?=EC=98=AC=EB=A6=BC=20=EB=BA=8C=20=E2=80=94=20=EA=B0=99=EC=9D=80?= =?UTF-8?q?=20=EB=B2=94=EC=9C=84=EC=9D=B8=EB=8D=B0=20=EA=B2=B9=20=EC=BC=A4?= =?UTF-8?q?=20=EB=95=8C=EB=A7=88=EB=8B=A4=20=EB=8B=A4=EC=8B=9C=20=EB=B0=9B?= =?UTF-8?q?=EB=8D=98=20=EA=B2=83=20(PLAN=20569-1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 열쇠 상자를 소수 셋째 자리로 줄여 받은 범위를 못 덮는다고 봄 → 실제 값 그대로 저장 - 시험: 소수 끝자리까지 같은 상자 두 번 = 한 번만 받음 Co-Authored-By: Claude Opus 5.5 --- D03_PlanAnalysis/D03_PlanAnalysis_Layers.py | 2 +- resources/tester/test_569_1_plan_layers.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/D03_PlanAnalysis/D03_PlanAnalysis_Layers.py b/D03_PlanAnalysis/D03_PlanAnalysis_Layers.py index 2e0b531a1..3e01d1ddc 100644 --- a/D03_PlanAnalysis/D03_PlanAnalysis_Layers.py +++ b/D03_PlanAnalysis/D03_PlanAnalysis_Layers.py @@ -181,7 +181,7 @@ def ensure_cadastral(processed: Path, box: Box, epsg: int) -> dict[str, Any]: atomic_write_json( key_path, { - "box": [round(v, 3) for v in box], + "box": [float(v) for v in box], "epsg": int(epsg), "count": len(features), "failed": failed, diff --git a/resources/tester/test_569_1_plan_layers.py b/resources/tester/test_569_1_plan_layers.py index d6a057a32..56fdf0019 100644 --- a/resources/tester/test_569_1_plan_layers.py +++ b/resources/tester/test_569_1_plan_layers.py @@ -112,6 +112,13 @@ def test_cadastral_fetch_once_then_grow(tmp_path, monkeypatch) -> None: assert fake.calls == 15 + 18 # 넓어지면 상자 통째로 다시(5.2 km = 6 × 3 조각) +def test_cadastral_same_odd_box_kept(tmp_path, monkeypatch) -> None: + monkeypatch.setattr(layers, "request_vworld_wfs", FakeWfs()) + odd = (243862.86880613962, 544271.5644142976, 245002.02265078452, 545528.8660732408) + assert layers.ensure_cadastral(tmp_path, odd, EPSG)["fetched"] + assert not layers.ensure_cadastral(tmp_path, odd, EPSG)["fetched"] # 소수 끝자리까지 같은 상자 + + def test_cadastral_failures(tmp_path, monkeypatch) -> None: monkeypatch.setattr(layers, "request_vworld_wfs", FakeWfs(fail=99)) with pytest.raises(RuntimeError):