feat(b07): 평면도 종류마다 축척 고르기 — 1/600 · 1/1,000 · 1/1,200 기본 · 유역도 1/6,000 고정(119-1)
- 종류 파일 scale(없거나 목록 밖이면 1200) · 추가 · 업데이트 인자 · 목록 밖 거절 - 장 나눔 · 도곽 범위 · 배경 절취 · 축척 글 · 도곽 칸 · IP 표 · 필지 라벨 · 측점 눈금 실거리 환산이 축척 따라감(함수 인자) - 「종류」 폼에 공용 「축척」 고르기 · 유역도 양식은 잠금 표시 - 시험 test_119_b07_plan_scale 새로 · test_b07_plan_kinds 종류 dict 에 scale Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
This commit is contained in:
@@ -128,6 +128,7 @@ def place_labels(
|
||||
parcels: list[dict[str, Any]],
|
||||
route_xy: list[tuple[float, float]],
|
||||
box: tuple[float, float, float, float],
|
||||
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()
|
||||
@@ -142,7 +143,7 @@ def place_labels(
|
||||
if not any(lines):
|
||||
continue
|
||||
width_mm, height_mm = balloon_size(lines, PARCEL_FONT)
|
||||
half_w, half_h = width_mm / MM / 2.0, height_mm / MM / 2.0
|
||||
half_w, half_h = width_mm / mm / 2.0, height_mm / mm / 2.0
|
||||
ax, ay = _anchor(parcel["area"], clear)
|
||||
free_of_route: tuple[float, float, float, float] | None = None
|
||||
chosen = None
|
||||
@@ -189,12 +190,14 @@ def place_labels(
|
||||
return items
|
||||
|
||||
|
||||
def label_rects(items: list[dict[str, Any]]) -> list[tuple[float, float, float, float]]:
|
||||
def label_rects(
|
||||
items: list[dict[str, Any]], mm: float = MM
|
||||
) -> list[tuple[float, float, float, float]]:
|
||||
"""필지 정보 상자 자리(사업지 m) — 그리는 상자(`_balloon_entities`)와 같은 크기."""
|
||||
rects = []
|
||||
for item in items:
|
||||
width_mm, height_mm = balloon_size(item["lines"], PARCEL_FONT)
|
||||
half_w, half_h = width_mm / MM / 2.0, height_mm / MM / 2.0
|
||||
half_w, half_h = width_mm / mm / 2.0, height_mm / mm / 2.0
|
||||
cx, cy = item["center"]
|
||||
rects.append((cx - half_w, cy - half_h, cx + half_w, cy + half_h))
|
||||
return rects
|
||||
@@ -205,13 +208,14 @@ def landuse_pieces(
|
||||
crs: str,
|
||||
box: tuple[float, float, float, float],
|
||||
route_xy: list[tuple[float, float]],
|
||||
mm: float = MM,
|
||||
) -> dict[str, dict[str, Any]]:
|
||||
"""그 장의 용지 조각 넷 — 노선은 라벨이 비켜 갈 전체 중심선(사업지 m)."""
|
||||
folder = project_root / "B04_PreProcess" / "processed"
|
||||
parcels = clip_parcels(folder / PARCEL_FILE, crs, box)
|
||||
return {
|
||||
"parcel": {"lines": [line for parcel in parcels for line in parcel["lines"]]},
|
||||
"parcel_info": {"items": place_labels(parcels, route_xy, box)},
|
||||
"parcel_info": {"items": place_labels(parcels, route_xy, box, mm)},
|
||||
"emd": {"lines": _clip_rings(folder / EMD_FILE, crs, box)},
|
||||
"sgg": {"lines": _clip_rings(folder / SGG_FILE, crs, box)},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user