feat(B07): 평면도 축척 여덟 · 실거리 상수 축척화 · 막힌 글 먼 자리(141-2)
- 축척 = 1/500 · 600 · 1,000 · 1,200(기본) · 2,500 · 3,000 · 5,000 · 6,000(지식DB 근거) - 비탈 눈금 간격 · 대피소 띄움 · 필지 버퍼 · 틈 = 1/1,200 실거리 × 축척 비(종이 거리 같게 · 1/6,000 눈금 10 m) - 글 후보가 다 막히면 기호에서 2 · 3 배 먼 자리 + 지시선 — 검증_sub8 1/6,000 겹친 쌍 55 → 4 - 시험 test_119 · test_141 늘림 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STqEqztUthVFBmEP18wBSz
This commit is contained in:
@@ -31,6 +31,7 @@ PARCEL_FILE = "연속지적도_bounds.geojson"
|
||||
EMD_FILE = "행정구역_읍면동_bounds.geojson"
|
||||
SGG_FILE = "행정구역_시군구_bounds.geojson"
|
||||
|
||||
# 실거리는 1/1,200 값 — 다른 축척은 종이 거리가 같게 늘이고 줄임(`mm` · 141-2)
|
||||
ROUTE_CLEAR_M = 5.0 # 라벨이 비켜 갈 노선 버퍼(중심선에서 m)
|
||||
_GAP_M = 2.0 # 지시선 끝과 상자 사이 틈(m)
|
||||
_RINGS = 5 # 후보 자리 고리 수
|
||||
@@ -131,7 +132,11 @@ def place_labels(
|
||||
mm: float = MM,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""필지마다 라벨 [{lines, anchor, center}] — 큰 필지부터 자리를 잡는다."""
|
||||
clear = LineString(route_xy).buffer(ROUTE_CLEAR_M) if len(route_xy) >= 2 else Polygon()
|
||||
stretch = MM / mm # 1/1,200 = 1
|
||||
gap = _GAP_M * stretch
|
||||
clear = (
|
||||
LineString(route_xy).buffer(ROUTE_CLEAR_M * stretch) if len(route_xy) >= 2 else Polygon()
|
||||
)
|
||||
shapely.prepare(clear)
|
||||
no_outline = not any(parcel["lines"] for parcel in parcels)
|
||||
placed: list[tuple[float, float, float, float]] = []
|
||||
@@ -149,8 +154,8 @@ def place_labels(
|
||||
chosen = None
|
||||
for ring in range(1, _RINGS + 1):
|
||||
for sx, sy in _DIRECTIONS:
|
||||
cx = ax + sx * (half_w + _GAP_M) * ring
|
||||
cy = ay + sy * (half_h + _GAP_M) * ring
|
||||
cx = ax + sx * (half_w + gap) * ring
|
||||
cy = ay + sy * (half_h + gap) * ring
|
||||
rect = (cx - half_w, cy - half_h, cx + half_w, cy + half_h)
|
||||
inside = (
|
||||
rect[0] >= box[0]
|
||||
|
||||
Reference in New Issue
Block a user