@kalisio/common-geospatial 0.6.0 → 0.8.0
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.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +667 -472
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
|
@@ -1,124 +1,156 @@
|
|
|
1
|
-
import { assert as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { assert as u, is as i, has as w, conform as E, optional as p } from "@kalisio/common-core";
|
|
2
|
+
import { coordAll as R } from "@turf/meta";
|
|
3
|
+
import { convex as de } from "@turf/convex";
|
|
4
|
+
import { featureCollection as ve, feature as he } from "@turf/helpers";
|
|
5
|
+
import { Heap as pe } from "heap-js";
|
|
6
|
+
import Ee from "@turf/truncate";
|
|
7
|
+
import ye from "@turf/boolean-clockwise";
|
|
8
|
+
import Oe from "@turf/kinks";
|
|
7
9
|
const d = {
|
|
8
10
|
LATITUDE: "LAT",
|
|
9
11
|
LONGITUDE: "LON",
|
|
10
12
|
ALTITUDE: "ALT"
|
|
11
13
|
};
|
|
12
|
-
function
|
|
13
|
-
return
|
|
14
|
+
function Te(e) {
|
|
15
|
+
return u.that(e, i.string, "axis must be a string"), Object.values(d).includes(e);
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
17
|
+
function k(e) {
|
|
18
|
+
return u.that(e, i.string, "axis must be a string"), e === d.LATITUDE;
|
|
17
19
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
+
function ne(e) {
|
|
21
|
+
return u.that(e, i.string, "axis must be a string"), e === d.LONGITUDE;
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
23
|
+
function Ot(e) {
|
|
24
|
+
return u.that(e, i.string, "axis must be a string"), e === d.ALTITUDE;
|
|
23
25
|
}
|
|
24
|
-
const
|
|
25
|
-
DIRECTIONS:
|
|
26
|
-
},
|
|
27
|
-
DIRECTIONS:
|
|
28
|
-
},
|
|
26
|
+
const Ie = { NORTH: { label: "Nord", symbol: "N" }, SOUTH: { label: "Sud", symbol: "S" }, EAST: { label: "Est", symbol: "E" }, WEST: { label: "Ouest", symbol: "O" } }, Le = {
|
|
27
|
+
DIRECTIONS: Ie
|
|
28
|
+
}, Se = { NORTH: { label: "North", symbol: "N" }, SOUTH: { label: "South", symbol: "S" }, EAST: { label: "East", symbol: "E" }, WEST: { label: "West", symbol: "W" } }, be = {
|
|
29
|
+
DIRECTIONS: Se
|
|
30
|
+
}, De = {
|
|
29
31
|
DIRECTIONS: {
|
|
30
|
-
NORTH: { label: i.string, symbol: i.
|
|
31
|
-
SOUTH: { label: i.string, symbol: i.
|
|
32
|
-
EAST: { label: i.string, symbol: i.
|
|
33
|
-
WEST: { label: i.string, symbol: i.
|
|
32
|
+
NORTH: { label: i.string, symbol: i.char },
|
|
33
|
+
SOUTH: { label: i.string, symbol: i.char },
|
|
34
|
+
EAST: { label: i.string, symbol: i.char },
|
|
35
|
+
WEST: { label: i.string, symbol: i.char }
|
|
34
36
|
}
|
|
35
|
-
},
|
|
36
|
-
en:
|
|
37
|
-
fr:
|
|
37
|
+
}, I = {
|
|
38
|
+
en: be,
|
|
39
|
+
fr: Le
|
|
38
40
|
};
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
let S = "en";
|
|
42
|
+
const z = "en";
|
|
43
|
+
function Tt() {
|
|
44
|
+
return Object.keys(I);
|
|
42
45
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
46
|
+
function It(e, t) {
|
|
47
|
+
u.all([
|
|
45
48
|
{ value: e, validator: i.string, message: "code must be a string" },
|
|
46
|
-
{ value: e, validator: (
|
|
49
|
+
{ value: e, validator: (n) => !w.key(I, n), message: "locale already registered" },
|
|
47
50
|
{ value: t, validator: i.plainObject, message: "content must be an object" },
|
|
48
|
-
{ value: t, validator: (
|
|
49
|
-
]),
|
|
51
|
+
{ value: t, validator: (n) => E.schema(n, De), message: "content does not conform to schema" }
|
|
52
|
+
]), I[e] = t;
|
|
50
53
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
54
|
+
function Lt(e) {
|
|
55
|
+
u.all([
|
|
53
56
|
{ value: e, validator: i.string, message: "code must be a string" },
|
|
54
|
-
{ value: e, validator: (t) =>
|
|
55
|
-
]),
|
|
57
|
+
{ value: e, validator: (t) => w.key(I, t), message: "code is unknown" }
|
|
58
|
+
]), S = e;
|
|
56
59
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
function Re() {
|
|
61
|
+
return S;
|
|
62
|
+
}
|
|
63
|
+
function B(e) {
|
|
64
|
+
return u.all([
|
|
65
|
+
{ value: e, validator: i.string, message: "code must be a string" },
|
|
66
|
+
{ value: e, validator: (t) => w.key(I, t), message: "code is unknown" }
|
|
67
|
+
]), I[e];
|
|
68
|
+
}
|
|
69
|
+
function re() {
|
|
70
|
+
return S === z ? [S] : [S, z];
|
|
71
|
+
}
|
|
72
|
+
function H(e) {
|
|
73
|
+
const t = /* @__PURE__ */ new Set();
|
|
74
|
+
for (const n of re()) {
|
|
75
|
+
const { DIRECTIONS: r } = B(n);
|
|
76
|
+
for (const a of e) t.add(r[a].symbol);
|
|
77
|
+
}
|
|
78
|
+
return [...t];
|
|
79
|
+
}
|
|
80
|
+
function Ae() {
|
|
81
|
+
return H(["NORTH", "SOUTH"]);
|
|
82
|
+
}
|
|
83
|
+
function Me() {
|
|
84
|
+
return H(["EAST", "WEST"]);
|
|
85
|
+
}
|
|
86
|
+
function j() {
|
|
87
|
+
return H(["NORTH", "SOUTH", "EAST", "WEST"]);
|
|
62
88
|
}
|
|
63
89
|
function b() {
|
|
64
|
-
return
|
|
90
|
+
return B(Re()).DIRECTIONS;
|
|
65
91
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
return
|
|
92
|
+
function _(e, t) {
|
|
93
|
+
const n = t.toUpperCase();
|
|
94
|
+
return re().some((r) => {
|
|
95
|
+
const { label: a, symbol: s } = B(r).DIRECTIONS[e];
|
|
96
|
+
return n === a.toUpperCase() || n === s.toUpperCase();
|
|
97
|
+
});
|
|
69
98
|
}
|
|
70
|
-
function
|
|
99
|
+
function St(e = null) {
|
|
71
100
|
const t = b();
|
|
72
|
-
return i.defined(e) ? (
|
|
101
|
+
return i.defined(e) ? (u.that(e, Te, "axis must be a valid axis"), k(e) ? [t.SOUTH, t.NORTH] : ne(e) ? [t.EAST, t.WEST] : []) : [t.SOUTH, t.NORTH, t.EAST, t.WEST];
|
|
73
102
|
}
|
|
74
|
-
function
|
|
103
|
+
function bt() {
|
|
75
104
|
return b().NORTH;
|
|
76
105
|
}
|
|
77
|
-
function
|
|
106
|
+
function Dt() {
|
|
78
107
|
return b().SOUTH;
|
|
79
108
|
}
|
|
80
|
-
function
|
|
109
|
+
function Rt() {
|
|
81
110
|
return b().EAST;
|
|
82
111
|
}
|
|
83
|
-
function
|
|
112
|
+
function At() {
|
|
84
113
|
return b().WEST;
|
|
85
114
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
115
|
+
function O(e) {
|
|
116
|
+
return u.that(e, i.string, "dir must be a string"), Ce(e) || ie(e) || V(e) || $(e);
|
|
88
117
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
118
|
+
function Ce(e) {
|
|
119
|
+
return u.that(e, i.string, "dir must be a string"), _("NORTH", e);
|
|
91
120
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
121
|
+
function ie(e) {
|
|
122
|
+
return u.that(e, i.string, "dir must be a string"), _("SOUTH", e);
|
|
94
123
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
124
|
+
function V(e) {
|
|
125
|
+
return u.that(e, i.string, "dir must be a string"), _("EAST", e);
|
|
97
126
|
}
|
|
98
|
-
function
|
|
99
|
-
return
|
|
127
|
+
function $(e) {
|
|
128
|
+
return u.that(e, i.string, "dir must be a string"), _("WEST", e);
|
|
100
129
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
130
|
+
function Ne(e) {
|
|
131
|
+
return u.that(e, O, "dir must be a direction"), $(e) || V(e) ? d.LONGITUDE : d.LATITUDE;
|
|
103
132
|
}
|
|
104
|
-
const
|
|
133
|
+
const we = {
|
|
105
134
|
degrees: i.number,
|
|
106
|
-
direction:
|
|
107
|
-
},
|
|
108
|
-
function
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
135
|
+
direction: p(O)
|
|
136
|
+
}, _e = /^(-?\d{1,3}(?:\.\d+)?)°?$/;
|
|
137
|
+
function $e() {
|
|
138
|
+
return new RegExp(`^(\\d{1,3}(?:\\.\\d+)?)°?([${j()}])$`, "i");
|
|
139
|
+
}
|
|
140
|
+
function D(e) {
|
|
141
|
+
let t = null, n = null;
|
|
142
|
+
if (i.plainObject(e) && E.schema(e, we))
|
|
143
|
+
i.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, n = e.direction) : t = e.degrees;
|
|
112
144
|
else if (i.string(e)) {
|
|
113
|
-
const
|
|
114
|
-
|
|
145
|
+
const r = e.replace(/\s+/g, ""), a = r.match(_e) ?? r.match($e());
|
|
146
|
+
a && (t = parseFloat(a[1]), n = a[2] ?? null);
|
|
115
147
|
}
|
|
116
148
|
return {
|
|
117
149
|
get degrees() {
|
|
118
150
|
return t;
|
|
119
151
|
},
|
|
120
152
|
get direction() {
|
|
121
|
-
return
|
|
153
|
+
return n;
|
|
122
154
|
},
|
|
123
155
|
get format() {
|
|
124
156
|
return "DD";
|
|
@@ -126,249 +158,382 @@ function I(e) {
|
|
|
126
158
|
isValid() {
|
|
127
159
|
return i.number(t);
|
|
128
160
|
},
|
|
129
|
-
toString(
|
|
130
|
-
if (
|
|
131
|
-
let
|
|
132
|
-
return
|
|
161
|
+
toString(r) {
|
|
162
|
+
if (u.that(r, i.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
|
|
163
|
+
let a = `${t.toFixed(r)}°`;
|
|
164
|
+
return n && (a += ` ${n}`), a;
|
|
133
165
|
},
|
|
134
166
|
toDecimal() {
|
|
135
|
-
return this.isValid() ?
|
|
167
|
+
return this.isValid() ? D({ degrees: t, direction: n }) : null;
|
|
136
168
|
}
|
|
137
169
|
};
|
|
138
170
|
}
|
|
139
|
-
const
|
|
171
|
+
const Fe = {
|
|
140
172
|
degrees: i.integer,
|
|
141
173
|
minutes: (e) => i.inRangeExclusiveMax(e, 0, 60),
|
|
142
|
-
direction:
|
|
143
|
-
},
|
|
144
|
-
function
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
174
|
+
direction: p(O)
|
|
175
|
+
}, xe = /^(-?\d{1,3})°(\d{1,2}(?:\.\d+)?)'?$/;
|
|
176
|
+
function Ue() {
|
|
177
|
+
return new RegExp(`^(\\d{1,3})°(\\d{1,2}(?:\\.\\d+)?)'?([${j().join("")}])$`, "i");
|
|
178
|
+
}
|
|
179
|
+
function ae(e) {
|
|
180
|
+
let t = null, n = null, r = null;
|
|
181
|
+
if (i.plainObject(e) && E.schema(e, Fe))
|
|
182
|
+
i.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, n = e.minutes, r = e.direction) : (t = e.degrees, n = e.minutes);
|
|
148
183
|
else if (i.string(e)) {
|
|
149
|
-
const
|
|
150
|
-
|
|
184
|
+
const a = e.replace(/\s+/g, ""), s = a.match(xe) ?? a.match(Ue());
|
|
185
|
+
s && (t = parseFloat(s[1]), n = parseFloat(s[2]), r = s[3] ?? null);
|
|
151
186
|
}
|
|
152
187
|
return {
|
|
153
188
|
get degrees() {
|
|
154
189
|
return t;
|
|
155
190
|
},
|
|
156
191
|
get minutes() {
|
|
157
|
-
return
|
|
192
|
+
return n;
|
|
158
193
|
},
|
|
159
194
|
get direction() {
|
|
160
|
-
return
|
|
195
|
+
return r;
|
|
161
196
|
},
|
|
162
197
|
get format() {
|
|
163
198
|
return "DDM";
|
|
164
199
|
},
|
|
165
200
|
isValid() {
|
|
166
|
-
return i.integer(t) && i.inRangeExclusiveMax(
|
|
201
|
+
return i.integer(t) && i.inRangeExclusiveMax(n, 0, 60);
|
|
167
202
|
},
|
|
168
|
-
toString(
|
|
169
|
-
if (
|
|
170
|
-
let
|
|
171
|
-
return
|
|
203
|
+
toString(a) {
|
|
204
|
+
if (u.that(a, i.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
|
|
205
|
+
let s = `${t}° ${n.toFixed(a)}'`;
|
|
206
|
+
return r && (s += ` ${r}`), s;
|
|
172
207
|
},
|
|
173
208
|
toDecimal() {
|
|
174
|
-
return this.isValid() ?
|
|
209
|
+
return this.isValid() ? D({ degrees: t + n / 60, direction: r }) : null;
|
|
175
210
|
}
|
|
176
211
|
};
|
|
177
212
|
}
|
|
178
|
-
const
|
|
213
|
+
const Ge = {
|
|
179
214
|
degrees: i.nonNegativeInteger,
|
|
180
215
|
minutes: (e) => i.inRangeExclusiveMax(e, 0, 60),
|
|
181
|
-
direction:
|
|
182
|
-
}
|
|
183
|
-
function
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
216
|
+
direction: O
|
|
217
|
+
};
|
|
218
|
+
function ke() {
|
|
219
|
+
return new RegExp(`^(\\d{2})(\\d{3})([${Ae().join("")}])$`, "i");
|
|
220
|
+
}
|
|
221
|
+
function Pe() {
|
|
222
|
+
return new RegExp(`^(\\d{3})(\\d{3})([${Me().join("")}])$`, "i");
|
|
223
|
+
}
|
|
224
|
+
function se(e) {
|
|
225
|
+
let t = null, n = null, r = null;
|
|
226
|
+
if (i.plainObject(e) && E.schema(e, Ge))
|
|
227
|
+
t = e.degrees, n = e.minutes, r = e.direction;
|
|
187
228
|
else if (i.string(e)) {
|
|
188
|
-
const
|
|
189
|
-
|
|
229
|
+
const a = e.trim(), s = a.match(ke()) ?? a.match(Pe());
|
|
230
|
+
s && (t = parseFloat(s[1]), n = parseFloat(s[2]) / 10, r = s[3]);
|
|
190
231
|
}
|
|
191
232
|
return {
|
|
192
233
|
get degrees() {
|
|
193
234
|
return t;
|
|
194
235
|
},
|
|
195
236
|
get minutes() {
|
|
196
|
-
return
|
|
237
|
+
return n;
|
|
197
238
|
},
|
|
198
239
|
get direction() {
|
|
199
|
-
return
|
|
240
|
+
return r;
|
|
200
241
|
},
|
|
201
242
|
get format() {
|
|
202
243
|
return "DDM_AERO";
|
|
203
244
|
},
|
|
204
245
|
isValid() {
|
|
205
|
-
return i.nonNegativeInteger(t) && i.inRangeExclusiveMax(
|
|
246
|
+
return i.nonNegativeInteger(t) && i.inRangeExclusiveMax(n, 0, 60) && O(r);
|
|
206
247
|
},
|
|
207
248
|
toString() {
|
|
208
249
|
if (!this.isValid()) return "";
|
|
209
|
-
const
|
|
210
|
-
return `${
|
|
250
|
+
const a = V(r) || $(r), s = String(t).padStart(a ? 3 : 2, "0"), l = Math.floor(n * 10).toString().padStart(3, "0");
|
|
251
|
+
return `${s}${l}${r}`;
|
|
211
252
|
},
|
|
212
253
|
toDecimal() {
|
|
213
|
-
return this.isValid() ?
|
|
254
|
+
return this.isValid() ? D({ degrees: t + n / 60, direction: r }) : null;
|
|
214
255
|
}
|
|
215
256
|
};
|
|
216
257
|
}
|
|
217
|
-
const
|
|
258
|
+
const Be = {
|
|
218
259
|
degrees: i.integer,
|
|
219
260
|
minutes: (e) => i.integer(e) && i.inRange(e, 0, 59),
|
|
220
261
|
seconds: (e) => i.inRangeExclusiveMax(e, 0, 60),
|
|
221
|
-
direction:
|
|
222
|
-
},
|
|
223
|
-
function
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
262
|
+
direction: p(O)
|
|
263
|
+
}, He = /^(-?\d{1,3})°(\d{1,2})'(\d{1,2}(?:\.\d+)?)"?$/;
|
|
264
|
+
function je() {
|
|
265
|
+
return new RegExp(`^(\\d{1,3})°(\\d{1,2})'(\\d{1,2}(?:\\.\\d+)?)"?([${j().join("")}])$`, "i");
|
|
266
|
+
}
|
|
267
|
+
function oe(e) {
|
|
268
|
+
let t = null, n = null, r = null, a = null;
|
|
269
|
+
if (i.plainObject(e) && E.schema(e, Be))
|
|
270
|
+
i.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, n = e.minutes, r = e.seconds, a = e.direction) : (t = e.degrees, n = e.minutes, r = e.seconds);
|
|
227
271
|
else if (i.string(e)) {
|
|
228
|
-
const
|
|
229
|
-
|
|
272
|
+
const s = e.replace(/\s+/g, ""), l = s.match(He) ?? s.match(je());
|
|
273
|
+
l && (t = parseFloat(l[1]), n = parseFloat(l[2]), r = parseFloat(l[3]), a = l[4] ?? null);
|
|
230
274
|
}
|
|
231
275
|
return {
|
|
232
276
|
get degrees() {
|
|
233
277
|
return t;
|
|
234
278
|
},
|
|
235
279
|
get minutes() {
|
|
236
|
-
return
|
|
280
|
+
return n;
|
|
237
281
|
},
|
|
238
282
|
get seconds() {
|
|
239
|
-
return
|
|
283
|
+
return r;
|
|
240
284
|
},
|
|
241
285
|
get direction() {
|
|
242
|
-
return
|
|
286
|
+
return a;
|
|
243
287
|
},
|
|
244
288
|
get format() {
|
|
245
289
|
return "DMS";
|
|
246
290
|
},
|
|
247
291
|
isValid() {
|
|
248
|
-
return i.integer(t) && i.integer(
|
|
292
|
+
return i.integer(t) && i.integer(n) && i.inRange(n, 0, 59) && i.inRangeExclusiveMax(r, 0, 60);
|
|
249
293
|
},
|
|
250
|
-
toString(
|
|
251
|
-
if (
|
|
252
|
-
let
|
|
253
|
-
return
|
|
294
|
+
toString(s) {
|
|
295
|
+
if (u.that(s, i.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
|
|
296
|
+
let l = `${t}° ${n}' ${r.toFixed(s)}"`;
|
|
297
|
+
return a && (l += ` ${a}`), l;
|
|
254
298
|
},
|
|
255
299
|
toDecimal() {
|
|
256
|
-
return this.isValid() ?
|
|
300
|
+
return this.isValid() ? D({ degrees: t + n / 60 + r / 3600, direction: a }) : null;
|
|
257
301
|
}
|
|
258
302
|
};
|
|
259
303
|
}
|
|
260
|
-
function
|
|
261
|
-
const t = Math.floor(e.degrees),
|
|
262
|
-
return { degrees: t, minutes:
|
|
304
|
+
function q(e) {
|
|
305
|
+
const t = Math.floor(e.degrees), n = (e.degrees - t) * 60;
|
|
306
|
+
return { degrees: t, minutes: n, direction: e.direction };
|
|
263
307
|
}
|
|
264
|
-
function
|
|
265
|
-
const t = Math.floor(e.degrees),
|
|
266
|
-
return { degrees: t, minutes:
|
|
308
|
+
function Ve(e) {
|
|
309
|
+
const t = Math.floor(e.degrees), n = (e.degrees - t) * 60, r = Math.floor(n), a = (n - r) * 60;
|
|
310
|
+
return { degrees: t, minutes: r, seconds: a, direction: e.direction };
|
|
267
311
|
}
|
|
268
|
-
const
|
|
269
|
-
DD: (e) => (
|
|
312
|
+
const Q = {
|
|
313
|
+
DD: (e) => (u.that(e, (t) => t.isValid(), "dd must be a valid coordinate"), e),
|
|
270
314
|
DDM: (e) => {
|
|
271
|
-
|
|
272
|
-
const { degrees: t, minutes:
|
|
273
|
-
return
|
|
315
|
+
u.that(e, (a) => a.isValid(), "dd must be a valid coordinate");
|
|
316
|
+
const { degrees: t, minutes: n, direction: r } = q(e);
|
|
317
|
+
return ae(r ? { degrees: t, minutes: n, direction: r } : { degrees: t, minutes: n });
|
|
274
318
|
},
|
|
275
319
|
DMS: (e) => {
|
|
276
|
-
|
|
277
|
-
const { degrees: t, minutes:
|
|
278
|
-
return
|
|
320
|
+
u.that(e, (s) => s.isValid(), "dd must be a valid coordinate");
|
|
321
|
+
const { degrees: t, minutes: n, seconds: r, direction: a } = Ve(e);
|
|
322
|
+
return oe(a ? { degrees: t, minutes: n, seconds: r, direction: a } : { degrees: t, minutes: n, seconds: r });
|
|
279
323
|
},
|
|
280
324
|
DDM_AERO: (e) => {
|
|
281
|
-
|
|
282
|
-
const { degrees: t, minutes:
|
|
283
|
-
return
|
|
325
|
+
u.that(e, (a) => a.isValid(), "dd must be a valid coordinate");
|
|
326
|
+
const { degrees: t, minutes: n, direction: r } = q(e);
|
|
327
|
+
return se({ degrees: t, minutes: n, direction: r });
|
|
284
328
|
}
|
|
285
|
-
},
|
|
329
|
+
}, P = {
|
|
286
330
|
DD: "DD",
|
|
287
331
|
DDM: "DDM",
|
|
288
332
|
DDM_AERO: "DDM_AERO",
|
|
289
333
|
DMS: "DMS"
|
|
290
|
-
},
|
|
291
|
-
DD:
|
|
292
|
-
DDM:
|
|
293
|
-
DDM_AERO:
|
|
294
|
-
DMS:
|
|
295
|
-
},
|
|
296
|
-
function
|
|
297
|
-
if (
|
|
298
|
-
return
|
|
334
|
+
}, Ye = {
|
|
335
|
+
DD: D,
|
|
336
|
+
DDM: ae,
|
|
337
|
+
DDM_AERO: se,
|
|
338
|
+
DMS: oe
|
|
339
|
+
}, Y = Array.from({ length: 9 }, (e, t) => 10 ** t);
|
|
340
|
+
function Z(e, t) {
|
|
341
|
+
if (u.that(e, i.number, "coord must be a number"), i.defined(t))
|
|
342
|
+
return u.that(t, O, "dir must be a direction"), Ne(t);
|
|
299
343
|
if (Math.abs(e) > 90) return d.LONGITUDE;
|
|
300
344
|
}
|
|
301
|
-
function
|
|
302
|
-
|
|
303
|
-
const t = e.toExponential(), [
|
|
304
|
-
return Math.max(0,
|
|
345
|
+
function J(e) {
|
|
346
|
+
u.that(e, i.number, "coord must be a number");
|
|
347
|
+
const t = e.toExponential(), [n, r] = t.split("e").map(Number), a = (n.toString().split(".")[1] || "").length;
|
|
348
|
+
return Math.max(0, a - r);
|
|
305
349
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
350
|
+
function Mt(e, t = 7) {
|
|
351
|
+
u.all([
|
|
308
352
|
{ value: e, validator: i.number, message: "coord must be a number" },
|
|
309
|
-
{ value: t, validator: (
|
|
353
|
+
{ value: t, validator: (r) => i.inRange(r, 0, 8), message: "precision must be in range [0, 8]" }
|
|
310
354
|
]);
|
|
311
|
-
const
|
|
312
|
-
return Math.round(e *
|
|
355
|
+
const n = Y[t];
|
|
356
|
+
return Math.round(e * n) / n;
|
|
313
357
|
}
|
|
314
|
-
function
|
|
315
|
-
if (
|
|
358
|
+
function Ct(e, t) {
|
|
359
|
+
if (u.all([
|
|
316
360
|
{ value: e, validator: i.number, message: "coord must be a number" },
|
|
317
|
-
{ value: t, validator: (
|
|
318
|
-
]),
|
|
361
|
+
{ value: t, validator: (r) => ne(r) || k(r), message: "axis must be either a longitude or latitude" }
|
|
362
|
+
]), k(t))
|
|
319
363
|
return Math.max(-90, Math.min(90, e));
|
|
320
|
-
let
|
|
321
|
-
return
|
|
364
|
+
let n = ((e + 180) % 360 + 360) % 360 - 180;
|
|
365
|
+
return n === -180 && (n = 180), Object.is(n, -0) && (n = 0), n;
|
|
322
366
|
}
|
|
323
|
-
function
|
|
324
|
-
|
|
325
|
-
{ value: e, validator: (
|
|
326
|
-
{ value: t, validator: (
|
|
367
|
+
function Nt(e, t) {
|
|
368
|
+
u.all([
|
|
369
|
+
{ value: e, validator: (r) => i.defined(r) && r.isValid(), message: "from must be a valid coordinate" },
|
|
370
|
+
{ value: t, validator: (r) => w.key(Q, r), message: `unknown format: ${t}` }
|
|
327
371
|
]);
|
|
328
|
-
const
|
|
329
|
-
return
|
|
330
|
-
}
|
|
331
|
-
function
|
|
332
|
-
|
|
333
|
-
for (const t of Object.keys(
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
372
|
+
const n = e.format === P.DD ? e : e.toDecimal();
|
|
373
|
+
return n.isValid() ? t === P.DD ? n : Q[t](n) : null;
|
|
374
|
+
}
|
|
375
|
+
function We(e) {
|
|
376
|
+
u.that(e, i.nonEmptyString, "pattern must be a non empty string");
|
|
377
|
+
for (const t of Object.keys(P)) {
|
|
378
|
+
const n = Ye[t](e);
|
|
379
|
+
if (n.isValid()) return n;
|
|
336
380
|
}
|
|
337
381
|
return null;
|
|
338
382
|
}
|
|
339
|
-
function
|
|
340
|
-
|
|
383
|
+
function wt(e) {
|
|
384
|
+
u.that(e, (o) => i.nonEmptyString(o), "pattern must be a non-empty string");
|
|
341
385
|
const t = e.split(/[,;|]/);
|
|
342
386
|
if (t.length !== 2) return null;
|
|
343
|
-
const [
|
|
344
|
-
if (!
|
|
345
|
-
const
|
|
346
|
-
const { degrees:
|
|
347
|
-
return
|
|
387
|
+
const [n, r] = t.map(We);
|
|
388
|
+
if (!n || !r) return null;
|
|
389
|
+
const a = n.toDecimal(), s = r.toDecimal(), l = Z(a.degrees, a.direction), m = Z(s.degrees, s.direction), c = (o) => {
|
|
390
|
+
const { degrees: v, direction: f } = o;
|
|
391
|
+
return f && ($(f) || ie(f)) ? -v : v;
|
|
348
392
|
};
|
|
349
|
-
if (
|
|
350
|
-
if (
|
|
351
|
-
if (
|
|
352
|
-
if (
|
|
353
|
-
if (
|
|
354
|
-
if (
|
|
355
|
-
if (!
|
|
393
|
+
if (l === d.LONGITUDE && m === d.LATITUDE) return [c(a), c(s)];
|
|
394
|
+
if (m === d.LONGITUDE && l === d.LATITUDE) return [c(s), c(a)];
|
|
395
|
+
if (l === d.LONGITUDE && !m) return [c(a), s];
|
|
396
|
+
if (l === d.LATITUDE && !m) return [c(s), c(a)];
|
|
397
|
+
if (m === d.LONGITUDE && !l) return [c(s), c(a)];
|
|
398
|
+
if (m === d.LATITUDE && !l) return [c(a), c(s)];
|
|
399
|
+
if (!l && !m)
|
|
356
400
|
return [
|
|
357
|
-
[c(
|
|
358
|
-
[c(
|
|
401
|
+
[c(a), c(s)],
|
|
402
|
+
[c(s), c(a)]
|
|
359
403
|
];
|
|
360
404
|
}
|
|
361
|
-
function
|
|
362
|
-
return !i.
|
|
405
|
+
function y(e) {
|
|
406
|
+
return !(!i.arrayOfLengthBetween(e, 2, 3) || !i.number(e[0]) || !i.number(e[1]) || !i.inRange(e[0], -180, 180) || !i.inRange(e[1], -90, 90) || e.length === 3 && !i.number(e[2]));
|
|
363
407
|
}
|
|
364
|
-
|
|
408
|
+
function Xe(e) {
|
|
409
|
+
return u.that(e, y, "position must be a valid position"), i.arrayOfLength(e, 3);
|
|
410
|
+
}
|
|
411
|
+
const Ke = {
|
|
412
|
+
precision: p(i.number),
|
|
413
|
+
consider3D: p(i.boolean)
|
|
414
|
+
};
|
|
415
|
+
function _t(e, t, n = {}) {
|
|
416
|
+
u.all([
|
|
417
|
+
{
|
|
418
|
+
value: e,
|
|
419
|
+
validator: y,
|
|
420
|
+
message: "position1 must be a valid position"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
value: t,
|
|
424
|
+
validator: y,
|
|
425
|
+
message: "position2 must be a valid position"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
value: n,
|
|
429
|
+
validator: (l) => E.schema(l, Ke),
|
|
430
|
+
message: "options must be a valid options object"
|
|
431
|
+
}
|
|
432
|
+
]);
|
|
433
|
+
const { precision: r = 10, consider3D: a = !1 } = n, s = a ? Math.max(e.length, t.length) : 2;
|
|
434
|
+
return Array.from(
|
|
435
|
+
{ length: s },
|
|
436
|
+
(l, m) => (e[m] ?? 0).toFixed(r) === (t[m] ?? 0).toFixed(r)
|
|
437
|
+
).every(Boolean);
|
|
438
|
+
}
|
|
439
|
+
function $t(e, t = 7) {
|
|
440
|
+
u.all([
|
|
441
|
+
{ value: e, validator: y, message: "position must be a position" },
|
|
442
|
+
{ value: t, validator: (r) => i.inRange(r, 0, 8), message: "precision must be in range [0, 8]" }
|
|
443
|
+
]);
|
|
444
|
+
const n = Y[t];
|
|
445
|
+
for (let r = 0; r < e.length; r++)
|
|
446
|
+
e[r] = Math.round(e[r] * n) / n;
|
|
447
|
+
return e;
|
|
448
|
+
}
|
|
449
|
+
function A(e) {
|
|
450
|
+
if (!i.arrayOfLength(e, 4) && !i.arrayOfLength(e, 6)) return !1;
|
|
451
|
+
const t = e.length === 4, n = t ? [e[0], e[1]] : [e[0], e[1], e[2]], r = t ? [e[2], e[3]] : [e[3], e[4], e[5]];
|
|
452
|
+
if (!y(n) || !y(r)) return !1;
|
|
453
|
+
const [, a] = n, [, s] = r;
|
|
454
|
+
return !(a > s || !t && e[2] > e[5]);
|
|
455
|
+
}
|
|
456
|
+
function ee(e) {
|
|
457
|
+
return u.that(e, A, "bbox must be a valid bounding-box"), i.arrayOfLength(e, 6);
|
|
458
|
+
}
|
|
459
|
+
function Ft(e, t) {
|
|
460
|
+
return u.all([
|
|
461
|
+
{ value: e, validator: A, message: "bbox1 must be a valid bounding-box" },
|
|
462
|
+
{ value: t, validator: A, message: "bbox2 must be a valid bounding-box" }
|
|
463
|
+
]), ee(e) && ee(t) ? [
|
|
464
|
+
Math.min(e[0], t[0]),
|
|
465
|
+
Math.min(e[1], t[1]),
|
|
466
|
+
Math.min(e[2], t[2]),
|
|
467
|
+
Math.max(e[3], t[3]),
|
|
468
|
+
Math.max(e[4], t[4]),
|
|
469
|
+
Math.max(e[5], t[5])
|
|
470
|
+
] : [
|
|
471
|
+
Math.min(e[0], t[0]),
|
|
472
|
+
Math.min(e[1], t[1]),
|
|
473
|
+
Math.max(e[2], t[2]),
|
|
474
|
+
Math.max(e[3], t[3])
|
|
475
|
+
];
|
|
476
|
+
}
|
|
477
|
+
const ze = {
|
|
478
|
+
ignore3D: p(i.boolean)
|
|
479
|
+
};
|
|
480
|
+
function x(e, t = {}) {
|
|
481
|
+
u.all([
|
|
482
|
+
{
|
|
483
|
+
value: e,
|
|
484
|
+
validator: i.nonEmptyArray,
|
|
485
|
+
message: "positions must be a non-empty array"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
value: e,
|
|
489
|
+
validator: (a) => a.every(y),
|
|
490
|
+
message: "positions must be an array of valid positions"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
value: t,
|
|
494
|
+
validator: (a) => E.schema(a, ze),
|
|
495
|
+
message: "options must be a valid options object"
|
|
496
|
+
}
|
|
497
|
+
]);
|
|
498
|
+
const { ignore3D: n = !1 } = t;
|
|
499
|
+
return !n && e.some(Xe) ? e.reduce((a, s) => [
|
|
500
|
+
Math.min(a[0], s[0]),
|
|
501
|
+
Math.min(a[1], s[1]),
|
|
502
|
+
Math.min(a[2], s[2] ?? 0),
|
|
503
|
+
Math.max(a[3], s[0]),
|
|
504
|
+
Math.max(a[4], s[1]),
|
|
505
|
+
Math.max(a[5], s[2] ?? 0)
|
|
506
|
+
], [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0]) : e.reduce((a, s) => [
|
|
507
|
+
Math.min(a[0], s[0]),
|
|
508
|
+
Math.min(a[1], s[1]),
|
|
509
|
+
Math.max(a[2], s[0]),
|
|
510
|
+
Math.max(a[3], s[1])
|
|
511
|
+
], [1 / 0, 1 / 0, -1 / 0, -1 / 0]);
|
|
512
|
+
}
|
|
513
|
+
function ue(e, t = 7) {
|
|
514
|
+
u.all([
|
|
515
|
+
{ value: e, validator: A, message: "bbox must be a valid bounding box" },
|
|
516
|
+
{ value: t, validator: (r) => i.inRange(r, 0, 8), message: "precision must be in range [0, 8]" }
|
|
517
|
+
]);
|
|
518
|
+
const n = Y[t];
|
|
519
|
+
for (let r = 0; r < e.length; r++)
|
|
520
|
+
e[r] = Math.round(e[r] * n) / n;
|
|
521
|
+
return e;
|
|
522
|
+
}
|
|
523
|
+
const M = {
|
|
365
524
|
NAME: "name",
|
|
366
525
|
LINK: "link"
|
|
367
526
|
};
|
|
368
|
-
function
|
|
369
|
-
return i.plainObject(e) ? e.type ===
|
|
527
|
+
function xt(e) {
|
|
528
|
+
return i.plainObject(e) ? e.type === M.NAME ? i.nonEmptyString(e.properties?.name) : e.type === M.LINK ? i.nonEmptyString(e.properties?.href) : !1 : !1;
|
|
529
|
+
}
|
|
530
|
+
function Ut(e) {
|
|
531
|
+
return i.arrayOfLengthBetween(e, 2, 3) ? e.every(i.number) : !1;
|
|
370
532
|
}
|
|
371
|
-
|
|
533
|
+
function Gt(e) {
|
|
534
|
+
return !i.arrayOfLength(e, 4) && !i.arrayOfLength(e, 6) ? !1 : e.every(i.number);
|
|
535
|
+
}
|
|
536
|
+
const g = {
|
|
372
537
|
POINT: "Point",
|
|
373
538
|
MULTI_POINT: "MultiPoint",
|
|
374
539
|
LINESTRING: "LineString",
|
|
@@ -377,138 +542,141 @@ const f = {
|
|
|
377
542
|
MULTI_POLYGON: "MultiPolygon",
|
|
378
543
|
GEOMETRY_COLLECTION: "GeometryCollection"
|
|
379
544
|
};
|
|
380
|
-
function
|
|
381
|
-
return !i.plainObject(e) || !i.oneOf(e.type, Object.values(
|
|
545
|
+
function qe(e) {
|
|
546
|
+
return !i.plainObject(e) || !i.oneOf(e.type, Object.values(g)) ? !1 : e.type === g.GEOMETRY_COLLECTION ? i.array(e.geometries) : i.array(e.coordinates);
|
|
382
547
|
}
|
|
383
|
-
const
|
|
548
|
+
const h = {
|
|
384
549
|
FEATURE: "Feature",
|
|
385
550
|
FEATURE_COLLECTION: "FeatureCollection"
|
|
386
551
|
};
|
|
387
|
-
function
|
|
388
|
-
return i.plainObject(e)
|
|
552
|
+
function Qe(e) {
|
|
553
|
+
return i.plainObject(e) && e.type === h.FEATURE;
|
|
389
554
|
}
|
|
390
|
-
function
|
|
391
|
-
return
|
|
555
|
+
function Ze(e) {
|
|
556
|
+
return i.plainObject(e) && e.type === h.FEATURE_COLLECTION && i.array(e.features);
|
|
392
557
|
}
|
|
393
|
-
function
|
|
394
|
-
return
|
|
558
|
+
function Je(e) {
|
|
559
|
+
return Qe(e) || Ze(e);
|
|
395
560
|
}
|
|
396
|
-
function
|
|
397
|
-
return
|
|
561
|
+
function F(e) {
|
|
562
|
+
return Je(e) || qe(e);
|
|
398
563
|
}
|
|
399
|
-
|
|
564
|
+
const et = {
|
|
565
|
+
ignore3D: p(i.boolean)
|
|
566
|
+
};
|
|
567
|
+
function kt(e, t = {}) {
|
|
568
|
+
if (u.all([
|
|
569
|
+
{ value: e, validator: F, message: "geoJson must be a GeoJson object" },
|
|
570
|
+
{ value: t, validator: (n) => E.schema(n, et), message: "options must be a valid options object" }
|
|
571
|
+
]), e.type === h.FEATURE)
|
|
572
|
+
return e.geometry ? x(R(e.geometry), t) : null;
|
|
573
|
+
if (e.type === h.FEATURE_COLLECTION) {
|
|
574
|
+
const n = R(e);
|
|
575
|
+
return n.length ? x(n, t) : null;
|
|
576
|
+
}
|
|
577
|
+
return x(R(e), t);
|
|
578
|
+
}
|
|
579
|
+
function tt(e) {
|
|
580
|
+
if (e.length === 0) return null;
|
|
581
|
+
if (e.length === 1) return { type: "Point", coordinates: e[0] };
|
|
582
|
+
if (e.length === 2) return { type: "LineString", coordinates: [e[0], e[1]] };
|
|
583
|
+
const t = de(ve(e.map((n) => he({ type: "Point", coordinates: n }))));
|
|
584
|
+
return t ? t.geometry : { type: "LineString", coordinates: [e[0], e[e.length - 1]] };
|
|
585
|
+
}
|
|
586
|
+
function nt(e) {
|
|
587
|
+
if (u.that(e, F, "geoJson must be a GeoJson object"), e.type === h.FEATURE)
|
|
588
|
+
return e.geometry ? nt(e.geometry) : null;
|
|
589
|
+
const t = R(e).map((n) => [n[0], n[1]]);
|
|
590
|
+
return tt(t);
|
|
591
|
+
}
|
|
592
|
+
function rt(e, t, n) {
|
|
400
593
|
return Math.abs(
|
|
401
|
-
(e[0] * (t[1] -
|
|
594
|
+
(e[0] * (t[1] - n[1]) + t[0] * (n[1] - e[1]) + n[0] * (e[1] - t[1])) / 2
|
|
402
595
|
);
|
|
403
596
|
}
|
|
404
|
-
function
|
|
597
|
+
function U(e, { tolerance: t = 0, getWeight: n = () => 1 } = {}) {
|
|
405
598
|
if (e.length <= 2) return e;
|
|
406
|
-
const
|
|
407
|
-
for (let
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
for (let
|
|
411
|
-
|
|
412
|
-
let
|
|
413
|
-
for (;
|
|
414
|
-
const
|
|
415
|
-
if (!
|
|
416
|
-
if (
|
|
417
|
-
|
|
599
|
+
const r = e.map((o, v) => ({ coord: o, i: v, area: 1 / 0, removed: !1, prev: null, next: null }));
|
|
600
|
+
for (let o = 0; o < r.length; o++)
|
|
601
|
+
o > 0 && (r[o].prev = r[o - 1]), o < r.length - 1 && (r[o].next = r[o + 1]);
|
|
602
|
+
const a = (o) => !o.prev || !o.next ? 1 / 0 : rt(o.prev.coord, o.coord, o.next.coord) * n(o.coord, o.i), s = new pe((o, v) => o.area - v.area);
|
|
603
|
+
for (let o = 1; o < r.length - 1; o++)
|
|
604
|
+
r[o].area = a(r[o]), r[o]._currentArea = r[o].area, s.push(r[o]);
|
|
605
|
+
let l = 0;
|
|
606
|
+
for (; s.size() > 0; ) {
|
|
607
|
+
const o = s.pop();
|
|
608
|
+
if (!o.removed && o.area === o._currentArea) {
|
|
609
|
+
if (o.area < l ? o.area = l : l = o.area, o.area >= t) break;
|
|
610
|
+
o.removed = !0, o.prev && (o.prev.next = o.next), o.next && (o.next.prev = o.prev), o.prev?.prev && (o.prev.area = a(o.prev), o.prev._currentArea = o.prev.area, s.push(o.prev)), o.next?.next && (o.next.area = a(o.next), o.next._currentArea = o.next.area, s.push(o.next));
|
|
418
611
|
}
|
|
419
612
|
}
|
|
420
|
-
const
|
|
421
|
-
let c =
|
|
613
|
+
const m = [];
|
|
614
|
+
let c = r[0];
|
|
422
615
|
for (; c; )
|
|
423
|
-
c.removed ||
|
|
424
|
-
return
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
616
|
+
c.removed || m.push(c.coord), c = c.next;
|
|
617
|
+
return m;
|
|
618
|
+
}
|
|
619
|
+
const it = {
|
|
620
|
+
tolerance: p(i.number),
|
|
621
|
+
getWeight: p(i.function)
|
|
622
|
+
};
|
|
623
|
+
function G(e, t = {}) {
|
|
624
|
+
if (u.all([
|
|
625
|
+
{ value: e, validator: F, message: "geoJson must be a GeoJson object" },
|
|
626
|
+
{ value: t, validator: (n) => E.schema(n, it), message: "options must be a valid options object" }
|
|
627
|
+
]), e.type === h.FEATURE)
|
|
628
|
+
return e.geometry && G(e.geometry, t), e;
|
|
629
|
+
if (e.type === h.FEATURE_COLLECTION) {
|
|
630
|
+
for (const n of e.features) G(n, t);
|
|
631
|
+
return e;
|
|
632
|
+
}
|
|
633
|
+
switch (e.type) {
|
|
634
|
+
case g.LINESTRING:
|
|
635
|
+
e.coordinates = U(e.coordinates, t);
|
|
432
636
|
break;
|
|
433
|
-
case
|
|
434
|
-
case
|
|
435
|
-
e.coordinates = e.coordinates.map((
|
|
637
|
+
case g.POLYGON:
|
|
638
|
+
case g.MULTI_LINESTRING:
|
|
639
|
+
e.coordinates = e.coordinates.map((n) => U(n, t));
|
|
436
640
|
break;
|
|
437
|
-
case
|
|
438
|
-
e.coordinates = e.coordinates.map((
|
|
641
|
+
case g.MULTI_POLYGON:
|
|
642
|
+
e.coordinates = e.coordinates.map((n) => n.map((r) => U(r, t)));
|
|
439
643
|
break;
|
|
440
|
-
case
|
|
441
|
-
e.geometries.forEach((
|
|
644
|
+
case g.GEOMETRY_COLLECTION:
|
|
645
|
+
e.geometries.forEach((n) => G(n, t));
|
|
442
646
|
break;
|
|
443
647
|
}
|
|
444
648
|
return e;
|
|
445
649
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
e.geometry && U(e.geometry, t);
|
|
450
|
-
else if (e.type === v.FEATURE_COLLECTION)
|
|
451
|
-
for (const r of e.features) Z(r, t);
|
|
452
|
-
else
|
|
453
|
-
Fe.warn('Unknown feature type "{type}", skipping.', { type: e.type });
|
|
454
|
-
return e;
|
|
455
|
-
}
|
|
456
|
-
function dt(e, t) {
|
|
457
|
-
return l.all([
|
|
458
|
-
{ value: e, validator: Q, message: "geoJson must be a GeoJson object" }
|
|
459
|
-
]), i.oneOf(e.type, Object.values(f)) ? U(e, t) : Z(e, t);
|
|
460
|
-
}
|
|
461
|
-
function J(e, t = 7) {
|
|
462
|
-
l.all([
|
|
463
|
-
{ value: e, validator: $e, message: "bbox must be bounding box" },
|
|
464
|
-
{ value: t, validator: (n) => i.inRange(n, 0, 8), message: "precision must be in range [0, 8]" }
|
|
465
|
-
]);
|
|
466
|
-
const r = x[t];
|
|
467
|
-
for (let n = 0; n < e.length; n++)
|
|
468
|
-
e[n] = Math.round(e[n] * r) / r;
|
|
469
|
-
return e;
|
|
470
|
-
}
|
|
471
|
-
function ee(e, t = 7) {
|
|
472
|
-
l.all([
|
|
473
|
-
{ value: e, validator: G, message: "geometry must be a GeoJson geometry" },
|
|
474
|
-
{ value: t, validator: (n) => i.inRange(n, 0, 8), message: "precision must be in range [0, 8]" }
|
|
475
|
-
]);
|
|
476
|
-
const r = ae(e, { precision: t, mutate: !0 });
|
|
477
|
-
return r.bbox && J(r.bbox, t), r;
|
|
650
|
+
function le(e, t = 7) {
|
|
651
|
+
const n = Ee(e, { precision: t, mutate: !0 });
|
|
652
|
+
return n.bbox && ue(n.bbox, t), n;
|
|
478
653
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
e.geometry && ee(e.geometry, t);
|
|
483
|
-
else if (e.type === v.FEATURE_COLLECTION)
|
|
484
|
-
for (const r of e.features) te(r, t);
|
|
654
|
+
function ce(e, t) {
|
|
655
|
+
if (e.type === h.FEATURE)
|
|
656
|
+
e.geometry && le(e.geometry, t);
|
|
485
657
|
else
|
|
486
|
-
|
|
487
|
-
return e.bbox &&
|
|
658
|
+
for (const n of e.features) ce(n, t);
|
|
659
|
+
return e.bbox && ue(e.bbox, t), e;
|
|
488
660
|
}
|
|
489
|
-
function
|
|
490
|
-
return
|
|
491
|
-
{ value: e, validator:
|
|
492
|
-
{ value: t, validator: (r) => i.inRange(r, 0, 8), message: "precision must be in range [0, 8]" }
|
|
493
|
-
]), i.oneOf(e.type, Object.values(f)) ? ee(e, t) : te(e, t);
|
|
494
|
-
}
|
|
495
|
-
function vt(e, t = 7) {
|
|
496
|
-
l.all([
|
|
497
|
-
{ value: e, validator: Ge, message: "position must be a position" },
|
|
661
|
+
function Pt(e, t = 7) {
|
|
662
|
+
return u.all([
|
|
663
|
+
{ value: e, validator: F, message: "geoJson must be a valid GeoJson" },
|
|
498
664
|
{ value: t, validator: (n) => i.inRange(n, 0, 8), message: "precision must be in range [0, 8]" }
|
|
499
|
-
]);
|
|
500
|
-
const r = x[t];
|
|
501
|
-
for (let n = 0; n < e.length; n++)
|
|
502
|
-
e[n] = Math.round(e[n] * r) / r;
|
|
503
|
-
return e;
|
|
665
|
+
]), i.oneOf(e.type, Object.values(g)) ? le(e, t) : ce(e, t);
|
|
504
666
|
}
|
|
505
|
-
function
|
|
667
|
+
function C(e) {
|
|
506
668
|
if (!i.arrayOfLengthBetween(e, 2, 3))
|
|
507
669
|
return {
|
|
508
670
|
valid: !1,
|
|
509
671
|
errors: [{ message: "Invalid coordinates: must be an array of 2 or 3 coordinates" }],
|
|
510
672
|
warnings: []
|
|
511
673
|
};
|
|
674
|
+
if (!i.number(e[0]) || !i.number(e[1]))
|
|
675
|
+
return {
|
|
676
|
+
valid: !1,
|
|
677
|
+
errors: [{ message: "Invalid coordinates: longitude and latitude must be numbers" }],
|
|
678
|
+
warnings: []
|
|
679
|
+
};
|
|
512
680
|
if (!i.inRange(e[0], -180, 180))
|
|
513
681
|
return {
|
|
514
682
|
valid: !1,
|
|
@@ -527,43 +695,52 @@ function D(e) {
|
|
|
527
695
|
errors: [{ message: "Invalid coordinates: altitude must be a number" }],
|
|
528
696
|
warnings: []
|
|
529
697
|
};
|
|
530
|
-
const t = { valid: !0, errors: [], warnings: [] },
|
|
531
|
-
|
|
532
|
-
const
|
|
533
|
-
return
|
|
698
|
+
const t = { valid: !0, errors: [], warnings: [] }, n = J(e[0]);
|
|
699
|
+
n > 6 && t.warnings.push({ message: `longitude precision is high (${n} decimals, max recommended: 6)` });
|
|
700
|
+
const r = J(e[1]);
|
|
701
|
+
return r > 6 && t.warnings.push({ message: `latitude precision is high (${r} decimals, max recommended: 6)` }), t;
|
|
534
702
|
}
|
|
535
|
-
function
|
|
703
|
+
function at(e) {
|
|
536
704
|
if (!i.arrayOfLength(e, 4) && !i.arrayOfLength(e, 6))
|
|
537
705
|
return {
|
|
538
706
|
valid: !1,
|
|
539
707
|
errors: [{ message: "Invalid bbox: must be an array of 4 (2D) or 6 (3D) numbers" }],
|
|
540
708
|
warnings: []
|
|
541
709
|
};
|
|
542
|
-
const t = e.length === 4,
|
|
543
|
-
if (!
|
|
710
|
+
const t = e.length === 4, n = t ? [e[0], e[1]] : [e[0], e[1], e[2]], r = t ? [e[2], e[3]] : [e[3], e[4], e[5]], a = C(n);
|
|
711
|
+
if (!a.valid)
|
|
544
712
|
return {
|
|
545
713
|
valid: !1,
|
|
546
|
-
errors:
|
|
714
|
+
errors: a.errors.map((f) => ({ ...f, message: `Invalid bbox south-west: ${f.message}` })),
|
|
547
715
|
warnings: []
|
|
548
716
|
};
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
717
|
+
const s = C(r);
|
|
718
|
+
if (!s.valid)
|
|
551
719
|
return {
|
|
552
720
|
valid: !1,
|
|
553
|
-
errors:
|
|
721
|
+
errors: s.errors.map((f) => ({ ...f, message: `Invalid bbox north-east: ${f.message}` })),
|
|
554
722
|
warnings: []
|
|
555
723
|
};
|
|
556
|
-
const [
|
|
557
|
-
if (
|
|
724
|
+
const [l, m] = n, [c, o] = r;
|
|
725
|
+
if (m > o)
|
|
558
726
|
return {
|
|
559
727
|
valid: !1,
|
|
560
|
-
errors: [{ message: `Invalid bbox: south (${
|
|
728
|
+
errors: [{ message: `Invalid bbox: south (${m}) must be <= north (${o})` }],
|
|
561
729
|
warnings: []
|
|
562
730
|
};
|
|
563
|
-
|
|
564
|
-
|
|
731
|
+
if (!t) {
|
|
732
|
+
const f = e[2], K = e[5];
|
|
733
|
+
if (f > K)
|
|
734
|
+
return {
|
|
735
|
+
valid: !1,
|
|
736
|
+
errors: [{ message: `Invalid bbox: min altitude (${f}) must be <= max altitude (${K})` }],
|
|
737
|
+
warnings: []
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
const v = { valid: !0, errors: [], warnings: [] };
|
|
741
|
+
return l > c && v.warnings.push({ message: `bbox crosses the antimeridian (west: ${l} > east: ${c})` }), v.warnings.push(...a.warnings.map((f) => ({ ...f, message: `south-west: ${f.message}` }))), v.warnings.push(...s.warnings.map((f) => ({ ...f, message: `north-east: ${f.message}` }))), v;
|
|
565
742
|
}
|
|
566
|
-
function
|
|
743
|
+
function st(e) {
|
|
567
744
|
if (!i.plainObject(e))
|
|
568
745
|
return {
|
|
569
746
|
valid: !1,
|
|
@@ -571,13 +748,13 @@ function He(e) {
|
|
|
571
748
|
warnings: []
|
|
572
749
|
};
|
|
573
750
|
switch (e.type) {
|
|
574
|
-
case
|
|
751
|
+
case M.NAME:
|
|
575
752
|
return i.nonEmptyString(e.properties?.name) ? { valid: !0, errors: [], warnings: [] } : {
|
|
576
753
|
valid: !1,
|
|
577
754
|
errors: [{ message: "Invalid crs: linked crs must have a non-empty properties.name string" }],
|
|
578
755
|
warnings: []
|
|
579
756
|
};
|
|
580
|
-
case
|
|
757
|
+
case M.LINK:
|
|
581
758
|
return i.nonEmptyString(e.properties?.href) ? { valid: !0, errors: [], warnings: [] } : {
|
|
582
759
|
valid: !1,
|
|
583
760
|
errors: [{ message: "Invalid crs: linked crs must have a non-empty properties.href string" }],
|
|
@@ -591,146 +768,147 @@ function He(e) {
|
|
|
591
768
|
};
|
|
592
769
|
}
|
|
593
770
|
}
|
|
594
|
-
function
|
|
771
|
+
function T() {
|
|
595
772
|
return { Feature: 0, FeatureCollection: 0, geometries: {} };
|
|
596
773
|
}
|
|
597
|
-
function
|
|
598
|
-
const t =
|
|
599
|
-
for (const
|
|
600
|
-
const
|
|
601
|
-
if (
|
|
602
|
-
t.Feature +=
|
|
603
|
-
for (const [
|
|
604
|
-
t.geometries[
|
|
774
|
+
function ot(...e) {
|
|
775
|
+
const t = T();
|
|
776
|
+
for (const n of e) {
|
|
777
|
+
const r = n.statistics;
|
|
778
|
+
if (r) {
|
|
779
|
+
t.Feature += r.Feature ?? 0, t.FeatureCollection += r.FeatureCollection ?? 0;
|
|
780
|
+
for (const [a, s] of Object.entries(r.geometries ?? {}))
|
|
781
|
+
t.geometries[a] = (t.geometries[a] ?? 0) + s;
|
|
605
782
|
}
|
|
606
783
|
}
|
|
607
784
|
return t;
|
|
608
785
|
}
|
|
609
|
-
function
|
|
610
|
-
const
|
|
786
|
+
function L(e, t, n = "") {
|
|
787
|
+
const r = {
|
|
611
788
|
valid: !0,
|
|
612
789
|
errors: [],
|
|
613
|
-
warnings: []
|
|
790
|
+
warnings: [],
|
|
791
|
+
statistics: T()
|
|
614
792
|
};
|
|
615
|
-
for (let
|
|
616
|
-
const
|
|
617
|
-
if (!
|
|
618
|
-
|
|
793
|
+
for (let a = 0; a < e.length; a++) {
|
|
794
|
+
const s = `${n}/${a}`, l = t(e[a], s, a);
|
|
795
|
+
if (l.statistics && (r.statistics = ot(r, l)), !l.valid) {
|
|
796
|
+
r.valid = !1, r.errors = r.errors.concat(l.errors.map((m) => ({ ...m, path: m.path || s, index: a })));
|
|
619
797
|
continue;
|
|
620
798
|
}
|
|
621
|
-
i.empty(
|
|
799
|
+
i.empty(l.warnings) || (r.warnings = r.warnings.concat(l.warnings.map((m) => ({ ...m, path: m.path || s, index: a }))));
|
|
622
800
|
}
|
|
623
|
-
return
|
|
801
|
+
return r;
|
|
624
802
|
}
|
|
625
|
-
function
|
|
803
|
+
function te(e, t) {
|
|
626
804
|
if (!i.defined(e.crs)) return t;
|
|
627
|
-
const
|
|
628
|
-
return
|
|
805
|
+
const n = st(e.crs);
|
|
806
|
+
return n.valid || (t.valid = !1, t.errors.push(...n.errors.map((r) => ({ ...r, path: "/crs" })))), t.warnings.push(...n.warnings.map((r) => ({ ...r, path: "/crs" }))), t;
|
|
629
807
|
}
|
|
630
|
-
function
|
|
808
|
+
function N(e, t, n = "") {
|
|
631
809
|
if (!i.defined(e.bbox)) return t;
|
|
632
|
-
const
|
|
633
|
-
return
|
|
810
|
+
const r = at(e.bbox);
|
|
811
|
+
return r.valid || (t.valid = !1, t.errors.push(...r.errors.map((a) => ({ ...a, path: `${n}/bbox` })))), t.warnings.push(...r.warnings.map((a) => ({ ...a, path: `${n}/bbox` }))), t;
|
|
634
812
|
}
|
|
635
|
-
function
|
|
636
|
-
return i.arrayOfLengthAtLeast(e, t) ?
|
|
813
|
+
function W(e, t = 0, n = "") {
|
|
814
|
+
return i.arrayOfLengthAtLeast(e, t) ? L(e, C, n) : {
|
|
637
815
|
valid: !1,
|
|
638
|
-
errors: [{ message: `Invalid coordinates: must have at least ${t} positions`, path:
|
|
816
|
+
errors: [{ message: `Invalid coordinates: must have at least ${t} positions`, path: n }],
|
|
639
817
|
warnings: []
|
|
640
818
|
};
|
|
641
819
|
}
|
|
642
|
-
function
|
|
643
|
-
const
|
|
644
|
-
if (!
|
|
645
|
-
for (let
|
|
646
|
-
const
|
|
647
|
-
Math.abs(
|
|
648
|
-
message: `LineString crosses the antimeridian between positions ${
|
|
649
|
-
path: `${t}/${
|
|
820
|
+
function me(e, t = "") {
|
|
821
|
+
const n = W(e, 2, t);
|
|
822
|
+
if (!n.valid) return n;
|
|
823
|
+
for (let r = 0; r < e.length - 1; r++) {
|
|
824
|
+
const a = e[r][0], s = e[r + 1][0];
|
|
825
|
+
Math.abs(s - a) > 180 && n.warnings.push({
|
|
826
|
+
message: `LineString crosses the antimeridian between positions ${r} and ${r + 1}, consider using MultiLineString`,
|
|
827
|
+
path: `${t}/${r}`
|
|
650
828
|
});
|
|
651
829
|
}
|
|
652
|
-
return
|
|
830
|
+
return n;
|
|
653
831
|
}
|
|
654
|
-
function
|
|
655
|
-
return i.nonEmptyArray(e) ?
|
|
832
|
+
function ut(e, t = "") {
|
|
833
|
+
return i.nonEmptyArray(e) ? L(e, me, t) : {
|
|
656
834
|
valid: !1,
|
|
657
835
|
errors: [{ message: "Invalid MultiLineString: coordinates must be a non empty array", path: t }],
|
|
658
836
|
warnings: []
|
|
659
837
|
};
|
|
660
838
|
}
|
|
661
|
-
function
|
|
662
|
-
const
|
|
663
|
-
if (!
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
666
|
-
return
|
|
667
|
-
const
|
|
668
|
-
|
|
669
|
-
const c =
|
|
670
|
-
return c.features.length > 0 && (
|
|
671
|
-
}
|
|
672
|
-
function
|
|
673
|
-
return i.nonEmptyArray(e) ?
|
|
839
|
+
function lt(e, t, n = "") {
|
|
840
|
+
const r = W(e, 4, n);
|
|
841
|
+
if (!r.valid) return r;
|
|
842
|
+
const a = e[0], s = e[e.length - 1];
|
|
843
|
+
if (a[0] !== s[0] || a[1] !== s[1])
|
|
844
|
+
return r.valid = !1, r.errors.push({ message: "Invalid LinearRing: first and last position must be identical", path: n }), r;
|
|
845
|
+
const m = ye(e) ? "clockwise" : "counter-clockwise";
|
|
846
|
+
m !== t && r.warnings.push({ message: `Ring must be ${t} but is ${m}`, path: n });
|
|
847
|
+
const c = Oe({ type: "Polygon", coordinates: [e] });
|
|
848
|
+
return c.features.length > 0 && (r.valid = !1, r.errors.push({ message: `Invalid LinearRing: ${c.features.length} self-intersection(s) detected`, path: n })), r;
|
|
849
|
+
}
|
|
850
|
+
function fe(e, t = "") {
|
|
851
|
+
return i.nonEmptyArray(e) ? L(e, (n, r, a) => lt(n, a === 0 ? "counter-clockwise" : "clockwise", r), t) : {
|
|
674
852
|
valid: !1,
|
|
675
853
|
errors: [{ message: "Invalid Polygon: coordinates must be a non empty array", path: t }],
|
|
676
854
|
warnings: []
|
|
677
855
|
};
|
|
678
856
|
}
|
|
679
|
-
function
|
|
680
|
-
return i.nonEmptyArray(e) ?
|
|
857
|
+
function ct(e, t = "") {
|
|
858
|
+
return i.nonEmptyArray(e) ? L(e, (n, r) => fe(n, r), t) : {
|
|
681
859
|
valid: !1,
|
|
682
860
|
errors: [{ message: "Invalid MultiPolygon: coordinates must be a non empty array", path: t }],
|
|
683
861
|
warnings: []
|
|
684
862
|
};
|
|
685
863
|
}
|
|
686
|
-
function
|
|
687
|
-
return i.nonEmptyArray(e) ?
|
|
864
|
+
function mt(e, t = "") {
|
|
865
|
+
return i.nonEmptyArray(e) ? L(e, (n, r) => X(n, r), t) : {
|
|
688
866
|
valid: !1,
|
|
689
867
|
errors: [{ message: "Invalid geometries: geometries must be a non empty array", path: t }],
|
|
690
868
|
warnings: []
|
|
691
869
|
};
|
|
692
870
|
}
|
|
693
|
-
function
|
|
871
|
+
function X(e, t = "") {
|
|
694
872
|
if (!i.nonEmptyObject(e))
|
|
695
873
|
return {
|
|
696
874
|
valid: !1,
|
|
697
875
|
errors: [{ message: "Invalid geometry: geometry must be a non empty object", path: t }],
|
|
698
876
|
warnings: []
|
|
699
877
|
};
|
|
700
|
-
const
|
|
701
|
-
let
|
|
878
|
+
const n = `${t}/coordinates`;
|
|
879
|
+
let r;
|
|
702
880
|
switch (e.type) {
|
|
703
|
-
case
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
valid:
|
|
707
|
-
errors:
|
|
708
|
-
warnings:
|
|
881
|
+
case g.POINT: {
|
|
882
|
+
const a = C(e.coordinates);
|
|
883
|
+
r = {
|
|
884
|
+
valid: a.valid,
|
|
885
|
+
errors: a.errors.map((s) => ({ ...s, path: n })),
|
|
886
|
+
warnings: a.warnings.map((s) => ({ ...s, path: n }))
|
|
709
887
|
};
|
|
710
888
|
break;
|
|
711
889
|
}
|
|
712
|
-
case
|
|
713
|
-
|
|
890
|
+
case g.MULTI_POINT: {
|
|
891
|
+
r = W(e.coordinates, 0, n);
|
|
714
892
|
break;
|
|
715
893
|
}
|
|
716
|
-
case
|
|
717
|
-
|
|
894
|
+
case g.LINESTRING: {
|
|
895
|
+
r = me(e.coordinates, n);
|
|
718
896
|
break;
|
|
719
897
|
}
|
|
720
|
-
case
|
|
721
|
-
|
|
898
|
+
case g.MULTI_LINESTRING: {
|
|
899
|
+
r = ut(e.coordinates, n);
|
|
722
900
|
break;
|
|
723
901
|
}
|
|
724
|
-
case
|
|
725
|
-
|
|
902
|
+
case g.POLYGON: {
|
|
903
|
+
r = fe(e.coordinates, n);
|
|
726
904
|
break;
|
|
727
905
|
}
|
|
728
|
-
case
|
|
729
|
-
|
|
906
|
+
case g.MULTI_POLYGON: {
|
|
907
|
+
r = ct(e.coordinates, n);
|
|
730
908
|
break;
|
|
731
909
|
}
|
|
732
|
-
case
|
|
733
|
-
|
|
910
|
+
case g.GEOMETRY_COLLECTION: {
|
|
911
|
+
r = mt(e.geometries, `${t}/geometries`);
|
|
734
912
|
break;
|
|
735
913
|
}
|
|
736
914
|
default:
|
|
@@ -740,25 +918,26 @@ function k(e, t = "") {
|
|
|
740
918
|
warnings: []
|
|
741
919
|
};
|
|
742
920
|
}
|
|
743
|
-
return
|
|
921
|
+
return r = N(e, r, t), r.statistics = { geometries: { [e.type]: 1 } }, r;
|
|
744
922
|
}
|
|
745
|
-
function
|
|
923
|
+
function ge(e, t = "") {
|
|
746
924
|
if (!i.nonEmptyObject(e))
|
|
747
925
|
return {
|
|
748
926
|
valid: !1,
|
|
749
927
|
errors: [{ message: "Invalid feature: must be a non empty object", path: t }],
|
|
750
928
|
warnings: [],
|
|
751
|
-
statistics:
|
|
929
|
+
statistics: T()
|
|
752
930
|
};
|
|
753
|
-
if (e.type ===
|
|
931
|
+
if (e.type === h.FEATURE) {
|
|
754
932
|
if (i.nonEmptyObject(e.geometry)) {
|
|
755
|
-
const
|
|
933
|
+
const n = X(e.geometry, `${t}/geometry`);
|
|
756
934
|
return {
|
|
757
|
-
...
|
|
935
|
+
...N(e, n, t),
|
|
758
936
|
statistics: {
|
|
759
937
|
Feature: 1,
|
|
760
938
|
FeatureCollection: 0,
|
|
761
|
-
|
|
939
|
+
// Geometry counting is owned by validateGeometry.
|
|
940
|
+
geometries: { ...n.statistics.geometries }
|
|
762
941
|
}
|
|
763
942
|
};
|
|
764
943
|
}
|
|
@@ -769,96 +948,112 @@ function ie(e, t = "") {
|
|
|
769
948
|
statistics: { Feature: 1, FeatureCollection: 0, geometries: {} }
|
|
770
949
|
};
|
|
771
950
|
}
|
|
772
|
-
if (e.type ===
|
|
951
|
+
if (e.type === h.FEATURE_COLLECTION) {
|
|
773
952
|
if (i.nonEmptyArray(e.features)) {
|
|
774
|
-
const
|
|
953
|
+
const n = L(e.features, ge, `${t}/features`);
|
|
775
954
|
return {
|
|
776
|
-
...
|
|
777
|
-
statistics: { ...
|
|
955
|
+
...N(e, n, t),
|
|
956
|
+
statistics: { ...n.statistics, FeatureCollection: n.statistics.FeatureCollection + 1 }
|
|
778
957
|
};
|
|
779
958
|
}
|
|
780
959
|
return {
|
|
781
960
|
valid: !1,
|
|
782
961
|
errors: [{ message: "Invalid FeatureCollection: features must be a non empty array", path: t }],
|
|
783
962
|
warnings: [],
|
|
784
|
-
statistics:
|
|
963
|
+
statistics: T()
|
|
785
964
|
};
|
|
786
965
|
}
|
|
787
966
|
return {
|
|
788
967
|
valid: !1,
|
|
789
968
|
errors: [{ message: `Invalid feature: unknown type: ${e.type}`, path: t }],
|
|
790
969
|
warnings: [],
|
|
791
|
-
statistics:
|
|
970
|
+
statistics: T()
|
|
792
971
|
};
|
|
793
972
|
}
|
|
794
|
-
function
|
|
795
|
-
if (
|
|
973
|
+
function Bt(e) {
|
|
974
|
+
if (u.that(e, i.nonEmptyObject, "geojson must be a non empty object"), i.oneOf(e.type, Object.values(g))) {
|
|
975
|
+
const t = X(e, ""), n = N(e, t, "");
|
|
796
976
|
return {
|
|
797
|
-
...
|
|
798
|
-
|
|
977
|
+
...te(e, n),
|
|
978
|
+
// Geometry counting is owned by validateGeometry.
|
|
979
|
+
statistics: { Feature: 0, FeatureCollection: 0, geometries: { ...t.statistics.geometries } }
|
|
799
980
|
};
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
981
|
+
}
|
|
982
|
+
if (e.type === h.FEATURE || e.type === h.FEATURE_COLLECTION) {
|
|
983
|
+
const t = ge(e, "");
|
|
984
|
+
return te(e, t);
|
|
803
985
|
}
|
|
804
986
|
return {
|
|
805
987
|
valid: !1,
|
|
806
|
-
errors: [{ message: "Invalid GeoJson: type must be either a Geometry, a Feature or a FeatureCollection" }],
|
|
988
|
+
errors: [{ message: "Invalid GeoJson: type must be either a Geometry, a Feature or a FeatureCollection", path: "" }],
|
|
807
989
|
warnings: [],
|
|
808
|
-
statistics:
|
|
990
|
+
statistics: T()
|
|
809
991
|
};
|
|
810
992
|
}
|
|
811
993
|
export {
|
|
812
994
|
d as AXES,
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
995
|
+
P as COORDINATE_FORMATS,
|
|
996
|
+
Ye as COORDINATE_MODELS,
|
|
997
|
+
Y as COORDINATE_TRUNCATION_FACTORS,
|
|
998
|
+
M as CRS_TYPES,
|
|
999
|
+
h as FEATURE_TYPES,
|
|
1000
|
+
g as GEOMETRY_TYPES,
|
|
1001
|
+
x as computeBBox,
|
|
1002
|
+
kt as computeGeoJsonBoundingBox,
|
|
1003
|
+
nt as computeGeoJsonConvexHull,
|
|
1004
|
+
Nt as convertCoordinate,
|
|
1005
|
+
re as getActiveLocales,
|
|
1006
|
+
j as getAllDirectionSymbols,
|
|
1007
|
+
J as getCoordinatePrecision,
|
|
1008
|
+
Ne as getDirectionAxis,
|
|
1009
|
+
St as getDirections,
|
|
1010
|
+
Rt as getEast,
|
|
1011
|
+
Ae as getLatitudeSymbols,
|
|
1012
|
+
Re as getLocale,
|
|
1013
|
+
B as getLocaleByCode,
|
|
1014
|
+
Me as getLongitudeSymbols,
|
|
1015
|
+
bt as getNorth,
|
|
1016
|
+
Dt as getSouth,
|
|
1017
|
+
At as getWest,
|
|
1018
|
+
Z as guessCoordinateAxis,
|
|
1019
|
+
ee as is3DBBox,
|
|
1020
|
+
Xe as is3DPosition,
|
|
1021
|
+
Ot as isAltitude,
|
|
1022
|
+
Te as isAxis,
|
|
1023
|
+
O as isDirection,
|
|
1024
|
+
V as isEast,
|
|
1025
|
+
k as isLatitude,
|
|
1026
|
+
Gt as isLikeBBox,
|
|
1027
|
+
xt as isLikeCRS,
|
|
1028
|
+
Qe as isLikeFeature,
|
|
1029
|
+
Ze as isLikeFeatureCollection,
|
|
1030
|
+
Je as isLikeFeatureOrFeatureCollection,
|
|
1031
|
+
F as isLikeGeoJson,
|
|
1032
|
+
qe as isLikeGeometry,
|
|
1033
|
+
Ut as isLikePosition,
|
|
1034
|
+
ne as isLongitude,
|
|
1035
|
+
Ce as isNorth,
|
|
1036
|
+
_t as isSamePosition,
|
|
1037
|
+
ie as isSouth,
|
|
1038
|
+
A as isValidBBox,
|
|
1039
|
+
y as isValidPosition,
|
|
1040
|
+
$ as isWest,
|
|
1041
|
+
Tt as listLocales,
|
|
1042
|
+
Ft as mergeBBox,
|
|
1043
|
+
Ct as normalizeCoordinate,
|
|
1044
|
+
We as parseCoordinate,
|
|
1045
|
+
wt as parsePosition,
|
|
1046
|
+
It as registerLocale,
|
|
1047
|
+
Lt as setLocale,
|
|
1048
|
+
G as simplifyGeoJson,
|
|
1049
|
+
ue as truncateBBox,
|
|
1050
|
+
Mt as truncateCoordinate,
|
|
1051
|
+
Pt as truncateGeoJson,
|
|
1052
|
+
$t as truncatePosition,
|
|
1053
|
+
at as validateBBox,
|
|
1054
|
+
st as validateCRS,
|
|
1055
|
+
Bt as validateGeoJson,
|
|
1056
|
+
X as validateGeometry,
|
|
1057
|
+
C as validatePosition
|
|
863
1058
|
};
|
|
864
1059
|
//# sourceMappingURL=index.mjs.map
|