@maplat/transform 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,227 +1,217 @@
1
- var at = Object.defineProperty;
2
- var ct = (t, e, r) => e in t ? at(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var x = (t, e, r) => ct(t, typeof e != "symbol" ? e + "" : e, r);
4
- function tt(t, e, r = {}) {
1
+ function ot(r, t, e = {}) {
5
2
  const n = { type: "Feature" };
6
- return (r.id === 0 || r.id) && (n.id = r.id), r.bbox && (n.bbox = r.bbox), n.properties = e || {}, n.geometry = t, n;
3
+ return (e.id === 0 || e.id) && (n.id = e.id), e.bbox && (n.bbox = e.bbox), n.properties = t || {}, n.geometry = r, n;
7
4
  }
8
- function X(t, e, r = {}) {
9
- if (!t)
5
+ function X(r, t, e = {}) {
6
+ if (!r)
10
7
  throw new Error("coordinates is required");
11
- if (!Array.isArray(t))
8
+ if (!Array.isArray(r))
12
9
  throw new Error("coordinates must be an Array");
13
- if (t.length < 2)
10
+ if (r.length < 2)
14
11
  throw new Error("coordinates must be at least 2 numbers long");
15
- if (!z(t[0]) || !z(t[1]))
12
+ if (!j(r[0]) || !j(r[1]))
16
13
  throw new Error("coordinates must contain numbers");
17
- return tt({
14
+ return ot({
18
15
  type: "Point",
19
- coordinates: t
20
- }, e, r);
16
+ coordinates: r
17
+ }, t, e);
21
18
  }
22
- function et(t, e, r = {}) {
23
- for (const c of t) {
24
- if (c.length < 4)
19
+ function D(r, t, e = {}) {
20
+ for (const s of r) {
21
+ if (s.length < 4)
25
22
  throw new Error(
26
23
  "Each LinearRing of a Polygon must have 4 or more Positions."
27
24
  );
28
- if (c[c.length - 1].length !== c[0].length)
25
+ if (s[s.length - 1].length !== s[0].length)
29
26
  throw new Error("First and last Position are not equivalent.");
30
- for (let i = 0; i < c[c.length - 1].length; i++)
31
- if (c[c.length - 1][i] !== c[0][i])
27
+ for (let i = 0; i < s[s.length - 1].length; i++)
28
+ if (s[s.length - 1][i] !== s[0][i])
32
29
  throw new Error("First and last Position are not equivalent.");
33
30
  }
34
- return tt({
31
+ return ot({
35
32
  type: "Polygon",
36
- coordinates: t
37
- }, e, r);
33
+ coordinates: r
34
+ }, t, e);
38
35
  }
39
- function F(t, e = {}) {
40
- const r = { type: "FeatureCollection" };
41
- return e.id && (r.id = e.id), e.bbox && (r.bbox = e.bbox), r.features = t, r;
36
+ function U(r, t = {}) {
37
+ const e = { type: "FeatureCollection" };
38
+ return t.id && (e.id = t.id), t.bbox && (e.bbox = t.bbox), e.features = r, e;
42
39
  }
43
- function z(t) {
44
- return !isNaN(t) && t !== null && !Array.isArray(t);
40
+ function j(r) {
41
+ return !isNaN(r) && r !== null && !Array.isArray(r);
45
42
  }
46
- function ut(t) {
47
- if (!t)
43
+ function lt(r) {
44
+ if (!r)
48
45
  throw new Error("coord is required");
49
- if (!Array.isArray(t)) {
50
- if (t.type === "Feature" && t.geometry !== null && t.geometry.type === "Point")
51
- return [...t.geometry.coordinates];
52
- if (t.type === "Point")
53
- return [...t.coordinates];
54
- }
55
- if (Array.isArray(t) && t.length >= 2 && !Array.isArray(t[0]) && !Array.isArray(t[1]))
56
- return [...t];
46
+ if (!Array.isArray(r)) {
47
+ if (r.type === "Feature" && r.geometry !== null && r.geometry.type === "Point")
48
+ return [...r.geometry.coordinates];
49
+ if (r.type === "Point")
50
+ return [...r.coordinates];
51
+ }
52
+ if (Array.isArray(r) && r.length >= 2 && !Array.isArray(r[0]) && !Array.isArray(r[1]))
53
+ return [...r];
57
54
  throw new Error("coord must be GeoJSON Point or an Array of numbers");
58
55
  }
59
- function G(t) {
60
- if (Array.isArray(t))
61
- return t;
62
- if (t.type === "Feature") {
63
- if (t.geometry !== null)
64
- return t.geometry.coordinates;
65
- } else if (t.coordinates)
66
- return t.coordinates;
56
+ function J(r) {
57
+ if (Array.isArray(r))
58
+ return r;
59
+ if (r.type === "Feature") {
60
+ if (r.geometry !== null)
61
+ return r.geometry.coordinates;
62
+ } else if (r.coordinates)
63
+ return r.coordinates;
67
64
  throw new Error(
68
65
  "coords must be GeoJSON Feature, Geometry Object or an Array"
69
66
  );
70
67
  }
71
- function ft(t) {
72
- return t.type === "Feature" ? t.geometry : t;
73
- }
74
- const R = 11102230246251565e-32, P = 134217729, dt = (3 + 8 * R) * R;
75
- function V(t, e, r, n, c) {
76
- let i, u, g, h, l = e[0], y = n[0], o = 0, f = 0;
77
- y > l == y > -l ? (i = l, l = e[++o]) : (i = y, y = n[++f]);
78
- let b = 0;
79
- if (o < t && f < r)
80
- for (y > l == y > -l ? (u = l + i, g = i - (u - l), l = e[++o]) : (u = y + i, g = i - (u - y), y = n[++f]), i = u, g !== 0 && (c[b++] = g); o < t && f < r; )
81
- y > l == y > -l ? (u = i + l, h = u - i, g = i - (u - h) + (l - h), l = e[++o]) : (u = i + y, h = u - i, g = i - (u - h) + (y - h), y = n[++f]), i = u, g !== 0 && (c[b++] = g);
82
- for (; o < t; )
83
- u = i + l, h = u - i, g = i - (u - h) + (l - h), l = e[++o], i = u, g !== 0 && (c[b++] = g);
84
- for (; f < r; )
85
- u = i + y, h = u - i, g = i - (u - h) + (y - h), y = n[++f], i = u, g !== 0 && (c[b++] = g);
86
- return (i !== 0 || b === 0) && (c[b++] = i), b;
87
- }
88
- function ht(t, e) {
89
- let r = e[0];
90
- for (let n = 1; n < t; n++) r += e[n];
91
- return r;
68
+ function dt(r) {
69
+ return r.type === "Feature" ? r.geometry : r;
70
+ }
71
+ const N = 11102230246251565e-32, E = 134217729, yt = (3 + 8 * N) * N;
72
+ function Y(r, t, e, n, s) {
73
+ let i, o, u, d, f = t[0], m = n[0], a = 0, l = 0;
74
+ m > f == m > -f ? (i = f, f = t[++a]) : (i = m, m = n[++l]);
75
+ let g = 0;
76
+ if (a < r && l < e)
77
+ for (m > f == m > -f ? (o = f + i, u = i - (o - f), f = t[++a]) : (o = m + i, u = i - (o - m), m = n[++l]), i = o, u !== 0 && (s[g++] = u); a < r && l < e; )
78
+ m > f == m > -f ? (o = i + f, d = o - i, u = i - (o - d) + (f - d), f = t[++a]) : (o = i + m, d = o - i, u = i - (o - d) + (m - d), m = n[++l]), i = o, u !== 0 && (s[g++] = u);
79
+ for (; a < r; )
80
+ o = i + f, d = o - i, u = i - (o - d) + (f - d), f = t[++a], i = o, u !== 0 && (s[g++] = u);
81
+ for (; l < e; )
82
+ o = i + m, d = o - i, u = i - (o - d) + (m - d), m = n[++l], i = o, u !== 0 && (s[g++] = u);
83
+ return (i !== 0 || g === 0) && (s[g++] = i), g;
84
+ }
85
+ function mt(r, t) {
86
+ let e = t[0];
87
+ for (let n = 1; n < r; n++) e += t[n];
88
+ return e;
92
89
  }
93
- function Y(t) {
94
- return new Float64Array(t);
95
- }
96
- const gt = (3 + 16 * R) * R, lt = (2 + 12 * R) * R, yt = (9 + 64 * R) * R * R, U = Y(4), j = Y(8), J = Y(12), K = Y(16), S = Y(4);
97
- function bt(t, e, r, n, c, i, u) {
98
- let g, h, l, y, o, f, b, p, d, a, s, m, M, v, _, w, A, O;
99
- const k = t - c, T = r - c, I = e - i, N = n - i;
100
- v = k * N, f = P * k, b = f - (f - k), p = k - b, f = P * N, d = f - (f - N), a = N - d, _ = p * a - (v - b * d - p * d - b * a), w = I * T, f = P * I, b = f - (f - I), p = I - b, f = P * T, d = f - (f - T), a = T - d, A = p * a - (w - b * d - p * d - b * a), s = _ - A, o = _ - s, U[0] = _ - (s + o) + (o - A), m = v + s, o = m - v, M = v - (m - o) + (s - o), s = M - w, o = M - s, U[1] = M - (s + o) + (o - w), O = m + s, o = O - m, U[2] = m - (O - o) + (s - o), U[3] = O;
101
- let C = ht(4, U), W = lt * u;
102
- if (C >= W || -C >= W || (o = t - k, g = t - (k + o) + (o - c), o = r - T, l = r - (T + o) + (o - c), o = e - I, h = e - (I + o) + (o - i), o = n - N, y = n - (N + o) + (o - i), g === 0 && h === 0 && l === 0 && y === 0) || (W = yt * u + dt * Math.abs(C), C += k * y + N * g - (I * l + T * h), C >= W || -C >= W)) return C;
103
- v = g * N, f = P * g, b = f - (f - g), p = g - b, f = P * N, d = f - (f - N), a = N - d, _ = p * a - (v - b * d - p * d - b * a), w = h * T, f = P * h, b = f - (f - h), p = h - b, f = P * T, d = f - (f - T), a = T - d, A = p * a - (w - b * d - p * d - b * a), s = _ - A, o = _ - s, S[0] = _ - (s + o) + (o - A), m = v + s, o = m - v, M = v - (m - o) + (s - o), s = M - w, o = M - s, S[1] = M - (s + o) + (o - w), O = m + s, o = O - m, S[2] = m - (O - o) + (s - o), S[3] = O;
104
- const it = V(4, U, 4, S, j);
105
- v = k * y, f = P * k, b = f - (f - k), p = k - b, f = P * y, d = f - (f - y), a = y - d, _ = p * a - (v - b * d - p * d - b * a), w = I * l, f = P * I, b = f - (f - I), p = I - b, f = P * l, d = f - (f - l), a = l - d, A = p * a - (w - b * d - p * d - b * a), s = _ - A, o = _ - s, S[0] = _ - (s + o) + (o - A), m = v + s, o = m - v, M = v - (m - o) + (s - o), s = M - w, o = M - s, S[1] = M - (s + o) + (o - w), O = m + s, o = O - m, S[2] = m - (O - o) + (s - o), S[3] = O;
106
- const st = V(it, j, 4, S, J);
107
- v = g * y, f = P * g, b = f - (f - g), p = g - b, f = P * y, d = f - (f - y), a = y - d, _ = p * a - (v - b * d - p * d - b * a), w = h * l, f = P * h, b = f - (f - h), p = h - b, f = P * l, d = f - (f - l), a = l - d, A = p * a - (w - b * d - p * d - b * a), s = _ - A, o = _ - s, S[0] = _ - (s + o) + (o - A), m = v + s, o = m - v, M = v - (m - o) + (s - o), s = M - w, o = M - s, S[1] = M - (s + o) + (o - w), O = m + s, o = O - m, S[2] = m - (O - o) + (s - o), S[3] = O;
108
- const ot = V(st, J, 4, S, K);
109
- return K[ot - 1];
110
- }
111
- function mt(t, e, r, n, c, i) {
112
- const u = (e - i) * (r - c), g = (t - c) * (n - i), h = u - g, l = Math.abs(u + g);
113
- return Math.abs(h) >= gt * l ? h : -bt(t, e, r, n, c, i, l);
114
- }
115
- function wt(t, e) {
116
- var r, n, c = 0, i, u, g, h, l, y, o, f = t[0], b = t[1], p = e.length;
117
- for (r = 0; r < p; r++) {
90
+ function V(r) {
91
+ return new Float64Array(r);
92
+ }
93
+ const gt = (3 + 16 * N) * N, bt = (2 + 12 * N) * N, xt = (9 + 64 * N) * N * N, W = V(4), K = V(8), Q = V(12), H = V(16), A = V(4);
94
+ function pt(r, t, e, n, s, i, o) {
95
+ let u, d, f, m, a, l, g, b, y, h, c, x, w, M, v, p, _, T;
96
+ const S = r - s, B = e - s, C = t - i, P = n - i;
97
+ M = S * P, l = E * S, g = l - (l - S), b = S - g, l = E * P, y = l - (l - P), h = P - y, v = b * h - (M - g * y - b * y - g * h), p = C * B, l = E * C, g = l - (l - C), b = C - g, l = E * B, y = l - (l - B), h = B - y, _ = b * h - (p - g * y - b * y - g * h), c = v - _, a = v - c, W[0] = v - (c + a) + (a - _), x = M + c, a = x - M, w = M - (x - a) + (c - a), c = w - p, a = w - c, W[1] = w - (c + a) + (a - p), T = x + c, a = T - x, W[2] = x - (T - a) + (c - a), W[3] = T;
98
+ let k = mt(4, W), F = bt * o;
99
+ if (k >= F || -k >= F || (a = r - S, u = r - (S + a) + (a - s), a = e - B, f = e - (B + a) + (a - s), a = t - C, d = t - (C + a) + (a - i), a = n - P, m = n - (P + a) + (a - i), u === 0 && d === 0 && f === 0 && m === 0) || (F = xt * o + yt * Math.abs(k), k += S * m + P * u - (C * f + B * d), k >= F || -k >= F)) return k;
100
+ M = u * P, l = E * u, g = l - (l - u), b = u - g, l = E * P, y = l - (l - P), h = P - y, v = b * h - (M - g * y - b * y - g * h), p = d * B, l = E * d, g = l - (l - d), b = d - g, l = E * B, y = l - (l - B), h = B - y, _ = b * h - (p - g * y - b * y - g * h), c = v - _, a = v - c, A[0] = v - (c + a) + (a - _), x = M + c, a = x - M, w = M - (x - a) + (c - a), c = w - p, a = w - c, A[1] = w - (c + a) + (a - p), T = x + c, a = T - x, A[2] = x - (T - a) + (c - a), A[3] = T;
101
+ const ut = Y(4, W, 4, A, K);
102
+ M = S * m, l = E * S, g = l - (l - S), b = S - g, l = E * m, y = l - (l - m), h = m - y, v = b * h - (M - g * y - b * y - g * h), p = C * f, l = E * C, g = l - (l - C), b = C - g, l = E * f, y = l - (l - f), h = f - y, _ = b * h - (p - g * y - b * y - g * h), c = v - _, a = v - c, A[0] = v - (c + a) + (a - _), x = M + c, a = x - M, w = M - (x - a) + (c - a), c = w - p, a = w - c, A[1] = w - (c + a) + (a - p), T = x + c, a = T - x, A[2] = x - (T - a) + (c - a), A[3] = T;
103
+ const ft = Y(ut, K, 4, A, Q);
104
+ M = u * m, l = E * u, g = l - (l - u), b = u - g, l = E * m, y = l - (l - m), h = m - y, v = b * h - (M - g * y - b * y - g * h), p = d * f, l = E * d, g = l - (l - d), b = d - g, l = E * f, y = l - (l - f), h = f - y, _ = b * h - (p - g * y - b * y - g * h), c = v - _, a = v - c, A[0] = v - (c + a) + (a - _), x = M + c, a = x - M, w = M - (x - a) + (c - a), c = w - p, a = w - c, A[1] = w - (c + a) + (a - p), T = x + c, a = T - x, A[2] = x - (T - a) + (c - a), A[3] = T;
105
+ const ht = Y(ft, Q, 4, A, H);
106
+ return H[ht - 1];
107
+ }
108
+ function wt(r, t, e, n, s, i) {
109
+ const o = (t - i) * (e - s), u = (r - s) * (n - i), d = o - u, f = Math.abs(o + u);
110
+ return Math.abs(d) >= gt * f ? d : -pt(r, t, e, n, s, i, f);
111
+ }
112
+ function Mt(r, t) {
113
+ var e, n, s = 0, i, o, u, d, f, m, a, l = r[0], g = r[1], b = t.length;
114
+ for (e = 0; e < b; e++) {
118
115
  n = 0;
119
- var d = e[r], a = d.length - 1;
120
- if (y = d[0], y[0] !== d[a][0] && y[1] !== d[a][1])
116
+ var y = t[e], h = y.length - 1;
117
+ if (m = y[0], m[0] !== y[h][0] && m[1] !== y[h][1])
121
118
  throw new Error("First and last coordinates in a ring must be the same");
122
- for (u = y[0] - f, g = y[1] - b, n; n < a; n++) {
123
- if (o = d[n + 1], h = o[0] - f, l = o[1] - b, g === 0 && l === 0) {
124
- if (h <= 0 && u >= 0 || u <= 0 && h >= 0)
119
+ for (o = m[0] - l, u = m[1] - g, n; n < h; n++) {
120
+ if (a = y[n + 1], d = a[0] - l, f = a[1] - g, u === 0 && f === 0) {
121
+ if (d <= 0 && o >= 0 || o <= 0 && d >= 0)
125
122
  return 0;
126
- } else if (l >= 0 && g <= 0 || l <= 0 && g >= 0) {
127
- if (i = mt(u, h, g, l, 0, 0), i === 0)
123
+ } else if (f >= 0 && u <= 0 || f <= 0 && u >= 0) {
124
+ if (i = wt(o, d, u, f, 0, 0), i === 0)
128
125
  return 0;
129
- (i > 0 && l > 0 && g <= 0 || i < 0 && l <= 0 && g > 0) && c++;
126
+ (i > 0 && f > 0 && u <= 0 || i < 0 && f <= 0 && u > 0) && s++;
130
127
  }
131
- y = o, g = l, u = h;
128
+ m = a, u = f, o = d;
132
129
  }
133
130
  }
134
- return c % 2 !== 0;
131
+ return s % 2 !== 0;
135
132
  }
136
- function $(t, e, r = {}) {
137
- if (!t)
133
+ function L(r, t, e = {}) {
134
+ if (!r)
138
135
  throw new Error("point is required");
139
- if (!e)
136
+ if (!t)
140
137
  throw new Error("polygon is required");
141
- const n = ut(t), c = ft(e), i = c.type, u = e.bbox;
142
- let g = c.coordinates;
143
- if (u && xt(n, u) === !1)
138
+ const n = lt(r), s = dt(t), i = s.type, o = t.bbox;
139
+ let u = s.coordinates;
140
+ if (o && _t(n, o) === !1)
144
141
  return !1;
145
- i === "Polygon" && (g = [g]);
146
- let h = !1;
147
- for (var l = 0; l < g.length; ++l) {
148
- const y = wt(n, g[l]);
149
- if (y === 0) return !r.ignoreBoundary;
150
- y && (h = !0);
151
- }
152
- return h;
153
- }
154
- function xt(t, e) {
155
- return e[0] <= t[0] && e[1] <= t[1] && e[2] >= t[0] && e[3] >= t[1];
156
- }
157
- function L(t, e) {
158
- for (let r = 0; r < e.features.length; r++)
159
- if ($(t, e.features[r]))
160
- return e.features[r];
161
- }
162
- function rt(t, e, r) {
163
- const n = e.geometry.coordinates[0][0], c = e.geometry.coordinates[0][1], i = e.geometry.coordinates[0][2], u = t.geometry.coordinates, g = e.properties.a.geom, h = e.properties.b.geom, l = e.properties.c.geom, y = [c[0] - n[0], c[1] - n[1]], o = [i[0] - n[0], i[1] - n[1]], f = [u[0] - n[0], u[1] - n[1]], b = [h[0] - g[0], h[1] - g[1]], p = [l[0] - g[0], l[1] - g[1]];
164
- let d = (o[1] * f[0] - o[0] * f[1]) / (y[0] * o[1] - y[1] * o[0]), a = (y[0] * f[1] - y[1] * f[0]) / (y[0] * o[1] - y[1] * o[0]);
165
- if (r) {
166
- const s = r[e.properties.a.index], m = r[e.properties.b.index], M = r[e.properties.c.index];
167
- let v;
168
- if (d < 0 || a < 0 || 1 - d - a < 0) {
169
- const _ = d / (d + a), w = a / (d + a);
170
- v = d / m / (_ / m + w / M), a = a / M / (_ / m + w / M);
142
+ i === "Polygon" && (u = [u]);
143
+ let d = !1;
144
+ for (var f = 0; f < u.length; ++f) {
145
+ const m = Mt(n, u[f]);
146
+ if (m === 0) return !e.ignoreBoundary;
147
+ m && (d = !0);
148
+ }
149
+ return d;
150
+ }
151
+ function _t(r, t) {
152
+ return t[0] <= r[0] && t[1] <= r[1] && t[2] >= r[0] && t[3] >= r[1];
153
+ }
154
+ function $(r, t) {
155
+ for (let e = 0; e < t.features.length; e++)
156
+ if (L(r, t.features[e]))
157
+ return t.features[e];
158
+ }
159
+ function it(r, t, e) {
160
+ const n = t.geometry.coordinates[0][0], s = t.geometry.coordinates[0][1], i = t.geometry.coordinates[0][2], o = r.geometry.coordinates, u = t.properties.a.geom, d = t.properties.b.geom, f = t.properties.c.geom, m = [s[0] - n[0], s[1] - n[1]], a = [i[0] - n[0], i[1] - n[1]], l = [o[0] - n[0], o[1] - n[1]], g = [d[0] - u[0], d[1] - u[1]], b = [f[0] - u[0], f[1] - u[1]];
161
+ let y = (a[1] * l[0] - a[0] * l[1]) / (m[0] * a[1] - m[1] * a[0]), h = (m[0] * l[1] - m[1] * l[0]) / (m[0] * a[1] - m[1] * a[0]);
162
+ if (e) {
163
+ const c = e[t.properties.a.index], x = e[t.properties.b.index], w = e[t.properties.c.index];
164
+ let M;
165
+ if (y < 0 || h < 0 || 1 - y - h < 0) {
166
+ const v = y / (y + h), p = h / (y + h);
167
+ M = y / x / (v / x + p / w), h = h / w / (v / x + p / w);
171
168
  } else
172
- v = d / m / (d / m + a / M + (1 - d - a) / s), a = a / M / (d / m + a / M + (1 - d - a) / s);
173
- d = v;
169
+ M = y / x / (y / x + h / w + (1 - y - h) / c), h = h / w / (y / x + h / w + (1 - y - h) / c);
170
+ y = M;
174
171
  }
175
172
  return [
176
- d * b[0] + a * p[0] + g[0],
177
- d * b[1] + a * p[1] + g[1]
173
+ y * g[0] + h * b[0] + u[0],
174
+ y * g[1] + h * b[1] + u[1]
178
175
  ];
179
176
  }
180
- function pt(t, e, r, n) {
181
- const c = t.geometry.coordinates, i = r.geometry.coordinates, u = Math.atan2(c[0] - i[0], c[1] - i[1]), g = Mt(u, e[0]);
182
- if (g === void 0)
177
+ function vt(r, t, e, n) {
178
+ const s = r.geometry.coordinates, i = e.geometry.coordinates, o = Math.atan2(s[0] - i[0], s[1] - i[1]), u = Et(o, t[0]);
179
+ if (u === void 0)
183
180
  throw new Error("Unable to determine vertex index");
184
- const h = e[1][g];
185
- return rt(t, h.features[0], n);
186
- }
187
- function vt(t, e, r, n, c, i, u, g) {
188
- let h;
189
- if (u && (h = L(t, F([u]))), !h)
190
- if (r) {
191
- const l = t.geometry.coordinates, y = r.gridNum, o = r.xOrigin, f = r.yOrigin, b = r.xUnit, p = r.yUnit, d = r.gridCache, a = B(l[0], o, b, y), s = B(l[1], f, p, y), m = d[a] ? d[a][s] ? d[a][s] : [] : [], M = F(m.map((v) => e.features[v]));
192
- h = L(t, M);
181
+ const d = t[1][u];
182
+ return it(r, d.features[0], n);
183
+ }
184
+ function Tt(r, t, e, n, s, i, o, u) {
185
+ let d;
186
+ if (o && (d = $(r, U([o]))), !d)
187
+ if (e) {
188
+ const f = r.geometry.coordinates, m = e.gridNum, a = e.xOrigin, l = e.yOrigin, g = e.xUnit, b = e.yUnit, y = e.gridCache, h = O(f[0], a, g, m), c = O(f[1], l, b, m), x = y[h] ? y[h][c] ? y[h][c] : [] : [], w = U(x.map((M) => t.features[M]));
189
+ d = $(r, w);
193
190
  } else
194
- h = L(t, e);
195
- return g && g(h), h ? rt(t, h, i) : pt(t, n, c, i);
196
- }
197
- function B(t, e, r, n) {
198
- let c = Math.floor((t - e) / r);
199
- return c < 0 && (c = 0), c >= n && (c = n - 1), c;
200
- }
201
- function Mt(t, e) {
202
- let r = Q(t - e[0]), n = Math.PI * 2, c;
203
- for (let i = 0; i < e.length; i++) {
204
- const u = (i + 1) % e.length, g = Q(t - e[u]), h = Math.min(Math.abs(r), Math.abs(g));
205
- r * g <= 0 && h < n && (n = h, c = i), r = g;
206
- }
207
- return c;
208
- }
209
- function Q(t, e = !1) {
210
- const r = 2 * Math.PI, n = t - Math.floor(t / r) * r;
211
- return e ? n : n > Math.PI ? n - r : n;
212
- }
213
- function At(t, e) {
214
- return e && e >= 2.00703 || Array.isArray(t[0]) ? t : t.map((r) => [
215
- r.illstNodes,
216
- r.mercNodes,
217
- r.startEnd
218
- ]);
191
+ d = $(r, t);
192
+ return u && u(d), d ? it(r, d, i) : vt(r, n, s, i);
193
+ }
194
+ function O(r, t, e, n) {
195
+ let s = Math.floor((r - t) / e);
196
+ return s < 0 && (s = 0), s >= n && (s = n - 1), s;
197
+ }
198
+ function Et(r, t) {
199
+ let e = tt(r - t[0]), n = Math.PI * 2, s;
200
+ for (let i = 0; i < t.length; i++) {
201
+ const o = (i + 1) % t.length, u = tt(r - t[o]), d = Math.min(Math.abs(e), Math.abs(u));
202
+ e * u <= 0 && d < n && (n = d, s = i), e = u;
203
+ }
204
+ return s;
205
+ }
206
+ function tt(r, t = !1) {
207
+ const e = 2 * Math.PI, n = r - Math.floor(r / e) * e;
208
+ return t ? n : n > Math.PI ? n - e : n;
219
209
  }
220
- function Ft(t) {
221
- const e = t.features;
222
- for (let r = 0; r < e.length; r++) {
223
- const n = e[r];
224
- `${n.properties.a.index}`.substring(0, 1) === "b" && `${n.properties.b.index}`.substring(0, 1) === "b" ? e[r] = {
210
+ function Vt(r) {
211
+ const t = r.features;
212
+ for (let e = 0; e < t.length; e++) {
213
+ const n = t[e];
214
+ `${n.properties.a.index}`.substring(0, 1) === "b" && `${n.properties.b.index}`.substring(0, 1) === "b" ? t[e] = {
225
215
  geometry: {
226
216
  type: "Polygon",
227
217
  coordinates: [
@@ -248,7 +238,7 @@ function Ft(t) {
248
238
  }
249
239
  },
250
240
  type: "Feature"
251
- } : `${n.properties.c.index}`.substring(0, 1) === "b" && `${n.properties.a.index}`.substring(0, 1) === "b" && (e[r] = {
241
+ } : `${n.properties.c.index}`.substring(0, 1) === "b" && `${n.properties.a.index}`.substring(0, 1) === "b" && (t[e] = {
252
242
  geometry: {
253
243
  type: "Polygon",
254
244
  coordinates: [
@@ -277,406 +267,722 @@ function Ft(t) {
277
267
  type: "Feature"
278
268
  });
279
269
  }
280
- return t;
270
+ return r;
281
271
  }
282
- function Wt(t) {
283
- const e = ["a", "b", "c", "a"].map(
284
- (i) => t.properties[i].geom
285
- ), r = t.geometry.coordinates[0], n = t.properties, c = {
286
- a: { geom: r[0], index: n.a.index },
287
- b: { geom: r[1], index: n.b.index },
288
- c: { geom: r[2], index: n.c.index }
272
+ function Dt(r) {
273
+ const t = ["a", "b", "c", "a"].map(
274
+ (i) => r.properties[i].geom
275
+ ), e = r.geometry.coordinates[0], n = r.properties, s = {
276
+ a: { geom: e[0], index: n.a.index },
277
+ b: { geom: e[1], index: n.b.index },
278
+ c: { geom: e[2], index: n.c.index }
289
279
  };
290
- return et([e], c);
280
+ return D([t], s);
291
281
  }
292
- function _t(t) {
293
- const e = [0, 1, 2, 0].map((n) => t[n][0][0]), r = {
294
- a: { geom: t[0][0][1], index: t[0][1] },
295
- b: { geom: t[1][0][1], index: t[1][1] },
296
- c: { geom: t[2][0][1], index: t[2][1] }
282
+ function At(r) {
283
+ const t = [0, 1, 2, 0].map((n) => r[n][0][0]), e = {
284
+ a: { geom: r[0][0][1], index: r[0][1] },
285
+ b: { geom: r[1][0][1], index: r[1][1] },
286
+ c: { geom: r[2][0][1], index: r[2][1] }
297
287
  };
298
- return et([e], r);
299
- }
300
- function D(t, e, r, n, c, i = !1, u) {
301
- const g = t.map(
302
- (h) => {
303
- (!u || u < 2.00703) && (h = nt(h));
304
- const l = isFinite(h) ? e[h] : h === "c" ? n : (function() {
305
- const y = h.match(/^b(\d+)$/);
306
- if (y) return c[parseInt(y[1])];
307
- const o = h.match(/^e(\d+)$/);
308
- if (o) return r[parseInt(o[1])];
288
+ return D([t], e);
289
+ }
290
+ function G(r, t, e, n, s, i = !1, o) {
291
+ const u = r.map(
292
+ (d) => {
293
+ (!o || o < 2.00703) && (d = at(d));
294
+ const f = isFinite(d) ? t[d] : d === "c" ? n : (function() {
295
+ const m = d.match(/^b(\d+)$/);
296
+ if (m) return s[parseInt(m[1])];
297
+ const a = d.match(/^e(\d+)$/);
298
+ if (a) return e[parseInt(a[1])];
309
299
  throw new Error("Bad index value for indexesToTri");
310
300
  })();
311
- return i ? [[l[1], l[0]], h] : [[l[0], l[1]], h];
301
+ return i ? [[f[1], f[0]], d] : [[f[0], f[1]], d];
312
302
  }
313
303
  );
314
- return _t(g);
304
+ return At(u);
305
+ }
306
+ function at(r) {
307
+ return typeof r == "number" ? r : r.replace(/^(c|e|b)(?:ent|dgeNode|box)(\d+)?$/, "$1$2");
315
308
  }
316
- function nt(t) {
317
- return typeof t == "number" ? t : t.replace(/^(c|e|b)(?:ent|dgeNode|box)(\d+)?$/, "$1$2");
309
+ function It(r, t) {
310
+ return t && t >= 2.00703 || Array.isArray(r[0]) ? r : r.map((e) => [
311
+ e.illstNodes,
312
+ e.mercNodes,
313
+ e.startEnd
314
+ ]);
318
315
  }
319
- const q = 2.00703;
320
- function Et(t) {
321
- return !!(t.version !== void 0 || !t.tins && t.points && t.tins_points);
316
+ const Z = 2.00703;
317
+ function St(r) {
318
+ return !!(r.version !== void 0 || !r.tins && r.points && r.tins_points);
322
319
  }
323
- function Ot(t) {
320
+ function Bt(r) {
324
321
  return {
325
- points: t.points,
326
- pointsWeightBuffer: St(t),
327
- strictStatus: kt(t),
328
- verticesParams: Tt(t),
329
- centroid: It(t),
330
- edges: At(t.edges || []),
331
- edgeNodes: t.edgeNodes || [],
332
- tins: Nt(t),
333
- kinks: Bt(t.kinks_points),
334
- yaxisMode: t.yaxisMode ?? "invert",
335
- strictMode: t.strictMode ?? "auto",
336
- vertexMode: t.vertexMode,
337
- bounds: t.bounds,
338
- boundsPolygon: t.boundsPolygon,
339
- wh: t.wh,
340
- xy: t.xy ?? [0, 0]
322
+ points: r.points,
323
+ pointsWeightBuffer: Pt(r),
324
+ strictStatus: Ot(r),
325
+ verticesParams: Rt(r),
326
+ centroid: kt(r),
327
+ edges: It(r.edges || []),
328
+ edgeNodes: r.edgeNodes || [],
329
+ tins: Nt(r),
330
+ kinks: Xt(r.kinks_points),
331
+ yaxisMode: r.yaxisMode ?? "invert",
332
+ strictMode: r.strictMode ?? "auto",
333
+ vertexMode: r.vertexMode,
334
+ bounds: r.bounds,
335
+ boundsPolygon: r.boundsPolygon,
336
+ wh: r.wh,
337
+ xy: r.xy ?? [0, 0]
341
338
  };
342
339
  }
343
- function Pt(t) {
344
- const e = Ct(t), r = e.tins;
340
+ function Ct(r) {
341
+ const t = Wt(r), e = t.tins;
345
342
  return {
346
- compiled: e,
347
- tins: r,
348
- points: Rt(r),
349
- strictStatus: e.strict_status,
350
- pointsWeightBuffer: e.weight_buffer,
351
- verticesParams: e.vertices_params,
352
- centroid: e.centroid,
353
- kinks: e.kinks
343
+ compiled: t,
344
+ tins: e,
345
+ points: Lt(e),
346
+ strictStatus: t.strict_status,
347
+ pointsWeightBuffer: t.weight_buffer,
348
+ verticesParams: t.vertices_params,
349
+ centroid: t.centroid,
350
+ kinks: t.kinks
354
351
  };
355
352
  }
356
- function St(t) {
357
- return !t.version || t.version < q ? ["forw", "bakw"].reduce((e, r) => {
358
- const n = t.weight_buffer[r];
359
- return n && (e[r] = Object.keys(n).reduce((c, i) => {
360
- const u = nt(i);
361
- return c[u] = n[i], c;
362
- }, {})), e;
363
- }, {}) : t.weight_buffer;
364
- }
365
- function kt(t) {
366
- return t.strict_status ? t.strict_status : t.kinks_points ? "strict_error" : t.tins_points.length === 2 ? "loose" : "strict";
367
- }
368
- function Tt(t) {
369
- const e = {
370
- forw: [t.vertices_params[0]],
371
- bakw: [t.vertices_params[1]]
353
+ function Pt(r) {
354
+ return !r.version || r.version < Z ? ["forw", "bakw"].reduce((t, e) => {
355
+ const n = r.weight_buffer[e];
356
+ return n && (t[e] = Object.keys(n).reduce((s, i) => {
357
+ const o = at(i);
358
+ return s[o] = n[i], s;
359
+ }, {})), t;
360
+ }, {}) : r.weight_buffer;
361
+ }
362
+ function Ot(r) {
363
+ return r.strict_status ? r.strict_status : r.kinks_points ? "strict_error" : r.tins_points.length === 2 ? "loose" : "strict";
364
+ }
365
+ function Rt(r) {
366
+ const t = {
367
+ forw: [r.vertices_params[0]],
368
+ bakw: [r.vertices_params[1]]
372
369
  };
373
- return e.forw[1] = H(t, !1), e.bakw[1] = H(t, !0), e;
374
- }
375
- function H(t, e) {
376
- const r = t.vertices_points.length;
377
- return Array.from({ length: r }, (n, c) => {
378
- const i = (c + 1) % r, u = D(
379
- ["c", `b${c}`, `b${i}`],
380
- t.points,
381
- t.edgeNodes || [],
382
- t.centroid_point,
383
- t.vertices_points,
384
- e,
385
- q
370
+ return t.forw[1] = rt(r, !1), t.bakw[1] = rt(r, !0), t;
371
+ }
372
+ function rt(r, t) {
373
+ const e = r.vertices_points.length;
374
+ return Array.from({ length: e }, (n, s) => {
375
+ const i = (s + 1) % e, o = G(
376
+ ["c", `b${s}`, `b${i}`],
377
+ r.points,
378
+ r.edgeNodes || [],
379
+ r.centroid_point,
380
+ r.vertices_points,
381
+ t,
382
+ Z
386
383
  );
387
- return F([u]);
384
+ return U([o]);
388
385
  });
389
386
  }
390
- function It(t) {
387
+ function kt(r) {
391
388
  return {
392
- forw: X(t.centroid_point[0], {
389
+ forw: X(r.centroid_point[0], {
393
390
  target: {
394
- geom: t.centroid_point[1],
391
+ geom: r.centroid_point[1],
395
392
  index: "c"
396
393
  }
397
394
  }),
398
- bakw: X(t.centroid_point[1], {
395
+ bakw: X(r.centroid_point[1], {
399
396
  target: {
400
- geom: t.centroid_point[0],
397
+ geom: r.centroid_point[0],
401
398
  index: "c"
402
399
  }
403
400
  })
404
401
  };
405
402
  }
406
- function Nt(t) {
407
- const e = t.tins_points.length === 1 ? 0 : 1;
403
+ function Nt(r) {
404
+ const t = r.tins_points.length === 1 ? 0 : 1;
408
405
  return {
409
- forw: F(
410
- t.tins_points[0].map(
411
- (r) => D(
412
- r,
413
- t.points,
414
- t.edgeNodes || [],
415
- t.centroid_point,
416
- t.vertices_points,
406
+ forw: U(
407
+ r.tins_points[0].map(
408
+ (e) => G(
409
+ e,
410
+ r.points,
411
+ r.edgeNodes || [],
412
+ r.centroid_point,
413
+ r.vertices_points,
417
414
  !1,
418
- t.version
415
+ r.version
419
416
  )
420
417
  )
421
418
  ),
422
- bakw: F(
423
- t.tins_points[e].map(
424
- (r) => D(
425
- r,
426
- t.points,
427
- t.edgeNodes || [],
428
- t.centroid_point,
429
- t.vertices_points,
419
+ bakw: U(
420
+ r.tins_points[t].map(
421
+ (e) => G(
422
+ e,
423
+ r.points,
424
+ r.edgeNodes || [],
425
+ r.centroid_point,
426
+ r.vertices_points,
430
427
  !0,
431
- t.version
428
+ r.version
432
429
  )
433
430
  )
434
431
  )
435
432
  };
436
433
  }
437
- function Bt(t) {
438
- if (t)
434
+ function Xt(r) {
435
+ if (r)
439
436
  return {
440
- bakw: F(
441
- t.map((e) => X(e))
437
+ bakw: U(
438
+ r.map((t) => X(t))
442
439
  )
443
440
  };
444
441
  }
445
- function Ct(t) {
442
+ function Wt(r) {
446
443
  return JSON.parse(
447
- JSON.stringify(t).replace('"cent"', '"c"').replace(/"bbox(\d+)"/g, '"b$1"')
444
+ JSON.stringify(r).replace('"cent"', '"c"').replace(/"bbox(\d+)"/g, '"b$1"')
448
445
  );
449
446
  }
450
- function Rt(t) {
451
- const e = [], r = t.forw.features;
452
- for (let n = 0; n < r.length; n++) {
453
- const c = r[n];
454
- ["a", "b", "c"].forEach((i, u) => {
455
- const g = c.geometry.coordinates[0][u], h = c.properties[i].geom, l = c.properties[i].index;
456
- typeof l == "number" && (e[l] = [g, h]);
447
+ function Lt(r) {
448
+ const t = [], e = r.forw.features;
449
+ for (let n = 0; n < e.length; n++) {
450
+ const s = e[n];
451
+ ["a", "b", "c"].forEach((i, o) => {
452
+ const u = s.geometry.coordinates[0][o], d = s.properties[i].geom, f = s.properties[i].index;
453
+ typeof f == "number" && (t[f] = [u, d]);
457
454
  });
458
455
  }
459
- return e;
456
+ return t;
460
457
  }
461
- const Xt = q, E = class E {
458
+ const Yt = Z;
459
+ class I {
460
+ /**
461
+ * 各種モードの定数定義
462
+ * すべてreadonlyで、型安全性を確保
463
+ */
464
+ static VERTEX_PLAIN = "plain";
465
+ static VERTEX_BIRDEYE = "birdeye";
466
+ static MODE_STRICT = "strict";
467
+ static MODE_AUTO = "auto";
468
+ static MODE_LOOSE = "loose";
469
+ static STATUS_STRICT = "strict";
470
+ static STATUS_ERROR = "strict_error";
471
+ static STATUS_LOOSE = "loose";
472
+ static YAXIS_FOLLOW = "follow";
473
+ static YAXIS_INVERT = "invert";
474
+ points = [];
475
+ pointsWeightBuffer;
476
+ strict_status;
477
+ vertices_params;
478
+ centroid;
479
+ edgeNodes;
480
+ edges;
481
+ tins;
482
+ kinks;
483
+ yaxisMode = I.YAXIS_INVERT;
484
+ strictMode = I.MODE_AUTO;
485
+ vertexMode = I.VERTEX_PLAIN;
486
+ bounds;
487
+ boundsPolygon;
488
+ wh;
489
+ xy;
490
+ indexedTins;
491
+ stateFull = !1;
492
+ stateTriangle;
493
+ stateBackward;
494
+ /**
495
+ * Optional properties for MaplatCore extension
496
+ * These properties allow consuming applications to extend Transform instances
497
+ * with additional metadata without requiring Module Augmentation
498
+ */
499
+ /** Layer priority for rendering order */
500
+ priority;
501
+ /** Layer importance for display decisions */
502
+ importance;
503
+ /** Bounds in XY (source) coordinate system */
504
+ xyBounds;
505
+ /** Bounds in Mercator (Web Mercator) coordinate system */
506
+ mercBounds;
462
507
  constructor() {
463
- x(this, "points", []);
464
- x(this, "pointsWeightBuffer");
465
- x(this, "strict_status");
466
- x(this, "vertices_params");
467
- x(this, "centroid");
468
- x(this, "edgeNodes");
469
- x(this, "edges");
470
- x(this, "tins");
471
- x(this, "kinks");
472
- x(this, "yaxisMode", E.YAXIS_INVERT);
473
- x(this, "strictMode", E.MODE_AUTO);
474
- x(this, "vertexMode", E.VERTEX_PLAIN);
475
- x(this, "bounds");
476
- x(this, "boundsPolygon");
477
- x(this, "wh");
478
- x(this, "xy");
479
- x(this, "indexedTins");
480
- x(this, "stateFull", !1);
481
- x(this, "stateTriangle");
482
- x(this, "stateBackward");
483
- /**
484
- * Optional properties for MaplatCore extension
485
- * These properties allow consuming applications to extend Transform instances
486
- * with additional metadata without requiring Module Augmentation
487
- */
488
- /** Layer priority for rendering order */
489
- x(this, "priority");
490
- /** Layer importance for display decisions */
491
- x(this, "importance");
492
- /** Bounds in XY (source) coordinate system */
493
- x(this, "xyBounds");
494
- /** Bounds in Mercator (Web Mercator) coordinate system */
495
- x(this, "mercBounds");
496
508
  }
497
509
  /**
498
510
  * コンパイルされた設定を適用します
499
- *
511
+ *
500
512
  * @param compiled - コンパイルされた設定オブジェクト
501
513
  * @returns 変換に必要な主要なオブジェクトのセット
502
- *
514
+ *
503
515
  * 以下の処理を行います:
504
516
  * 1. バージョンに応じた設定の解釈
505
517
  * 2. 各種パラメータの復元
506
518
  * 3. TINネットワークの再構築
507
519
  * 4. インデックスの作成
508
520
  */
509
- setCompiled(e) {
510
- if (Et(e)) {
511
- this.applyModernState(Ot(e));
521
+ setCompiled(t) {
522
+ if (St(t)) {
523
+ this.applyModernState(Bt(t));
512
524
  return;
513
525
  }
514
- this.applyLegacyState(Pt(e));
526
+ this.applyLegacyState(Ct(t));
515
527
  }
516
- applyModernState(e) {
517
- this.points = e.points, this.pointsWeightBuffer = e.pointsWeightBuffer, this.strict_status = e.strictStatus, this.vertices_params = e.verticesParams, this.centroid = e.centroid, this.edges = e.edges, this.edgeNodes = e.edgeNodes || [], this.tins = e.tins, this.addIndexedTin(), this.kinks = e.kinks, this.yaxisMode = e.yaxisMode ?? E.YAXIS_INVERT, this.vertexMode = e.vertexMode ?? E.VERTEX_PLAIN, this.strictMode = e.strictMode ?? E.MODE_AUTO, e.bounds ? (this.bounds = e.bounds, this.boundsPolygon = e.boundsPolygon, this.xy = e.xy, this.wh = e.wh) : (this.bounds = void 0, this.boundsPolygon = void 0, this.xy = e.xy ?? [0, 0], e.wh && (this.wh = e.wh));
528
+ applyModernState(t) {
529
+ this.points = t.points, this.pointsWeightBuffer = t.pointsWeightBuffer, this.strict_status = t.strictStatus, this.vertices_params = t.verticesParams, this.centroid = t.centroid, this.edges = t.edges, this.edgeNodes = t.edgeNodes || [], this.tins = t.tins, this.addIndexedTin(), this.kinks = t.kinks, this.yaxisMode = t.yaxisMode ?? I.YAXIS_INVERT, this.vertexMode = t.vertexMode ?? I.VERTEX_PLAIN, this.strictMode = t.strictMode ?? I.MODE_AUTO, t.bounds ? (this.bounds = t.bounds, this.boundsPolygon = t.boundsPolygon, this.xy = t.xy, this.wh = t.wh) : (this.bounds = void 0, this.boundsPolygon = void 0, this.xy = t.xy ?? [0, 0], t.wh && (this.wh = t.wh));
518
530
  }
519
- applyLegacyState(e) {
520
- this.tins = e.tins, this.addIndexedTin(), this.strict_status = e.strictStatus, this.pointsWeightBuffer = e.pointsWeightBuffer, this.vertices_params = e.verticesParams, this.centroid = e.centroid, this.kinks = e.kinks, this.points = e.points;
531
+ applyLegacyState(t) {
532
+ this.tins = t.tins, this.addIndexedTin(), this.strict_status = t.strictStatus, this.pointsWeightBuffer = t.pointsWeightBuffer, this.vertices_params = t.verticesParams, this.centroid = t.centroid, this.kinks = t.kinks, this.points = t.points;
521
533
  }
522
534
  /**
523
535
  * TINネットワークのインデックスを作成します
524
- *
536
+ *
525
537
  * インデックスは変換処理を高速化するために使用されます。
526
538
  * グリッド形式のインデックスを作成し、各グリッドに
527
539
  * 含まれる三角形を記録します。
528
540
  */
529
541
  addIndexedTin() {
530
- const e = this.tins, r = e.forw, n = e.bakw, c = Math.ceil(Math.sqrt(r.features.length));
531
- if (c < 3) {
542
+ const t = this.tins, e = t.forw, n = t.bakw, s = Math.ceil(Math.sqrt(e.features.length));
543
+ if (s < 3) {
532
544
  this.indexedTins = void 0;
533
545
  return;
534
546
  }
535
- let i = [], u = [];
536
- const g = r.features.map((d) => {
537
- let a = [];
538
- return G(d)[0].map((s) => {
539
- i.length === 0 ? i = [Array.from(s), Array.from(s)] : (s[0] < i[0][0] && (i[0][0] = s[0]), s[0] > i[1][0] && (i[1][0] = s[0]), s[1] < i[0][1] && (i[0][1] = s[1]), s[1] > i[1][1] && (i[1][1] = s[1])), a.length === 0 ? a = [Array.from(s), Array.from(s)] : (s[0] < a[0][0] && (a[0][0] = s[0]), s[0] > a[1][0] && (a[1][0] = s[0]), s[1] < a[0][1] && (a[0][1] = s[1]), s[1] > a[1][1] && (a[1][1] = s[1]));
540
- }), a;
541
- }), h = (i[1][0] - i[0][0]) / c, l = (i[1][1] - i[0][1]) / c, y = g.reduce(
542
- (d, a, s) => {
543
- const m = B(
544
- a[0][0],
545
- i[0][0],
546
- h,
547
- c
548
- ), M = B(
549
- a[1][0],
550
- i[0][0],
551
- h,
552
- c
553
- ), v = B(
554
- a[0][1],
555
- i[0][1],
556
- l,
557
- c
558
- ), _ = B(
559
- a[1][1],
560
- i[0][1],
561
- l,
562
- c
563
- );
564
- for (let w = m; w <= M; w++) {
565
- d[w] || (d[w] = []);
566
- for (let A = v; A <= _; A++)
567
- d[w][A] || (d[w][A] = []), d[w][A].push(s);
547
+ let i = [], o = [];
548
+ const u = e.features.map((y) => {
549
+ let h = [];
550
+ return J(y)[0].map((c) => {
551
+ i.length === 0 ? i = [Array.from(c), Array.from(c)] : (c[0] < i[0][0] && (i[0][0] = c[0]), c[0] > i[1][0] && (i[1][0] = c[0]), c[1] < i[0][1] && (i[0][1] = c[1]), c[1] > i[1][1] && (i[1][1] = c[1])), h.length === 0 ? h = [Array.from(c), Array.from(c)] : (c[0] < h[0][0] && (h[0][0] = c[0]), c[0] > h[1][0] && (h[1][0] = c[0]), c[1] < h[0][1] && (h[0][1] = c[1]), c[1] > h[1][1] && (h[1][1] = c[1]));
552
+ }), h;
553
+ }), d = (i[1][0] - i[0][0]) / s, f = (i[1][1] - i[0][1]) / s, m = u.reduce(
554
+ (y, h, c) => {
555
+ const x = O(h[0][0], i[0][0], d, s), w = O(h[1][0], i[0][0], d, s), M = O(h[0][1], i[0][1], f, s), v = O(h[1][1], i[0][1], f, s);
556
+ for (let p = x; p <= w; p++) {
557
+ y[p] || (y[p] = []);
558
+ for (let _ = M; _ <= v; _++)
559
+ y[p][_] || (y[p][_] = []), y[p][_].push(c);
568
560
  }
569
- return d;
561
+ return y;
570
562
  },
571
563
  []
572
- ), o = n.features.map((d) => {
573
- let a = [];
574
- return G(d)[0].map((s) => {
575
- u.length === 0 ? u = [Array.from(s), Array.from(s)] : (s[0] < u[0][0] && (u[0][0] = s[0]), s[0] > u[1][0] && (u[1][0] = s[0]), s[1] < u[0][1] && (u[0][1] = s[1]), s[1] > u[1][1] && (u[1][1] = s[1])), a.length === 0 ? a = [Array.from(s), Array.from(s)] : (s[0] < a[0][0] && (a[0][0] = s[0]), s[0] > a[1][0] && (a[1][0] = s[0]), s[1] < a[0][1] && (a[0][1] = s[1]), s[1] > a[1][1] && (a[1][1] = s[1]));
576
- }), a;
577
- }), f = (u[1][0] - u[0][0]) / c, b = (u[1][1] - u[0][1]) / c, p = o.reduce(
578
- (d, a, s) => {
579
- const m = B(
580
- a[0][0],
581
- u[0][0],
582
- f,
583
- c
584
- ), M = B(
585
- a[1][0],
586
- u[0][0],
587
- f,
588
- c
589
- ), v = B(
590
- a[0][1],
591
- u[0][1],
592
- b,
593
- c
594
- ), _ = B(
595
- a[1][1],
596
- u[0][1],
597
- b,
598
- c
599
- );
600
- for (let w = m; w <= M; w++) {
601
- d[w] || (d[w] = []);
602
- for (let A = v; A <= _; A++)
603
- d[w][A] || (d[w][A] = []), d[w][A].push(s);
564
+ ), a = n.features.map((y) => {
565
+ let h = [];
566
+ return J(y)[0].map((c) => {
567
+ o.length === 0 ? o = [Array.from(c), Array.from(c)] : (c[0] < o[0][0] && (o[0][0] = c[0]), c[0] > o[1][0] && (o[1][0] = c[0]), c[1] < o[0][1] && (o[0][1] = c[1]), c[1] > o[1][1] && (o[1][1] = c[1])), h.length === 0 ? h = [Array.from(c), Array.from(c)] : (c[0] < h[0][0] && (h[0][0] = c[0]), c[0] > h[1][0] && (h[1][0] = c[0]), c[1] < h[0][1] && (h[0][1] = c[1]), c[1] > h[1][1] && (h[1][1] = c[1]));
568
+ }), h;
569
+ }), l = (o[1][0] - o[0][0]) / s, g = (o[1][1] - o[0][1]) / s, b = a.reduce(
570
+ (y, h, c) => {
571
+ const x = O(h[0][0], o[0][0], l, s), w = O(h[1][0], o[0][0], l, s), M = O(h[0][1], o[0][1], g, s), v = O(h[1][1], o[0][1], g, s);
572
+ for (let p = x; p <= w; p++) {
573
+ y[p] || (y[p] = []);
574
+ for (let _ = M; _ <= v; _++)
575
+ y[p][_] || (y[p][_] = []), y[p][_].push(c);
604
576
  }
605
- return d;
577
+ return y;
606
578
  },
607
579
  []
608
580
  );
609
581
  this.indexedTins = {
610
582
  forw: {
611
- gridNum: c,
583
+ gridNum: s,
612
584
  xOrigin: i[0][0],
613
585
  yOrigin: i[0][1],
614
- xUnit: h,
615
- yUnit: l,
616
- gridCache: y
586
+ xUnit: d,
587
+ yUnit: f,
588
+ gridCache: m
617
589
  },
618
590
  bakw: {
619
- gridNum: c,
620
- xOrigin: u[0][0],
621
- yOrigin: u[0][1],
622
- xUnit: f,
623
- yUnit: b,
624
- gridCache: p
591
+ gridNum: s,
592
+ xOrigin: o[0][0],
593
+ yOrigin: o[0][1],
594
+ xUnit: l,
595
+ yUnit: g,
596
+ gridCache: b
625
597
  }
626
598
  };
627
599
  }
628
600
  /**
629
601
  * 座標変換を実行します
630
- *
602
+ *
631
603
  * @param apoint - 変換する座標
632
604
  * @param backward - 逆方向の変換かどうか
633
605
  * @param ignoreBounds - 境界チェックを無視するかどうか
634
606
  * @returns 変換後の座標、または境界外の場合はfalse
635
- *
607
+ *
636
608
  * @throws {Error} 逆方向変換が許可されていない状態での逆変換時
637
609
  */
638
- transform(e, r, n) {
610
+ transform(t, e, n) {
639
611
  if (!this.tins)
640
612
  throw new Error("setCompiled() must be called before transform()");
641
- if (r && this.strict_status == E.STATUS_ERROR)
613
+ if (e && this.strict_status == I.STATUS_ERROR)
642
614
  throw new Error('Backward transform is not allowed if strict_status == "strict_error"');
643
- this.yaxisMode == E.YAXIS_FOLLOW && r && (e = [e[0], -1 * e[1]]);
644
- const c = X(e);
645
- if (this.bounds && !r && !n && !$(c, this.boundsPolygon))
615
+ this.yaxisMode == I.YAXIS_FOLLOW && e && (t = [t[0], -1 * t[1]]);
616
+ const s = X(t);
617
+ if (this.bounds && !e && !n && !L(s, this.boundsPolygon))
646
618
  return !1;
647
- const i = r ? this.tins.bakw : this.tins.forw, u = r ? this.indexedTins.bakw : this.indexedTins.forw, g = r ? this.vertices_params.bakw : this.vertices_params.forw, h = r ? this.centroid.bakw : this.centroid.forw, l = r ? this.pointsWeightBuffer.bakw : this.pointsWeightBuffer.forw;
648
- let y, o;
649
- this.stateFull && (this.stateBackward == r ? y = this.stateTriangle : (this.stateBackward = r, this.stateTriangle = void 0), o = (b) => {
650
- this.stateTriangle = b;
619
+ const i = e ? this.tins.bakw : this.tins.forw, o = e ? this.indexedTins.bakw : this.indexedTins.forw, u = e ? this.vertices_params.bakw : this.vertices_params.forw, d = e ? this.centroid.bakw : this.centroid.forw, f = e ? this.pointsWeightBuffer.bakw : this.pointsWeightBuffer.forw;
620
+ let m, a;
621
+ this.stateFull && (this.stateBackward == e ? m = this.stateTriangle : (this.stateBackward = e, this.stateTriangle = void 0), a = (g) => {
622
+ this.stateTriangle = g;
651
623
  });
652
- let f = vt(
653
- c,
624
+ let l = Tt(
625
+ s,
654
626
  i,
627
+ o,
655
628
  u,
656
- g,
657
- h,
658
- l,
659
- y,
660
- o
629
+ d,
630
+ f,
631
+ m,
632
+ a
661
633
  );
662
- if (this.bounds && r && !n) {
663
- const b = X(f);
664
- if (!$(b, this.boundsPolygon)) return !1;
665
- } else this.yaxisMode == E.YAXIS_FOLLOW && !r && (f = [f[0], -1 * f[1]]);
666
- return f;
634
+ if (this.bounds && e && !n) {
635
+ const g = X(l);
636
+ if (!L(g, this.boundsPolygon)) return !1;
637
+ } else this.yaxisMode == I.YAXIS_FOLLOW && !e && (l = [l[0], -1 * l[1]]);
638
+ return l;
667
639
  }
668
- };
669
- /**
670
- * 各種モードの定数定義
671
- * すべてreadonlyで、型安全性を確保
672
- */
673
- x(E, "VERTEX_PLAIN", "plain"), x(E, "VERTEX_BIRDEYE", "birdeye"), x(E, "MODE_STRICT", "strict"), x(E, "MODE_AUTO", "auto"), x(E, "MODE_LOOSE", "loose"), x(E, "STATUS_STRICT", "strict"), x(E, "STATUS_ERROR", "strict_error"), x(E, "STATUS_LOOSE", "loose"), x(E, "YAXIS_FOLLOW", "follow"), x(E, "YAXIS_INVERT", "invert");
674
- let Z = E;
640
+ }
641
+ const R = 20037508342789244e-9, Ut = [
642
+ [0, 0],
643
+ [0, 1],
644
+ [1, 0],
645
+ [0, -1],
646
+ [-1, 0]
647
+ ];
648
+ function ct(r, t) {
649
+ return Math.floor(Math.min(r[0], r[1]) / 4) * R / 128 / Math.pow(2, t);
650
+ }
651
+ function Ft(r, t) {
652
+ const e = [];
653
+ for (let n = 0; n < r.length; n++) {
654
+ const s = r[n], i = s[0] * Math.cos(t) - s[1] * Math.sin(t), o = s[0] * Math.sin(t) + s[1] * Math.cos(t);
655
+ e.push([i, o]);
656
+ }
657
+ return e;
658
+ }
659
+ function et(r, t, e, n) {
660
+ const s = ct(n, t);
661
+ return Ft(Ut, e).map((u) => [
662
+ u[0] * s + r[0],
663
+ u[1] * s + r[1]
664
+ ]);
665
+ }
666
+ function nt(r, t) {
667
+ const e = r[0], s = r.slice(1, 5).map((g) => [
668
+ g[0] - e[0],
669
+ g[1] - e[1]
670
+ ]), i = [
671
+ [0, 1],
672
+ [1, 0],
673
+ [0, -1],
674
+ [-1, 0]
675
+ ];
676
+ let o = 0, u = 0, d = 0;
677
+ for (let g = 0; g < 4; g++) {
678
+ const b = s[g], y = i[g], h = Math.sqrt(Math.pow(b[0], 2) + Math.pow(b[1], 2));
679
+ o += h;
680
+ const c = b[0] * y[1] - b[1] * y[0], x = Math.acos(
681
+ (b[0] * y[0] + b[1] * y[1]) / h
682
+ ), w = c > 0 ? -1 * x : x;
683
+ u += Math.cos(w), d += Math.sin(w);
684
+ }
685
+ const f = o / 4, m = Math.atan2(d, u), a = Math.floor(Math.min(t[0], t[1]) / 4), l = Math.log(a * R / 128 / f) / Math.log(2);
686
+ return { center: e, zoom: l, rotation: m };
687
+ }
688
+ function q(r, t) {
689
+ const e = r[0] * (2 * R) / t - R, n = -1 * (r[1] * (2 * R) / t - R);
690
+ return [e, n];
691
+ }
692
+ function st(r, t) {
693
+ const e = (r[0] + R) * t / (2 * R), n = (-r[1] + R) * t / (2 * R);
694
+ return [e, n];
695
+ }
696
+ const z = 256;
697
+ class $t {
698
+ mainTin = null;
699
+ subTins = [];
700
+ _maxxy = 0;
701
+ // ─── 初期化 ────────────────────────────────────────────────────────────────
702
+ /**
703
+ * 地図データ(コンパイル済み TIN + sub_maps)をロードする
704
+ *
705
+ * @param mapData - メイン TIN と sub_maps の情報
706
+ */
707
+ setMapData(t) {
708
+ const e = new I();
709
+ if (e.setCompiled(t.compiled), this.mainTin = e, t.maxZoom !== void 0)
710
+ this._maxxy = Math.pow(2, t.maxZoom) * z;
711
+ else if (t.compiled.wh) {
712
+ const n = Math.max(t.compiled.wh[0], t.compiled.wh[1]), s = Math.ceil(Math.log2(n / z));
713
+ this._maxxy = Math.pow(2, s) * z;
714
+ }
715
+ if (this.subTins = [], t.sub_maps)
716
+ for (const n of t.sub_maps) {
717
+ const s = new I();
718
+ s.setCompiled(n.compiled);
719
+ const i = n.bounds ?? n.compiled.bounds;
720
+ if (!i)
721
+ throw new Error(
722
+ "SubMapData must have bounds or compiled.bounds to create xyBounds polygon"
723
+ );
724
+ const o = [...i, i[0]], u = o.map((d) => {
725
+ const f = s.transform(d, !1);
726
+ if (!f) throw new Error("Failed to transform sub-map bounds to mercator");
727
+ return f;
728
+ });
729
+ this.subTins.push({
730
+ tin: s,
731
+ priority: n.priority,
732
+ importance: n.importance,
733
+ xyBounds: D([o]),
734
+ mercBounds: D([u])
735
+ });
736
+ }
737
+ }
738
+ // ─── 処理2: submap TIN 選択付き変換 ───────────────────────────────────────
739
+ /**
740
+ * ピクセル座標 → メルカトル座標(最適レイヤー選択)
741
+ *
742
+ * @param xy - ピクセル座標 [x, y]
743
+ * @returns メルカトル座標、または範囲外の場合は false
744
+ */
745
+ xy2Merc(t) {
746
+ const e = this.xy2MercWithLayer(t);
747
+ return e ? e[1] : !1;
748
+ }
749
+ /**
750
+ * メルカトル座標 → ピクセル座標(最適レイヤー選択)
751
+ *
752
+ * @param merc - メルカトル座標 [x, y]
753
+ * @returns ピクセル座標、または範囲外の場合は false
754
+ */
755
+ merc2Xy(t) {
756
+ const e = this.merc2XyWithLayer(t), n = e[0] || e[1];
757
+ return n ? n[1] : !1;
758
+ }
759
+ /**
760
+ * ピクセル座標 → メルカトル座標(レイヤーID付き)
761
+ * histmap_tin.ts xy2MercAsync_returnLayer() の同期版
762
+ *
763
+ * @param xy - ピクセル座標 [x, y]
764
+ * @returns [レイヤーインデックス, メルカトル座標] または false
765
+ */
766
+ xy2MercWithLayer(t) {
767
+ this._assertMapData();
768
+ const e = this._getTinsSortedByPriority();
769
+ for (let n = 0; n < e.length; n++) {
770
+ const { index: s, isMain: i } = e[n];
771
+ if (i || L(X(t), this.subTins[s - 1].xyBounds)) {
772
+ const o = this._transformByIndex(t, s, !1);
773
+ if (o === !1) continue;
774
+ return [s, o];
775
+ }
776
+ }
777
+ return !1;
778
+ }
779
+ /**
780
+ * メルカトル座標 → ピクセル座標(複数レイヤー結果)
781
+ * histmap_tin.ts merc2XyAsync_returnLayer() の同期版
782
+ *
783
+ * 現在は MaplatCore の仕様に合わせ、最大2レイヤーまで返す。
784
+ * 3レイヤー以上返したい場合は、下記の .slice(0, 2) および .filter(i < 2) の
785
+ * 上限値を増やすか、引数で上限を指定できるようにすること。
786
+ *
787
+ * @param merc - メルカトル座標 [x, y]
788
+ * @returns 最大2要素の配列。各要素は [レイヤーインデックス, ピクセル座標] または undefined
789
+ */
790
+ merc2XyWithLayer(t) {
791
+ return this._assertMapData(), this._getAllTinsWithIndex().map(({ index: o, tin: u, isMain: d }) => {
792
+ const f = this._transformByIndex(t, o, !0);
793
+ return f === !1 ? [u, o] : d || L(X(f), this.subTins[o - 1].xyBounds) ? [u, o, f] : [u, o];
794
+ }).sort((o, u) => {
795
+ const d = o[0].priority ?? 0, f = u[0].priority ?? 0;
796
+ return d < f ? 1 : -1;
797
+ }).reduce(
798
+ (o, u, d, f) => {
799
+ const m = u[0], a = u[1], l = u[2];
800
+ if (!l) return o;
801
+ for (let g = 0; g < d; g++) {
802
+ const b = f[g][1], y = b === 0;
803
+ if (f[g][2] && (y || L(X(l), this.subTins[b - 1].xyBounds)))
804
+ if (o.length) {
805
+ const h = !o[0], c = h ? o[1][2] : o[0][2], x = m.importance ?? 0, w = c.importance ?? 0;
806
+ return h ? x < w ? o : [void 0, [a, l, m]] : [...o.filter(
807
+ (p) => p !== void 0
808
+ ), [a, l, m]].sort(
809
+ (p, _) => (p[2].importance ?? 0) < (_[2].importance ?? 0) ? 1 : -1
810
+ ).slice(0, 2);
811
+ } else
812
+ return [[a, l, m]];
813
+ }
814
+ return !o.length || !o[0] ? [[a, l, m]] : (o.push([a, l, m]), o.sort((g, b) => {
815
+ const y = g[2].importance ?? 0, h = b[2].importance ?? 0;
816
+ return y < h ? 1 : -1;
817
+ }).filter((g, b) => b < 2));
818
+ },
819
+ []
820
+ ).map((o) => {
821
+ if (o)
822
+ return [o[0], o[1]];
823
+ });
824
+ }
825
+ /**
826
+ * メルカトル5点 → システム座標(複数レイヤー)
827
+ * histmap_tin.ts mercs2SysCoordsAsync_multiLayer() の同期版
828
+ *
829
+ * @param mercs - 5点のメルカトル座標配列(中心+上下左右)
830
+ * @returns 各レイヤーのシステム座標配列(または undefined)
831
+ */
832
+ mercs2SysCoords(t) {
833
+ this._assertMapData();
834
+ const e = this.merc2XyWithLayer(t[0]);
835
+ let n = !1;
836
+ return e.map((s, i) => {
837
+ if (!s) {
838
+ n = !0;
839
+ return;
840
+ }
841
+ const o = s[0], u = s[1];
842
+ return i !== 0 && !n ? [this.xy2SysCoordInternal(u)] : t.map((f, m) => m === 0 ? u : this._transformByIndex(f, o, !0)).map((f) => this.xy2SysCoordInternal(f));
843
+ });
844
+ }
845
+ // ─── 処理3: ビューポート変換 ───────────────────────────────────────────────
846
+ /**
847
+ * ビューポート → TIN 適用後メルカトル5点
848
+ * histmap_tin.ts viewpoint2MercsAsync() の同期版
849
+ *
850
+ * @param viewpoint - ビューポート(center, zoom, rotation)
851
+ * @param size - 画面サイズ [width, height]
852
+ * @returns TIN 変換後のメルカトル5点
853
+ */
854
+ viewpoint2Mercs(t, e) {
855
+ this._assertMapData(), this._assertMaxxy();
856
+ const s = et(t.center, t.zoom, t.rotation, e).map((f) => st(f, this._maxxy)), i = this.xy2MercWithLayer(s[0]);
857
+ if (!i) throw new Error("viewpoint2Mercs: center point is out of bounds");
858
+ const o = i[0], u = i[1];
859
+ return s.map((f, m) => {
860
+ if (m === 0) return u;
861
+ const a = this._transformByIndex(f, o, !1);
862
+ if (a === !1) throw new Error(`viewpoint2Mercs: point ${m} is out of bounds`);
863
+ return a;
864
+ });
865
+ }
866
+ /**
867
+ * TIN 適用後メルカトル5点 → ビューポート
868
+ * histmap_tin.ts mercs2ViewpointAsync() の同期版
869
+ *
870
+ * @param mercs - TIN 変換後のメルカトル5点
871
+ * @param size - 画面サイズ [width, height]
872
+ * @returns ビューポート(center, zoom, rotation)
873
+ */
874
+ mercs2Viewpoint(t, e) {
875
+ this._assertMapData(), this._assertMaxxy();
876
+ const n = this.merc2XyWithLayer(t[0]), s = n[0] || n[1];
877
+ if (!s) throw new Error("mercs2Viewpoint: center point is out of bounds");
878
+ const i = s[0], o = s[1], d = t.map((f, m) => {
879
+ if (m === 0) return o;
880
+ const a = this._transformByIndex(f, i, !0);
881
+ if (a === !1) throw new Error(`mercs2Viewpoint: point ${m} is out of bounds`);
882
+ return a;
883
+ }).map((f) => q(f, this._maxxy));
884
+ return nt(d, e);
885
+ }
886
+ // ─── ユーティリティ(静的メソッド)────────────────────────────────────────
887
+ /** zoom2Radius の静的ラッパー */
888
+ static zoom2Radius(t, e) {
889
+ return ct(t, e);
890
+ }
891
+ /** mercViewpoint2Mercs の静的ラッパー */
892
+ static mercViewpoint2Mercs(t, e, n, s) {
893
+ return et(t, e, n, s);
894
+ }
895
+ /** mercs2MercViewpoint の静的ラッパー */
896
+ static mercs2MercViewpoint(t, e) {
897
+ return nt(t, e);
898
+ }
899
+ /** xy2SysCoord の静的ラッパー */
900
+ static xy2SysCoord(t, e) {
901
+ return q(t, e);
902
+ }
903
+ /** sysCoord2Xy の静的ラッパー */
904
+ static sysCoord2Xy(t, e) {
905
+ return st(t, e);
906
+ }
907
+ // ─── 内部ヘルパー ──────────────────────────────────────────────────────────
908
+ _assertMapData() {
909
+ if (!this.mainTin)
910
+ throw new Error("setMapData() must be called before transformation");
911
+ }
912
+ _assertMaxxy() {
913
+ if (this._maxxy === 0)
914
+ throw new Error(
915
+ "MapData.maxZoom or compiled.wh must be set for viewpoint conversion (xy2SysCoord / sysCoord2Xy)"
916
+ );
917
+ }
918
+ /**
919
+ * レイヤーインデックスに対応する Transform インスタンスを返す(三角網描画などの用途)
920
+ *
921
+ * @param idx - 0 = メイン TIN、1以上 = sub_maps[idx-1]
922
+ * @returns 対応する Transform、または範囲外の場合は null
923
+ */
924
+ getLayerTransform(t) {
925
+ if (t === 0) return this.mainTin;
926
+ const e = this.subTins[t - 1];
927
+ return e ? e.tin : null;
928
+ }
929
+ /** レイヤー数を返す(メイン + sub 数) */
930
+ get layerCount() {
931
+ return 1 + this.subTins.length;
932
+ }
933
+ /**
934
+ * viewpoint 変換に使用する最大ピクセル幅(2^maxZoom × 256)
935
+ * stateToViewpoint / viewpointToState で zoom ↔ scale 変換に使用する
936
+ * zoom = log2(scale × maxxy / 256) の関係
937
+ */
938
+ get maxxy() {
939
+ return this._maxxy;
940
+ }
941
+ /** priority 降順でソートした [index, tin, isMain] の配列を返す */
942
+ _getTinsSortedByPriority() {
943
+ return this._getAllTinsWithIndex().sort((e, n) => {
944
+ const s = e.tin.priority ?? 0, i = n.tin.priority ?? 0;
945
+ return s < i ? 1 : -1;
946
+ });
947
+ }
948
+ /** メイン TIN + 全 sub TIN を index 付きで返す */
949
+ _getAllTinsWithIndex() {
950
+ const t = [
951
+ { index: 0, tin: this.mainTin, isMain: !0 }
952
+ ];
953
+ return this.subTins.forEach((e, n) => {
954
+ e.tin.priority = e.priority, e.tin.importance = e.importance, t.push({ index: n + 1, tin: e.tin, isMain: !1 });
955
+ }), t;
956
+ }
957
+ /**
958
+ * 指定レイヤーインデックスで TIN 変換を実行する
959
+ * index 0 → mainTin, index 1..n → subTins[index-1]
960
+ */
961
+ _transformByIndex(t, e, n) {
962
+ if (e === 0)
963
+ return this.mainTin.transform(t, n);
964
+ const s = this.subTins[e - 1];
965
+ return s ? s.tin.transform(t, n, !0) : !1;
966
+ }
967
+ /** 内部用 xy2SysCoord(_maxxy を使用) */
968
+ xy2SysCoordInternal(t) {
969
+ return q(t, this._maxxy);
970
+ }
971
+ }
675
972
  export {
676
- Z as Transform,
677
- Wt as counterTri,
678
- Xt as format_version,
679
- At as normalizeEdges,
680
- Ft as rotateVerticesTriangle,
681
- vt as transformArr
973
+ Ut as MERC_CROSSMATRIX,
974
+ R as MERC_MAX,
975
+ $t as MapTransform,
976
+ I as Transform,
977
+ Dt as counterTri,
978
+ Yt as format_version,
979
+ et as mercViewpoint2Mercs,
980
+ nt as mercs2MercViewpoint,
981
+ It as normalizeEdges,
982
+ Ft as rotateMatrix,
983
+ Vt as rotateVerticesTriangle,
984
+ st as sysCoord2Xy,
985
+ Tt as transformArr,
986
+ q as xy2SysCoord,
987
+ ct as zoom2Radius
682
988
  };