fix(D03 겹): 지적도 열쇠 상자 반올림 뺌 — 같은 범위인데 겹 켤 때마다 다시 받던 것 (PLAN 569-1)
- 열쇠 상자를 소수 셋째 자리로 줄여 받은 범위를 못 덮는다고 봄 → 실제 값 그대로 저장 - 시험: 소수 끝자리까지 같은 상자 두 번 = 한 번만 받음 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user