fix(B04·B05): 위성 메타 TM 격자를 상자 둘레 한 폭씩 넓힘 — 25×25 (PLAN 589-1)

- 도엽이 위성 상자 밖 0.8 폭까지 나가 9×9 격자 늘려 씀 자리에서 0.33 m 어긋남(화면 실측)
- 격자 범위 = 상자 ± 한 폭(3 × 3 폭) · 상자 안 칸 크기 그대로(8 등분) · 격자 자기 경위도 범위 칸 더함
- 지킴 시험 = 상자 밖 0.9 폭까지 pyproj 0.02 m 안

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 20:54:08 +09:00
co-authored by Claude Opus 5.5
parent ba18b0f96d
commit 9c2b5e151b
4 changed files with 70 additions and 44 deletions
@@ -61,8 +61,8 @@ export function normOfLonLat(normalizer: Normalizer, lon: number, lat: number):
}
/**
* 경위도 → TM 정규화(589-1) — 서버 `tm_grid`(그림 상자 경위도 고른 마디의 TM 값) 쌍선형 →
* `((x − x_min)/W, 1 − (y − y_min)/H)` = `metricToScreen` 과 같은 자. 상자 밖은 가장자리 칸을 늘려 씀.
* 경위도 → TM 정규화(589-1) — 서버 `tm_grid`(그림 상자 둘레 경위도 고른 마디의 TM 값) 쌍선형 →
* `((x − x_min)/W, 1 − (y − y_min)/H)` = `metricToScreen` 과 같은 자. 격자 밖은 가장자리 칸을 늘려 씀.
* 격자가 없거나 모양이 틀리면 null.
*/
export function tmGridNormOf(
@@ -73,13 +73,13 @@ export function tmGridNormOf(
if (!grid || n < 2 || grid.x.length !== n * n || grid.y.length !== n * n) return null;
const { x: gx, y: gy } = grid;
const cells = n - 1;
const lonRange = meta.lon_max - meta.lon_min || 1;
const latRange = meta.lat_max - meta.lat_min || 1;
const lonRange = grid.lon_max - grid.lon_min || 1;
const latRange = grid.lat_max - grid.lat_min || 1;
const spanX = meta.width_meters || 1;
const spanY = meta.height_meters || 1;
return (lon, lat) => {
const u = ((lon - meta.lon_min) / lonRange) * cells;
const v = ((lat - meta.lat_min) / latRange) * cells;
const u = ((lon - grid.lon_min) / lonRange) * cells;
const v = ((lat - grid.lat_min) / latRange) * cells;
const i = Math.min(Math.max(Math.floor(u), 0), cells - 1);
const j = Math.min(Math.max(Math.floor(v), 0), cells - 1);
const fu = u - i;