@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.mjs CHANGED
@@ -1,124 +1,156 @@
1
- import { assert as l, is as i, has as M, conform as T, optional as $ } from "@kalisio/common-core";
2
- import { getLogger as j } from "@logtape/logtape";
3
- import { Heap as se } from "heap-js";
4
- import ae from "@turf/truncate";
5
- import oe from "@turf/boolean-clockwise";
6
- import le from "@turf/kinks";
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 ue(e) {
13
- return l.that(e, i.string, "axis must be a string"), Object.values(d).includes(e);
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 N(e) {
16
- return l.that(e, i.string, "axis must be a string"), e === d.LATITUDE;
17
+ function k(e) {
18
+ return u.that(e, i.string, "axis must be a string"), e === d.LATITUDE;
17
19
  }
18
- function Y(e) {
19
- return l.that(e, i.string, "axis must be a string"), e === d.LONGITUDE;
20
+ function ne(e) {
21
+ return u.that(e, i.string, "axis must be a string"), e === d.LONGITUDE;
20
22
  }
21
- function et(e) {
22
- return l.that(e, i.string, "axis must be a string"), e === d.ALTITUDE;
23
+ function Ot(e) {
24
+ return u.that(e, i.string, "axis must be a string"), e === d.ALTITUDE;
23
25
  }
24
- const ce = { NORTH: { label: "Nord", symbol: "N" }, SOUTH: { label: "Sud", symbol: "S" }, EAST: { label: "Est", symbol: "E" }, WEST: { label: "Ouest", symbol: "O" } }, ge = {
25
- DIRECTIONS: ce
26
- }, fe = { NORTH: { label: "North", symbol: "N" }, SOUTH: { label: "South", symbol: "S" }, EAST: { label: "East", symbol: "E" }, WEST: { label: "West", symbol: "W" } }, me = {
27
- DIRECTIONS: fe
28
- }, de = {
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.string },
31
- SOUTH: { label: i.string, symbol: i.string },
32
- EAST: { label: i.string, symbol: i.string },
33
- WEST: { label: i.string, symbol: i.string }
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
- }, O = {
36
- en: me,
37
- fr: ge
37
+ }, I = {
38
+ en: be,
39
+ fr: Le
38
40
  };
39
- let A = "en";
40
- function tt() {
41
- return Object.keys(O);
41
+ let S = "en";
42
+ const z = "en";
43
+ function Tt() {
44
+ return Object.keys(I);
42
45
  }
43
- function nt(e, t) {
44
- l.all([
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: (r) => !M.key(O, r), message: "locale already registered" },
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: (r) => T.schema(r, de), message: "content does not conform to schema" }
49
- ]), O[e] = t;
51
+ { value: t, validator: (n) => E.schema(n, De), message: "content does not conform to schema" }
52
+ ]), I[e] = t;
50
53
  }
51
- function rt(e) {
52
- l.all([
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) => M.key(O, t), message: "code is unknown" }
55
- ]), A = e;
57
+ { value: e, validator: (t) => w.key(I, t), message: "code is unknown" }
58
+ ]), S = e;
56
59
  }
