fix(B07): 용지도 구역이 한 필지 안이면 어느 필지인지 표기
- 필지 경계가 하나도 안 보이고 도곽을 통째로 감싼 필지가 있으면 정보 묶음 맨 위에 「구역 전체가 이 필지 안 (시군구 읍면동 리)」 한 줄 - 검증_sub4(용화리 국유림 산77-15임 한 필지 안): 화면에 안내 1개 + 지번·지목·면적·소유자 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013rJwJMVL4EE31y77TB11AP
This commit is contained in:
@@ -35,3 +35,45 @@ def test_one_label_group_per_parcel() -> None:
|
||||
e["shapeData"]["basePoint"]["x"] for e in texts if e["shapeData"]["label"] == "산1임"
|
||||
}
|
||||
assert split_x.pop() == pytest.approx(215.0 * MM)
|
||||
|
||||
|
||||
def test_zone_inside_one_parcel_is_named_once(tmp_path) -> None:
|
||||
"""작은 구역이 큰 필지 하나 안에 통째로 — 경계선이 없어도 어느 필지인지 한 번 적는다 (68-2)."""
|
||||
import json
|
||||
|
||||
from B07_DesignDetail.B07_DesignDetail_Router_Support_Basin import _clip_parcels
|
||||
|
||||
props = {
|
||||
"pnu": "P1",
|
||||
"sgg_nm": "봉화군",
|
||||
"emd_nm": "재산면",
|
||||
"ri_nm": "갈산리",
|
||||
"jibun": "산77-1임",
|
||||
"jimok": "임야",
|
||||
"parea": 1234567,
|
||||
"owner_nm": "국",
|
||||
}
|
||||
big = [[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]
|
||||
geojson = {
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"properties": props,
|
||||
"geometry": {"type": "Polygon", "coordinates": [big]},
|
||||
}
|
||||
],
|
||||
}
|
||||
path = tmp_path / "parcels.geojson"
|
||||
path.write_text(json.dumps(geojson, ensure_ascii=False), encoding="utf-8")
|
||||
parcels = _clip_parcels(path, "EPSG:4326", (4.0, 4.0, 6.0, 6.0))
|
||||
assert len(parcels) == 1 and parcels[0]["ring"] == []
|
||||
|
||||
route = [(4.5, 4.5), (5.5, 5.5)]
|
||||
drawing = build_landuse_drawing("landuse", "용지도", route, [], parcels, [], [])
|
||||
labels = [
|
||||
e["shapeData"]["label"] for e in drawing["entities"] if e.get("layerId") == JIBUN_LAYER_ID
|
||||
]
|
||||
notes = [label for label in labels if label.startswith("구역 전체가 이 필지 안")]
|
||||
assert notes == ["구역 전체가 이 필지 안 (봉화군 재산면 갈산리)"]
|
||||
assert labels[1:] == ["산77-1임", "임야", "1,234,567㎡", "국"]
|
||||
|
||||
Reference in New Issue
Block a user