feat(D03 지도 겹): 받은 산림 · 환경 자료 겹 다섯 화면 — 국유림 임도 · 산림입지도 · 경제림 · 생태자연도 · 산사태 = 서버 줌별 조각 고정 소스 · 범례 · 받는 동안 서클 (PLAN 622-2 · 요구 529)
- 공용 부품 tileSource(벡터 pbf · 그림 png) 덧 · 새 파일 UI_ForestLayers(꼴 · 소스 · 범례 · 토양 무리 색) - 산림입지도 그림 = forest_soil 조각(z10 이상) · 브이월드 받기 · 요약 그대로 · 범례 · 옛 캔버스 색 = 같은 토양 무리 색 - 산사태위험 GL = 조각 그림(받기 없음) · 옛 캔버스 = 받은 범위 한 장 그대로(끌 때 받음) - 새 겹 셋(국유림 임도 · 경제림 · 생태자연도) 처음 끔 · 옛 캔버스엔 안 보임 · 색 토큰 --draw-map-* 덧 · 아이콘 trees · plant 덧 - UI_Layers 688 → 680 줄(GL 글꼴 미리 받기 = UI_MapGl 로 · 브이월드 토양 GL 꼬리표 뺌) - 지킴 시험 test_622_2_forest_layers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
"""PLAN 622-2 — 예정노선 받은 산림 · 환경 자료 겹 다섯(국유림 임도 · 산림입지도 · 경제림 · 생태자연도 · 산사태) 화면 지킴.
|
||||
|
||||
./venv/Scripts/python.exe -m pytest resources/tester/test_622_2_forest_layers.py -q
|
||||
"""
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
D03 = ROOT / "D03_PlanAnalysis"
|
||||
|
||||
|
||||
def _read(path: Path) -> str:
|
||||
return path.read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_fixed_sources_follow_plan_622_routes() -> None:
|
||||
gl = _read(ROOT / "ui_template" / "ui_template_gl_map.ts")
|
||||
assert "export function tileSource" in gl
|
||||
assert "/plan/${path}/{z}/{x}/{y}.${ext}" in gl
|
||||
forest = _read(D03 / "D03_PlanAnalysis_UI_ForestLayers.ts")
|
||||
for name in ("forest_road", "forest_soil", "eco_forest"):
|
||||
assert f'vt("{name}")' in forest
|
||||
assert f'...vector("{name}")' in forest or f'"source-layer": "{name}"' in forest
|
||||
for name in ("ecology", "landslide"):
|
||||
assert f'wmt("{name}")' in forest
|
||||
assert '`vt/${name}`, "pbf", 8, 15' in forest and '`wmt/${name}`, "png", 6, 19' in forest
|
||||
assert "minzoom: 10" in forest # 산림입지도 z10 아래 숨김
|
||||
base = _read(D03 / "D03_PlanAnalysis_UI_MapGl.ts")
|
||||
assert "...forestSources(projectId)" in base
|
||||
assert 'raster("landslide"' not in base # 산사태 = 조각(한 장 GL 그림 없음)
|
||||
assert "TRACKED_SOURCES.includes(event.sourceId)" in base # 받는 동안 서클
|
||||
|
||||
|
||||
def test_layer_list_five_off_by_default() -> None:
|
||||
defs = _read(D03 / "D03_PlanAnalysis_UI_LayerDefs.ts")
|
||||
icons = _read(ROOT / "ui_template" / "ui_template_icons.ts")
|
||||
for key in ("nationalRoad", "soils", "ecoForest", "ecology", "landslide"):
|
||||
entry = re.search(rf'key: "{key}",\s*icon: "(\w+)",[^}}]*on: (\w+)', defs)
|
||||
assert entry and entry.group(2) == "false", key
|
||||
assert re.search(rf"^\s+{entry.group(1)}:", icons, re.M), entry.group(1)
|
||||
|
||||
|
||||
def test_colors_are_draw_map_tokens() -> None:
|
||||
theme = _read(ROOT / "ui_template" / "ui_template_theme.css")
|
||||
forest = _read(D03 / "D03_PlanAnalysis_UI_ForestLayers.ts")
|
||||
for token in set(re.findall(r'"(--draw-map-[\w-]+)"', forest)):
|
||||
assert f"{token}:" in theme, token
|
||||
assert all(f"--draw-map-soil-{n}:" in theme for n in range(1, 7))
|
||||
assert not re.search(r"#[0-9a-fA-F]{6}\b(?!\")", forest) # 색 = 토큰(뒷값만 글)
|
||||
|
||||
|
||||
def test_canvas_keeps_old_landslide_and_layers_file_not_grown() -> None:
|
||||
layers = _read(D03 / "D03_PlanAnalysis_UI_Layers.ts")
|
||||
assert len(layers.splitlines()) <= 688
|
||||
assert '(glOn && key === "landslide")' in layers # GL = 조각 · 받기 없음
|
||||
assert "if (!glOn) void Promise.all(LAYERS.map((def) => ensure(def.key)))" in layers
|
||||
paint = _read(D03 / "D03_PlanAnalysis_UI_LayerPaint.ts")
|
||||
assert "drawRaster(context, map, data.landslide);" in paint # 옛 캔버스 = 한 장 그대로
|
||||
Reference in New Issue
Block a user