57
- function pe() {
58
- return {
59
- code: A,
60
- content: O[A]
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 pe().content.DIRECTIONS;
90
+ return B(Re()).DIRECTIONS;
65
91
  }
66
- function R(e, t) {
67
- const r = b(), n = r[e].label.toUpperCase(), s = r[e].symbol.toUpperCase();
68
- return t.toUpperCase() === n || t.toUpperCase() === s;
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 it(e = null) {
99
+ function St(e = null) {
71
100
  const t = b();
72
- return i.defined(e) ? (l.that(e, ue, "axis must be a valid axis"), N(e) ? [t.SOUTH, t.NORTH] : Y(e) ? [t.EAST, t.WEST] : []) : [t.SOUTH, t.NORTH, t.EAST, t.WEST];
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 st() {
103
+ function bt() {
75
104
  return b().NORTH;
76
105
  }
77
- function at() {
106
+ function Dt() {
78
107
  return b().SOUTH;
79
108
  }
80
- function ot() {
109
+ function Rt() {
81
110
  return b().EAST;
82
111
  }
83
- function lt() {
112
+ function At() {
84
113
  return b().WEST;
85
114
  }
86
- function E(e) {
87
- return l.that(e, i.string, "dir must be a string"), ve(e) || B(e) || X(e) || _(e);
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 ve(e) {
90
- return l.that(e, i.string, "dir must be a string"), R("NORTH", e);
118
+ function Ce(e) {
119
+ return u.that(e, i.string, "dir must be a string"), _("NORTH", e);
91
120
  }
92
- function B(e) {
93
- return l.that(e, i.string, "dir must be a string"), R("SOUTH", e);
121
+ function ie(e) {
122
+ return u.that(e, i.string, "dir must be a string"), _("SOUTH", e);
94
123
  }
95
- function X(e) {
96
- return l.that(e, i.string, "dir must be a string"), R("EAST", e);
124
+ function V(e) {
125
+ return u.that(e, i.string, "dir must be a string"), _("EAST", e);
97
126
  }
98
- function _(e) {
99
- return l.that(e, i.string, "dir must be a string"), R("WEST", e);
127
+ function $(e) {
128
+ return u.that(e, i.string, "dir must be a string"), _("WEST", e);
100
129
  }
101
- function Ee(e) {
102
- return l.that(e, E, "dir must be a direction"), _(e) || X(e) ? d.LONGITUDE : d.LATITUDE;
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 be = {
133
+ const we = {
105
134
  degrees: i.number,
106
- direction: $(E)
107
- }, he = /^(-?\d{1,3}(?:\.\d+)?)°?$/, ye = /^(\d{1,3}(?:\.\d+)?)°?([NSEW])$/;
108
- function I(e) {
109
- let t = null, r = null;
110
- if (i.plainObject(e) && T.schema(e, be))
111
- i.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, r = e.direction) : t = e.degrees;
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 n = e.replace(/\s+/g, ""), s = n.match(he) ?? n.match(ye);
114
- s && (t = parseFloat(s[1]), r = s[2] ?? null);
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 r;
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(n) {
130
- if (l.that(n, i.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
131
- let s = `${t.toFixed(n)}°`;
132
- return r && (s += ` ${r}`), s;
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() ? I({ degrees: t, direction: r }) : null;
167
+ return this.isValid() ? D({ degrees: t, direction: n }) : null;
136
168
  }
137
169
  };
138
170
  }
139
- const Oe = {
171
+ const Fe = {
140
172
  degrees: i.integer,
141
173
  minutes: (e) => i.inRangeExclusiveMax(e, 0, 60),
142
- direction: $(E)
143
- }, Te = /^(-?\d{1,3})°(\d{1,2}(?:\.\d+)?)'?$/, Ie = /^(\d{1,3})°(\d{1,2}(?:\.\d+)?)'?([NSEW])$/;
144
- function K(e) {
145
- let t = null, r = null, n = null;
146
- if (i.plainObject(e) && T.schema(e, Oe))
147
- i.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, r = e.minutes, n = e.direction) : (t = e.degrees, r = e.minutes);
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 s = e.replace(/\s+/g, ""), o = s.match(Te) ?? s.match(Ie);
150
- o && (t = parseFloat(o[1]), r = parseFloat(o[2]), n = o[3] ?? null);
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 r;
192
+ return n;
158
193
  },
159
194
  get direction() {
160
- return n;
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(r, 0, 60);
201
+ return i.integer(t) && i.inRangeExclusiveMax(n, 0, 60);
167
202
  },
168
- toString(s) {
169
- if (l.that(s, i.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
170
- let o = `${t}° ${r.toFixed(s)}'`;
171
- return n && (o += ` ${n}`), o;
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() ? I({ degrees: t + r / 60, direction: n }) : null;
209
+ return this.isValid() ? D({ degrees: t + n / 60, direction: r }) : null;
175
210
  }
176
211
  };
177
212
  }
178
- const Le = {
213
+ const Ge = {
179
214
  degrees: i.nonNegativeInteger,
180
215
  minutes: (e) => i.inRangeExclusiveMax(e, 0, 60),
181
- direction: E
182
- }, De = /^(\d{2})(\d{3})([NS])$/, Re = /^(\d{3})(\d{3})([EW])$/;
183
- function z(e) {
184
- let t = null, r = null, n = null;
185
- if (i.plainObject(e) && T.schema(e, Le))
186
- t = e.degrees, r = e.minutes, n = e.direction;
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 s = e.trim(), o = s.match(De) ?? s.match(Re);
189
- o && (t = parseFloat(o[1]), r = parseFloat(o[2]) / 10, n = o[3]);
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 r;
237
+ return n;
197
238
  },
198
239
  get direction() {
199
- return n;
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(r, 0, 60) && E(n);
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 s = n === "E" || n === "W", o = String(t).padStart(s ? 3 : 2, "0"), u = Math.floor(r * 10).toString().padStart(3, "0");
210
- return `${o}${u}${n}`;
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() ? I({ degrees: t + r / 60, direction: n }) : null;
254
+ return this.isValid() ? D({ degrees: t + n / 60, direction: r }) : null;
214
255
  }
215
256
  };
216
257
  }
217
- const Se = {
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: $(E)
222
- }, Ne = /^(-?\d{1,3})°(\d{1,2})'(\d{1,2}(?:\.\d+)?)"?$/, Ae = /^(\d{1,3})°(\d{1,2})'(\d{1,2}(?:\.\d+)?)"?([NSEW])$/;
223
- function q(e) {
224
- let t = null, r = null, n = null, s = null;
225
- if (i.plainObject(e) && T.schema(e, Se))
226
- i.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, r = e.minutes, n = e.seconds, s = e.direction) : (t = e.degrees, r = e.minutes, n = e.seconds);
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 o = e.replace(/\s+/g, ""), u = o.match(Ne) ?? o.match(Ae);
229
- u && (t = parseFloat(u[1]), r = parseFloat(u[2]), n = parseFloat(u[3]), s = u[4] ?? null);
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 r;
280
+ return n;
237
281
  },
238
282
  get seconds() {
239
- return n;
283
+ return r;
240
284
  },
241
285
  get direction() {
242
- return s;
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(r) && i.inRange(r, 0, 59) && i.inRangeExclusiveMax(n, 0, 60);
292
+ return i.integer(t) && i.integer(n) && i.inRange(n, 0, 59) && i.inRangeExclusiveMax(r, 0, 60);
249
293
  },
250
- toString(o) {
251
- if (l.that(o, i.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
252
- let u = `${t}° ${r}' ${n.toFixed(o)}"`;
253
- return s && (u += ` ${s}`), u;
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() ? I({ degrees: t + r / 60 + n / 3600, direction: s }) : null;
300
+ return this.isValid() ? D({ degrees: t + n / 60 + r / 3600, direction: a }) : null;
257
301
  }
258
302
  };
259
303
  }
260
- function P(e) {
261
- const t = Math.floor(e.degrees), r = (e.degrees - t) * 60;
262
- return { degrees: t, minutes: r, direction: e.direction };
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 Ce(e) {
265
- const t = Math.floor(e.degrees), r = (e.degrees - t) * 60, n = Math.floor(r), s = (r - n) * 60;
266
- return { degrees: t, minutes: n, seconds: s, direction: e.direction };
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 H = {
269
- DD: (e) => (l.that(e, (t) => t.isValid(), "dd must be a valid coordinate"), 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
- l.that(e, (s) => s.isValid(), "dd must be a valid coordinate");
272
- const { degrees: t, minutes: r, direction: n } = P(e);
273
- return K(n ? { degrees: t, minutes: r, direction: n } : { degrees: t, minutes: r });
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
- l.that(e, (o) => o.isValid(), "dd must be a valid coordinate");
277
- const { degrees: t, minutes: r, seconds: n, direction: s } = Ce(e);
278
- return q(s ? { degrees: t, minutes: r, seconds: n, direction: s } : { degrees: t, minutes: r, seconds: n });
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
- l.that(e, (s) => s.isValid(), "dd must be a valid coordinate");
282
- const { degrees: t, minutes: r, direction: n } = P(e);
283
- return z({ degrees: t, minutes: r, direction: n });
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
- }, C = {
329
+ }, P = {
286
330
  DD: "DD",
287
331
  DDM: "DDM",
288
332
  DDM_AERO: "DDM_AERO",
289
333
  DMS: "DMS"
290
- }, we = {
291
- DD: I,
292
- DDM: K,
293
- DDM_AERO: z,
294
- DMS: q
295
- }, x = Array.from({ length: 9 }, (e, t) => 10 ** t);
296
- function V(e, t) {
297
- if (l.that(e, i.number, "coord must be a number"), i.defined(t))
298
- return l.that(t, E, "dir must be a direction"), Ee(t);
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 W(e) {
302
- l.that(e, i.number, "coord must be a number");
303
- const t = e.toExponential(), [r, n] = t.split("e").map(Number), s = (r.toString().split(".")[1] || "").length;
304
- return Math.max(0, s - n);
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 ut(e, t = 7) {
307
- l.all([
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: (n) => i.inRange(n, 0, 8), message: "precision must be in range [0, 8]" }
353
+ { value: t, validator: (r) => i.inRange(r, 0, 8), message: "precision must be in range [0, 8]" }
310
354
  ]);
311
- const r = x[t];
312
- return Math.round(e * r) / r;
355
+ const n = Y[t];
356
+ return Math.round(e * n) / n;
313
357
  }
314
- function ct(e, t) {
315
- if (l.all([
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: (n) => Y(n) || N(n), message: "axis must be either a longitude or latitude" }
318
- ]), N(t))
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 r = ((e + 180) % 360 + 360) % 360 - 180;
321
- return r === -180 && (r = 180), Object.is(r, -0) && (r = 0), r;
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 gt(e, t) {
324
- l.all([
325
- { value: e, validator: (n) => i.defined(n) && n.isValid(), message: "from must be a valid coordinate" },
326
- { value: t, validator: (n) => M.key(H, n), message: `unknown format: ${t}` }
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 r = e.format === C.DD ? e : e.toDecimal();
329
- return r.isValid() ? t === C.DD ? r : H[t](r) : null;
330
- }
331
- function Me(e) {
332
- l.that(e, i.nonEmptyString, "pattern must be a non empty string");
333
- for (const t of Object.keys(C)) {
334
- const r = we[t](e);
335
- if (r.isValid()) return r;
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 ft(e) {
340
- l.that(e, (a) => i.nonEmptyString(a), "pattern must be a non-empty string");
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 [r, n] = t.map(Me);
344
- if (!r || !n) return null;
345
- const s = r.toDecimal(), o = n.toDecimal(), u = V(s.degrees, s.direction), g = V(o.degrees, o.direction), c = (a) => {
346
- const { degrees: p, direction: m } = a;
347
- return m && (_(m) || B(m)) ? -p : p;
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 (u === d.LONGITUDE && g === d.LATITUDE) return [c(s), c(o)];
350
- if (g === d.LONGITUDE && u === d.LATITUDE) return [c(o), c(s)];
351
- if (u === d.LONGITUDE && !g) return [c(s), o];
352
- if (u === d.LATITUDE && !g) return [c(o), c(s)];
353
- if (g === d.LONGITUDE && !u) return [c(o), c(s)];
354
- if (g === d.LATITUDE && !u) return [c(s), c(o)];
355
- if (!u && !g)
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(s), c(o)],
358
- [c(o), c(s)]
401
+ [c(a), c(s)],
402
+ [c(s), c(a)]
359
403
  ];
360
404
  }
361
- function $e(e) {
362
- return !i.arrayOfLength(e, 4) && !i.arrayOfLength(e, 6) ? !1 : e.every(i.number);
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
- const L = {
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 mt(e) {
369
- return i.plainObject(e) ? e.type === L.NAME ? i.nonEmptyString(e.properties?.name) : e.type === L.LINK ? i.nonEmptyString(e.properties?.href) : !1 : !1;
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
- const f = {
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 G(e) {
381
- return !i.plainObject(e) || !i.oneOf(e.type, Object.values(f)) ? !1 : e.type === f.GEOMETRY_COLLECTION ? i.array(e.geometries) : i.array(e.coordinates);
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 v = {
548
+ const h = {
384
549
  FEATURE: "Feature",
385
550
  FEATURE_COLLECTION: "FeatureCollection"
386
551
  };
387
- function _e(e) {
388
- return i.plainObject(e) ? v.FEATURE === e.type : !1;
552
+ function Qe(e) {
553
+ return i.plainObject(e) && e.type === h.FEATURE;
389
554
  }
390
- function xe(e) {
391
- return !i.plainObject(e) || e.type !== v.FEATURE_COLLECTION ? !1 : i.array(e.features);
555
+ function Ze(e) {
556
+ return i.plainObject(e) && e.type === h.FEATURE_COLLECTION && i.array(e.features);
392
557
  }
393
- function Q(e) {
394
- return i.plainObject(e) ? G(e) || _e(e) ? !0 : xe(e) : !1;
558
+ function Je(e) {
559
+ return Qe(e) || Ze(e);
395
560
  }
396
- function Ge(e) {
397
- return i.arrayOfLengthBetween(e, 2, 3) ? e.every(i.number) : !1;
561
+ function F(e) {
562
+ return Je(e) || qe(e);
398
563
  }
399
- function Ue(e, t, r) {
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] - r[1]) + t[0] * (r[1] - e[1]) + r[0] * (e[1] - t[1])) / 2
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 S(e, { tolerance: t = 0, getWeight: r = () => 1 } = {}) {
597
+ function U(e, { tolerance: t = 0, getWeight: n = () => 1 } = {}) {
405
598
  if (e.length <= 2) return e;
406
- const n = e.map((a, p) => ({ coord: a, i: p, area: 1 / 0, removed: !1, prev: null, next: null }));
407
- for (let a = 0; a < n.length; a++)
408
- a > 0 && (n[a].prev = n[a - 1]), a < n.length - 1 && (n[a].next = n[a + 1]);
409
- const s = (a) => !a.prev || !a.next ? 1 / 0 : Ue(a.prev.coord, a.coord, a.next.coord) * r(a.coord, a.i), o = new se((a, p) => a.area - p.area);
410
- for (let a = 1; a < n.length - 1; a++)
411
- n[a].area = s(n[a]), n[a]._currentArea = n[a].area, o.push(n[a]);
412
- let u = 0;
413
- for (; o.size() > 0; ) {
414
- const a = o.pop();
415
- if (!a.removed && a.area === a._currentArea) {
416
- if (a.area < u ? a.area = u : u = a.area, a.area >= t) break;
417
- a.removed = !0, a.prev && (a.prev.next = a.next), a.next && (a.next.prev = a.prev), a.prev?.prev && (a.prev.area = s(a.prev), a.prev._currentArea = a.prev.area, o.push(a.prev)), a.next?.next && (a.next.area = s(a.next), a.next._currentArea = a.next.area, o.push(a.next));
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 g = [];
421
- let c = n[0];
613
+ const m = [];
614
+ let c = r[0];
422
615
  for (; c; )
423
- c.removed || g.push(c.coord), c = c.next;
424
- return g;
425
- }
426
- function U(e, t) {
427
- switch (l.all([
428
- { value: e, validator: G, message: "geometry must be a GeoJson geometry" }
429
- ]), e.type) {
430
- case f.LINESTRING:
431
- e.coordinates = S(e.coordinates, t);
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 f.POLYGON:
434
- case f.MULTI_LINESTRING:
435
- e.coordinates = e.coordinates.map((r) => S(r, t));
637
+ case g.POLYGON:
638
+ case g.MULTI_LINESTRING:
639
+ e.coordinates = e.coordinates.map((n) => U(n, t));
436
640
  break;
437
- case f.MULTI_POLYGON:
438
- e.coordinates = e.coordinates.map((r) => r.map((n) => S(n, t)));
641
+ case g.MULTI_POLYGON:
642
+ e.coordinates = e.coordinates.map((n) => n.map((r) => U(r, t)));
439
643
  break;
440
- case f.GEOMETRY_COLLECTION:
441
- e.geometries.forEach((r) => U(r, t));
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
- const Fe = j(["common-ekosystem", "simplify", "geojson"]);
447
- function Z(e, t) {
448
- if (e.type === v.FEATURE)
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
- const ke = j(["common-ekosystem", "truncate", "geojson"]);
480
- function te(e, t) {
481
- if (e.type === v.FEATURE)
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
- ke.warn('Unknown feature type "{type}", skipping.', { type: e.type });
487
- return e.bbox && J(e.bbox, t), e;
658
+ for (const n of e.features) ce(n, t);
659
+ return e.bbox && ue(e.bbox, t), e;
488
660
  }
489
- function pt(e, t = 7) {
490
- return l.all([
491
- { value: e, validator: Q, message: "geoJson must be a valid GeoJson" },
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 D(e) {
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: [] }, r = W(e[0]);
531
- r > 6 && t.warnings.push({ message: `longitude precision is high (${r} decimals, max recommended: 6)` });
532
- const n = W(e[1]);
533
- return n > 6 && t.warnings.push({ message: `latitude precision is high (${n} decimals, max recommended: 6)` }), t;
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 Pe(e) {
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, r = t ? [e[0], e[1]] : [e[0], e[1], e[2]], n = t ? [e[2], e[3]] : [e[3], e[4], e[5]], s = D(r);
543
- if (!s.valid)
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: s.errors.map((m) => ({ ...m, message: `Invalid bbox south-west: ${m.message}` })),
714
+ errors: a.errors.map((f) => ({ ...f, message: `Invalid bbox south-west: ${f.message}` })),
547
715
  warnings: []
548
716
  };
549
- const o = D(n);
550
- if (!o.valid)
717
+ const s = C(r);
718
+ if (!s.valid)
551
719
  return {
552
720
  valid: !1,
553
- errors: o.errors.map((m) => ({ ...m, message: `Invalid bbox north-east: ${m.message}` })),
721
+ errors: s.errors.map((f) => ({ ...f, message: `Invalid bbox north-east: ${f.message}` })),
554
722
  warnings: []
555
723
  };
556
- const [u, g] = r, [c, a] = n;
557
- if (g > a)
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 (${g}) must be <= north (${a})` }],
728
+ errors: [{ message: `Invalid bbox: south (${m}) must be <= north (${o})` }],
561
729
  warnings: []
562
730
  };
563
- const p = { valid: !0, errors: [], warnings: [] };
564
- return u > c && p.warnings.push({ message: `bbox crosses the antimeridian (west: ${u} > east: ${c})` }), p.warnings.push(...s.warnings.map((m) => ({ ...m, message: `south-west: ${m.message}` }))), p.warnings.push(...o.warnings.map((m) => ({ ...m, message: `north-east: ${m.message}` }))), p;
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 He(e) {
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 L.NAME:
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 L.LINK:
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 y() {
771
+ function T() {
595
772
  return { Feature: 0, FeatureCollection: 0, geometries: {} };
596
773
  }
597
- function Ve(...e) {
598
- const t = y();
599
- for (const r of e) {
600
- const n = r.statistics;
601
- if (n) {
602
- t.Feature += n.Feature ?? 0, t.FeatureCollection += n.FeatureCollection ?? 0;
603
- for (const [s, o] of Object.entries(n.geometries ?? {}))
604
- t.geometries[s] = (t.geometries[s] ?? 0) + o;
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 h(e, t, r = "") {
610
- const n = {
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 s = 0; s < e.length; s++) {
616
- const o = `${r}/${s}`, u = t(e[s], o, s);
617
- if (!u.valid) {
618
- n.valid = !1, n.errors = n.errors.concat(u.errors.map((g) => ({ ...g, path: g.path || o, index: s })));
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(u.warnings) || (n.warnings = n.warnings.concat(u.warnings.map((g) => ({ ...g, path: g.path || o, index: s })))), u.statistics && (n.statistics = Ve(n, u));
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 n;
801
+ return r;
624
802
  }
625
- function We(e, t) {
803
+ function te(e, t) {
626
804
  if (!i.defined(e.crs)) return t;
627
- const r = He(e.crs);
628
- return r.valid || (t.valid = !1, t.errors.push(...r.errors.map((n) => ({ ...n, path: "/crs" })))), t.warnings.push(...r.warnings.map((n) => ({ ...n, path: "/crs" }))), t;
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 w(e, t, r = "") {
808
+ function N(e, t, n = "") {
631
809
  if (!i.defined(e.bbox)) return t;
632
- const n = Pe(e.bbox);
633
- return n.valid || (t.valid = !1, t.errors.push(...n.errors.map((s) => ({ ...s, path: `${r}/bbox` })))), t.warnings.push(...n.warnings.map((s) => ({ ...s, path: `${r}/bbox` }))), t;
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 F(e, t = 0, r = "") {
636
- return i.arrayOfLengthAtLeast(e, t) ? h(e, D, r) : {
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: r }],
816
+ errors: [{ message: `Invalid coordinates: must have at least ${t} positions`, path: n }],
639
817
  warnings: []
640
818
  };
641
819
  }
642
- function ne(e, t = "") {
643
- const r = F(e, 2, t);
644
- if (!r.valid) return r;
645
- for (let n = 0; n < e.length - 1; n++) {
646
- const s = e[n][0], o = e[n + 1][0];
647
- Math.abs(o - s) > 180 && r.warnings.push({
648
- message: `LineString crosses the antimeridian between positions ${n} and ${n + 1}, consider using MultiLineString`,
649
- path: `${t}/${n}`
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 r;
830
+ return n;
653
831
  }
654
- function je(e, t = "") {
655
- return i.nonEmptyArray(e) ? h(e, ne, t) : {
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 Ye(e, t, r = "") {
662
- const n = F(e, 4, r);
663
- if (!n.valid) return n;
664
- const s = e[0], o = e[e.length - 1];
665
- if (s[0] !== o[0] || s[1] !== o[1])
666
- return n.valid = !1, n.errors.push({ message: "Invalid LinearRing: first and last position must be identical", path: r }), n;
667
- const g = oe(e) ? "clockwise" : "counter-clockwise";
668
- g !== t && n.warnings.push({ message: `Ring must be ${t} but is ${g}`, path: r });
669
- const c = le({ type: "Polygon", coordinates: [e] });
670
- return c.features.length > 0 && (n.valid = !1, n.errors.push({ message: `Invalid LinearRing: ${c.features.length} self-intersection(s) detected`, path: r })), n;
671
- }
672
- function re(e, t = "") {
673
- return i.nonEmptyArray(e) ? h(e, (r, n, s) => Ye(r, s === 0 ? "counter-clockwise" : "clockwise", n), t) : {
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 Be(e, t = "") {
680
- return i.nonEmptyArray(e) ? h(e, (r, n) => re(r, n), t) : {
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 Xe(e, t = "") {
687
- return i.nonEmptyArray(e) ? h(e, (r, n) => k(r, n), t) : {
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 k(e, t = "") {
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 r = `${t}/coordinates`;
701
- let n;
878
+ const n = `${t}/coordinates`;
879
+ let r;
702
880
  switch (e.type) {
703
- case f.POINT: {
704
- const s = D(e.coordinates);
705
- n = {
706
- valid: s.valid,
707
- errors: s.errors.map((o) => ({ ...o, path: r })),
708
- warnings: s.warnings.map((o) => ({ ...o, path: r }))
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 f.MULTI_POINT: {
713
- n = F(e.coordinates, 0, r);
890
+ case g.MULTI_POINT: {
891
+ r = W(e.coordinates, 0, n);
714
892
  break;
715
893
  }
716
- case f.LINESTRING: {
717
- n = ne(e.coordinates, r);
894
+ case g.LINESTRING: {
895
+ r = me(e.coordinates, n);
718
896
  break;
719
897
  }
720
- case f.MULTI_LINESTRING: {
721
- n = je(e.coordinates, r);
898
+ case g.MULTI_LINESTRING: {
899
+ r = ut(e.coordinates, n);
722
900
  break;
723
901
  }
724
- case f.POLYGON: {
725
- n = re(e.coordinates, r);
902
+ case g.POLYGON: {
903
+ r = fe(e.coordinates, n);
726
904
  break;
727
905
  }
728
- case f.MULTI_POLYGON: {
729
- n = Be(e.coordinates, r);
906
+ case g.MULTI_POLYGON: {
907
+ r = ct(e.coordinates, n);
730
908
  break;
731
909
  }
732
- case f.GEOMETRY_COLLECTION: {
733
- n = Xe(e.geometries, `${t}/geometries`);
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 w(e, n, t);
921
+ return r = N(e, r, t), r.statistics = { geometries: { [e.type]: 1 } }, r;
744
922
  }
745
- function ie(e, t = "") {
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: y()
929
+ statistics: T()
752
930
  };
753
- if (e.type === v.FEATURE) {
931
+ if (e.type === h.FEATURE) {
754
932
  if (i.nonEmptyObject(e.geometry)) {
755
- const r = k(e.geometry, `${t}/geometry`);
933
+ const n = X(e.geometry, `${t}/geometry`);
756
934
  return {
757
- ...w(e, r, t),
935
+ ...N(e, n, t),
758
936
  statistics: {
759
937
  Feature: 1,
760
938
  FeatureCollection: 0,
761
- geometries: { [e.geometry.type]: 1 }
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 === v.FEATURE_COLLECTION) {
951
+ if (e.type === h.FEATURE_COLLECTION) {
773
952
  if (i.nonEmptyArray(e.features)) {
774
- const r = h(e.features, ie, `${t}/features`);
953
+ const n = L(e.features, ge, `${t}/features`);
775
954
  return {
776
- ...w(e, r, t),
777
- statistics: { ...r.statistics, FeatureCollection: r.statistics.FeatureCollection + 1 }
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: y()
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: y()
970
+ statistics: T()
792
971
  };
793
972
  }
794
- function Et(e) {
795
- if (l.that(e, i.nonEmptyObject, "geojson must be a non empty object"), i.oneOf(e.type, Object.values(f)))
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
- ...k(e, ""),
798
- statistics: { Feature: 0, FeatureCollection: 0, geometries: { [e.type]: 1 } }
977
+ ...te(e, n),
978
+ // Geometry counting is owned by validateGeometry.
979
+ statistics: { Feature: 0, FeatureCollection: 0, geometries: { ...t.statistics.geometries } }
799
980
  };
800
- if (e.type === v.FEATURE || e.type === v.FEATURE_COLLECTION) {
801
- const t = ie(e, "");
802
- return We(e, t);
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: y()
990
+ statistics: T()
809
991
  };
810
992
  }
811
993
  export {
812
994
  d as AXES,
813
- C as COORDINATE_FORMATS,
814
- we as COORDINATE_MODELS,
815
- x as COORDINATE_TRUNCATION_FACTORS,
816
- L as CRS_TYPES,
817
- v as FEATURE_TYPES,
818
- f as GEOMETRY_TYPES,
819
- gt as convertCoordinate,
820
- W as getCoordinatePrecision,
821
- Ee as getDirectionAxis,
822
- it as getDirections,
823
- ot as getEast,
824
- pe as getLocale,
825
- st as getNorth,
826
- at as getSouth,
827
- lt as getWest,
828
- V as guessCoordinateAxis,
829
- et as isAltitude,
830
- ue as isAxis,
831
- E as isDirection,
832
- X as isEast,
833
- N as isLatitude,
834
- $e as isLikeBBox,
835
- mt as isLikeCRS,
836
- _e as isLikeFeature,
837
- xe as isLikeFeatureCollection,
838
- Q as isLikeGeoJson,
839
- G as isLikeGeometry,
840
- Ge as isLikePosition,
841
- Y as isLongitude,
842
- ve as isNorth,
843
- B as isSouth,
844
- _ as isWest,
845
- tt as listLocales,
846
- ct as normalizeCoordinate,
847
- Me as parseCoordinate,
848
- ft as parsePosition,
849
- nt as registerLocale,
850
- rt as setLocale,
851
- dt as simplifyGeoJson,
852
- U as simplifyGeometry,
853
- J as truncateBBox,
854
- ut as truncateCoordinate,
855
- pt as truncateGeoJson,
856
- ee as truncateGeometry,
857
- vt as truncatePosition,
858
- Pe as validateBBox,
859
- He as validateCRS,
860
- Et as validateGeoJson,
861
- k as validateGeometry,
862
- D as validatePosition
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