@kalisio/common-geospatial 0.9.0 → 0.10.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/README.md +9 -3
- package/dist/foundation/index.cjs +2 -0
- package/dist/foundation/index.cjs.map +1 -0
- package/dist/foundation/index.mjs +77 -0
- package/dist/foundation/index.mjs.map +1 -0
- package/dist/geojson-CJ6QZ9pN.js +647 -0
- package/dist/geojson-CJ6QZ9pN.js.map +1 -0
- package/dist/geojson-QgqoCFjn.cjs +2 -0
- package/dist/geojson-QgqoCFjn.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +99 -1919
- package/dist/index.mjs.map +1 -1
- package/dist/io/index.cjs +11 -0
- package/dist/io/index.cjs.map +1 -0
- package/dist/io/index.mjs +539 -0
- package/dist/io/index.mjs.map +1 -0
- package/dist/line-CcfAx7LP.js +16 -0
- package/dist/line-CcfAx7LP.js.map +1 -0
- package/dist/line-Doxbvzns.cjs +2 -0
- package/dist/line-Doxbvzns.cjs.map +1 -0
- package/dist/operators/index.cjs +2 -0
- package/dist/operators/index.cjs.map +1 -0
- package/dist/operators/index.mjs +28 -0
- package/dist/operators/index.mjs.map +1 -0
- package/dist/ring-Cks2pGr8.js +1334 -0
- package/dist/ring-Cks2pGr8.js.map +1 -0
- package/dist/ring-CnFBeolv.cjs +2 -0
- package/dist/ring-CnFBeolv.cjs.map +1 -0
- package/dist/truncate-Cb17e4VI.cjs +2 -0
- package/dist/truncate-Cb17e4VI.cjs.map +1 -0
- package/dist/truncate-Cs8jmwOi.js +139 -0
- package/dist/truncate-Cs8jmwOi.js.map +1 -0
- package/package.json +22 -3
package/dist/index.mjs
CHANGED
|
@@ -1,1922 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { featureCollection as ht, feature as bt } from "@turf/helpers";
|
|
6
|
-
import Rt from "@turf/buffer";
|
|
7
|
-
import { Heap as Dt } from "heap-js";
|
|
8
|
-
const ie = typeof process > "u" || process.env?.NODE_ENV !== "production";
|
|
9
|
-
class Ie extends Error {
|
|
10
|
-
constructor(t) {
|
|
11
|
-
super(t), this.name = "AssertionError";
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function ye(e, t, n) {
|
|
15
|
-
if (!t(e)) throw new Ie(n);
|
|
16
|
-
}
|
|
17
|
-
const u = {
|
|
18
|
-
that(e, t, n) {
|
|
19
|
-
ie && ye(e, t, n);
|
|
20
|
-
},
|
|
21
|
-
all(e) {
|
|
22
|
-
if (ie)
|
|
23
|
-
for (const { value: t, validator: n, message: r } of e)
|
|
24
|
-
ye(t, n, r);
|
|
25
|
-
},
|
|
26
|
-
any(e) {
|
|
27
|
-
if (!(!ie || e.length === 0) && !e.some(({ value: t, validator: n }) => n(t)))
|
|
28
|
-
throw new Ie(e.map(({ message: t }) => t).join(" or "));
|
|
29
|
-
}
|
|
30
|
-
}, a = {
|
|
31
|
-
defined(e) {
|
|
32
|
-
return e != null;
|
|
33
|
-
},
|
|
34
|
-
nil(e) {
|
|
35
|
-
return !a.defined(e);
|
|
36
|
-
},
|
|
37
|
-
plainObject(e) {
|
|
38
|
-
return a.defined(e) && typeof e == "object" && !Array.isArray(e) && e.constructor === Object;
|
|
39
|
-
},
|
|
40
|
-
emptyObject(e) {
|
|
41
|
-
return a.plainObject(e) && Object.keys(e).length === 0;
|
|
42
|
-
},
|
|
43
|
-
nonEmptyObject(e) {
|
|
44
|
-
return a.plainObject(e) && Object.keys(e).length > 0;
|
|
45
|
-
},
|
|
46
|
-
boolean(e) {
|
|
47
|
-
return typeof e == "boolean";
|
|
48
|
-
},
|
|
49
|
-
booleanTrue(e) {
|
|
50
|
-
return e === !0;
|
|
51
|
-
},
|
|
52
|
-
booleanFalse(e) {
|
|
53
|
-
return e === !1;
|
|
54
|
-
},
|
|
55
|
-
string(e) {
|
|
56
|
-
return typeof e == "string";
|
|
57
|
-
},
|
|
58
|
-
emptyString(e) {
|
|
59
|
-
return a.string(e) && e.trim().length === 0;
|
|
60
|
-
},
|
|
61
|
-
nonEmptyString(e) {
|
|
62
|
-
return a.string(e) && e.trim().length > 0;
|
|
63
|
-
},
|
|
64
|
-
char(e) {
|
|
65
|
-
return a.string(e) && /^.$/u.test(e);
|
|
66
|
-
},
|
|
67
|
-
hex(e) {
|
|
68
|
-
return a.nonEmptyString(e) && e.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(e);
|
|
69
|
-
},
|
|
70
|
-
dataUri(e) {
|
|
71
|
-
return a.string(e) ? e.startsWith("data:") && e.includes(";base64,") : !1;
|
|
72
|
-
},
|
|
73
|
-
url(e) {
|
|
74
|
-
if (typeof e != "string") return !1;
|
|
75
|
-
const t = /^([a-z][a-z0-9+.-]*:\/\/)([^/?#]+)(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i.exec(e);
|
|
76
|
-
if (!t?.[2].includes(",")) return URL.canParse(e);
|
|
77
|
-
const [, n, r, i = "", s = "", o = ""] = t;
|
|
78
|
-
return r.split(",").every((c, g) => (c = c.trim(), !c || g > 0 && c.includes("@") ? !1 : URL.canParse(`${n}${c}${i}${s}${o}`)));
|
|
79
|
-
},
|
|
80
|
-
email(e) {
|
|
81
|
-
if (!a.string(e)) return !1;
|
|
82
|
-
const t = /^[-!#$%&'*+/0-9=?A-Z^_a-z`{|}~](\.?[-!#$%&'*+/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-?\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/, [n, r] = e.split("@");
|
|
83
|
-
return !n || !r || n.length > 64 || r.length > 255 || r.split(".").some((i) => i.length > 63) ? !1 : t.test(e);
|
|
84
|
-
},
|
|
85
|
-
regularExpression(e) {
|
|
86
|
-
return a.defined(e) && e instanceof RegExp;
|
|
87
|
-
},
|
|
88
|
-
number(e) {
|
|
89
|
-
return typeof e == "number" && !isNaN(e) && isFinite(e);
|
|
90
|
-
},
|
|
91
|
-
positive(e) {
|
|
92
|
-
return a.number(e) && e > 0;
|
|
93
|
-
},
|
|
94
|
-
nonPositive(e) {
|
|
95
|
-
return a.number(e) && e <= 0;
|
|
96
|
-
},
|
|
97
|
-
negative(e) {
|
|
98
|
-
return a.number(e) && e < 0;
|
|
99
|
-
},
|
|
100
|
-
nonNegative(e) {
|
|
101
|
-
return a.number(e) && e >= 0;
|
|
102
|
-
},
|
|
103
|
-
inRange(e, t, n) {
|
|
104
|
-
return u.that(n, (r) => r >= t, "max must be greater than or equal to min"), a.number(e) && e >= t && e <= n;
|
|
105
|
-
},
|
|
106
|
-
inRangeExclusive(e, t, n) {
|
|
107
|
-
return u.that(n, (r) => r > t, "max must be greater than min"), a.number(e) && e > t && e < n;
|
|
108
|
-
},
|
|
109
|
-
inRangeExclusiveMin(e, t, n) {
|
|
110
|
-
return u.that(n, (r) => r > t, "max must be greater than min"), a.number(e) && e > t && e <= n;
|
|
111
|
-
},
|
|
112
|
-
inRangeExclusiveMax(e, t, n) {
|
|
113
|
-
return u.that(n, (r) => r >= t, "max must be greater than or equal to min"), a.number(e) && e >= t && e < n;
|
|
114
|
-
},
|
|
115
|
-
integer(e) {
|
|
116
|
-
return a.number(e) && Number.isInteger(e);
|
|
117
|
-
},
|
|
118
|
-
positiveInteger(e) {
|
|
119
|
-
return a.integer(e) && a.positive(e);
|
|
120
|
-
},
|
|
121
|
-
nonPositiveInteger(e) {
|
|
122
|
-
return a.integer(e) && a.nonPositive(e);
|
|
123
|
-
},
|
|
124
|
-
negativeInteger(e) {
|
|
125
|
-
return a.integer(e) && a.negative(e);
|
|
126
|
-
},
|
|
127
|
-
nonNegativeInteger(e) {
|
|
128
|
-
return a.integer(e) && a.nonNegative(e);
|
|
129
|
-
},
|
|
130
|
-
array(e) {
|
|
131
|
-
return Array.isArray(e);
|
|
132
|
-
},
|
|
133
|
-
emptyArray(e) {
|
|
134
|
-
return a.array(e) && e.length === 0;
|
|
135
|
-
},
|
|
136
|
-
nonEmptyArray(e) {
|
|
137
|
-
return a.array(e) && e.length > 0;
|
|
138
|
-
},
|
|
139
|
-
arrayOfLength(e, t) {
|
|
140
|
-
return u.that(t, a.nonNegativeInteger, "length must be a non negative integer"), a.array(e) && e.length === t;
|
|
141
|
-
},
|
|
142
|
-
arrayOfLengthAtLeast(e, t) {
|
|
143
|
-
return u.that(t, a.nonNegativeInteger, "minLength must be a non negative integer"), a.array(e) && e.length >= t;
|
|
144
|
-
},
|
|
145
|
-
arrayOfLengthAtMost(e, t) {
|
|
146
|
-
return u.that(t, a.nonNegativeInteger, "maxLength must be a non negative integer"), a.array(e) && e.length <= t;
|
|
147
|
-
},
|
|
148
|
-
arrayOfLengthBetween(e, t, n) {
|
|
149
|
-
return u.all([
|
|
150
|
-
{ value: t, validator: a.nonNegativeInteger, message: "minLength must be a non negative integer" },
|
|
151
|
-
{ value: n, validator: a.nonNegativeInteger, message: "maxLength must be a non negative integer" },
|
|
152
|
-
{ value: t, validator: (r) => r <= n, message: "minLength must be less than or equal to maxLength" }
|
|
153
|
-
]), a.array(e) && e.length >= t && e.length <= n;
|
|
154
|
-
},
|
|
155
|
-
map(e) {
|
|
156
|
-
return a.defined(e) && e instanceof Map;
|
|
157
|
-
},
|
|
158
|
-
emptyMap(e) {
|
|
159
|
-
return a.map(e) && e.size === 0;
|
|
160
|
-
},
|
|
161
|
-
nonEmptyMap(e) {
|
|
162
|
-
return a.map(e) && e.size > 0;
|
|
163
|
-
},
|
|
164
|
-
set(e) {
|
|
165
|
-
return a.defined(e) && e instanceof Set;
|
|
166
|
-
},
|
|
167
|
-
emptySet(e) {
|
|
168
|
-
return a.set(e) && e.size === 0;
|
|
169
|
-
},
|
|
170
|
-
nonEmptySet(e) {
|
|
171
|
-
return a.set(e) && e.size > 0;
|
|
172
|
-
},
|
|
173
|
-
function(e) {
|
|
174
|
-
return typeof e == "function";
|
|
175
|
-
},
|
|
176
|
-
oneOf(e, t) {
|
|
177
|
-
return u.that(t, a.nonEmptyArray, "allowed values must be a non empty array"), t.includes(e);
|
|
178
|
-
},
|
|
179
|
-
empty(e) {
|
|
180
|
-
return a.nil(e) ? !0 : a.string(e) ? a.emptyString(e) : a.array(e) ? a.emptyArray(e) : a.plainObject(e) ? a.emptyObject(e) : a.map(e) ? a.emptyMap(e) : a.set(e) ? a.emptySet(e) : !1;
|
|
181
|
-
}
|
|
182
|
-
}, A = {
|
|
183
|
-
key(e, t) {
|
|
184
|
-
return u.all([
|
|
185
|
-
{ value: e, validator: a.plainObject, message: "obj must be an object" },
|
|
186
|
-
{ value: t, validator: a.nonEmptyString, message: "key must be a non empty string" }
|
|
187
|
-
]), Object.hasOwn(e, t);
|
|
188
|
-
},
|
|
189
|
-
keys(e, t) {
|
|
190
|
-
return u.all([
|
|
191
|
-
{ value: e, validator: a.plainObject, message: "obj must be an object" },
|
|
192
|
-
{ value: t, validator: (n) => a.array(n) && n.length > 0 && n.every(a.nonEmptyString), message: "keys must be an array of non empty strings" }
|
|
193
|
-
]), t.every((n) => A.key(e, n));
|
|
194
|
-
},
|
|
195
|
-
keyWithValue(e, t) {
|
|
196
|
-
return A.key(e, t) && a.defined(e[t]);
|
|
197
|
-
},
|
|
198
|
-
path(e, t) {
|
|
199
|
-
u.all([
|
|
200
|
-
{ value: e, validator: a.plainObject, message: "obj must be an object" },
|
|
201
|
-
{ value: t, validator: a.nonEmptyString, message: "path must be a non empty string" }
|
|
202
|
-
]);
|
|
203
|
-
let n = e;
|
|
204
|
-
for (const r of t.split(".")) {
|
|
205
|
-
if (!n || !a.plainObject(n) || !(r in n)) return !1;
|
|
206
|
-
n = n[r];
|
|
207
|
-
}
|
|
208
|
-
return !0;
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
function Ye(e, t, n = "") {
|
|
212
|
-
return Object.entries(t).every(([r, i]) => {
|
|
213
|
-
const s = n ? `${n}.${r}` : r;
|
|
214
|
-
if (!A.key(e, r))
|
|
215
|
-
return i._optional === !0;
|
|
216
|
-
const o = e[r];
|
|
217
|
-
if (a.plainObject(i))
|
|
218
|
-
return a.plainObject(o) && Ye(o, i, s);
|
|
219
|
-
if (typeof i == "function")
|
|
220
|
-
return i(o);
|
|
221
|
-
throw new Ie(`Invalid validator for key "${s}"`);
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
const y = {
|
|
225
|
-
schema(e, t) {
|
|
226
|
-
return u.all([
|
|
227
|
-
{ value: e, validator: a.plainObject, message: "obj must be an object" },
|
|
228
|
-
{ value: t, validator: a.plainObject, message: "schema must be an object" }
|
|
229
|
-
]), Ye(e, t);
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
function N(e) {
|
|
233
|
-
u.that(e, a.function, "validator must be a function");
|
|
234
|
-
function t(n) {
|
|
235
|
-
return a.nil(n) ? !0 : e(n);
|
|
236
|
-
}
|
|
237
|
-
return t._optional = !0, t;
|
|
238
|
-
}
|
|
239
|
-
const O = {
|
|
240
|
-
LATITUDE: "LAT",
|
|
241
|
-
LONGITUDE: "LON",
|
|
242
|
-
ALTITUDE: "ALT"
|
|
243
|
-
};
|
|
244
|
-
function He(e) {
|
|
245
|
-
return u.that(e, a.string, "axis must be a string"), Object.values(O).includes(e);
|
|
246
|
-
}
|
|
247
|
-
function X(e) {
|
|
248
|
-
return u.that(e, a.string, "axis must be a string"), e === O.LATITUDE;
|
|
249
|
-
}
|
|
250
|
-
function Ee(e) {
|
|
251
|
-
return u.that(e, a.string, "axis must be a string"), e === O.LONGITUDE;
|
|
252
|
-
}
|
|
253
|
-
function zn(e) {
|
|
254
|
-
return u.that(e, a.string, "axis must be a string"), e === O.ALTITUDE;
|
|
255
|
-
}
|
|
256
|
-
const At = { NORTH: { label: "Nord", symbol: "N" }, SOUTH: { label: "Sud", symbol: "S" }, EAST: { label: "Est", symbol: "E" }, WEST: { label: "Ouest", symbol: "O" } }, yt = { EMPTY_OBJECT: "L'objet est vide", UNKNOWN_TYPE: "Le type GeoJSON est inconnu", MISSING_GEOMETRY: "La géométrie est manquante", INVALID_FEATURES_ARRAY: "Le tableau de features est invalide", INVALID_GEOMETRY: "La géométrie est invalide", INVALID_GEOMETRY_TYPE: "Le type de géométrie est invalide", INVALID_COORDINATES_LENGTH: "Le nombre de coordonnées est invalide", INVALID_MULTI_LINESTRING_COORDINATES: "Les coordonnées du MultiLineString sont invalides", INVALID_POLYGON_COORDINATES: "Les coordonnées du Polygon sont invalides", INVALID_MULTIPOLYGON_COORDINATES: "Les coordonnées du MultiPolygon sont invalides", INVALID_GEOMETRYCOLLECTION_GEOMETRIES: "Les géométries de la GeometryCollection sont invalides", RING_NOT_CLOSED: "L'anneau n'est pas fermé", INVALID_WINDING_ORDER: "L'ordre d'orientation de l'anneau est invalide", SELF_INTERSECTION: "Une auto-intersection a été détectée", HOLE_INTERSECTS_SHELL: "Un trou intersecte le contour extérieur", ANTIMERIDIAN_CROSSING: "La géométrie traverse l'antiméridien", DUPLICATE_POSITION: "Une position consécutive est dupliquée", INVALID_POSITION_LENGTH: "Le nombre de coordonnées de la position est invalide", INVALID_POSITION_COORDINATES: "Les coordonnées de la position sont invalides", INVALID_LONGITUDE_RANGE: "La longitude est hors limites", INVALID_LATITUDE_RANGE: "La latitude est hors limites", INVALID_ALTITUDE: "L'altitude est invalide", EXCESSIVE_LONGITUDE_PRECISION: "La précision de la longitude est excessive", EXCESSIVE_LATITUDE_PRECISION: "La précision de la latitude est excessive", INVALID_BBOX_LENGTH: "Le nombre de coordonnées de la boîte englobante est invalide", INVALID_BBOX_LATITUDE_ORDER: "L'ordre des latitudes de la boîte englobante est invalide", INVALID_BBOX_LONGITUDE_ORDER: "L'ordre des longitudes de la boîte englobante est invalide", INVALID_BBOX_ALTITUDE_ORDER: "L'ordre des altitudes de la boîte englobante est invalide", BBOX_ANTIMERIDIAN_CROSSING: "La boîte englobante traverse l'antiméridien", INVALID_CRS_OBJECT: "L'objet CRS est invalide", INVALID_CRS_NAME: "Le nom du CRS est invalide", INVALID_CRS_LINK: "Le lien du CRS est invalide", INVALID_CRS_TYPE: "Le type de CRS est invalide", UNSUPPORTED_CRS: "Le CRS n'est pas pris en charge", UNSUPPORTED_LINK_CRS: "Le lien CRS n'est pas pris en charge", UNSUPPORTED_NESTED_CRS: "Le CRS imbriqué n'est pas pris en charge" }, Ct = {
|
|
257
|
-
DIRECTIONS: At,
|
|
258
|
-
VALIDATION: yt
|
|
259
|
-
}, Gt = { NORTH: { label: "North", symbol: "N" }, SOUTH: { label: "South", symbol: "S" }, EAST: { label: "East", symbol: "E" }, WEST: { label: "West", symbol: "W" } }, Mt = { EMPTY_OBJECT: "Object is empty", UNKNOWN_TYPE: "Unknown GeoJSON type", MISSING_GEOMETRY: "Geometry is missing", INVALID_FEATURES_ARRAY: "Features array is invalid", INVALID_GEOMETRY: "Geometry is invalid", INVALID_GEOMETRY_TYPE: "Geometry type is invalid", INVALID_COORDINATES_LENGTH: "Coordinates length is invalid", INVALID_MULTI_LINESTRING_COORDINATES: "MultiLineString coordinates are invalid", INVALID_POLYGON_COORDINATES: "Polygon coordinates are invalid", INVALID_MULTIPOLYGON_COORDINATES: "MultiPolygon coordinates are invalid", INVALID_GEOMETRYCOLLECTION_GEOMETRIES: "GeometryCollection geometries are invalid", RING_NOT_CLOSED: "Ring is not closed", INVALID_WINDING_ORDER: "Ring winding order is invalid", SELF_INTERSECTION: "Self-intersection detected", HOLE_INTERSECTS_SHELL: "A hole intersects the exterior ring", ANTIMERIDIAN_CROSSING: "Geometry crosses the antimeridian", DUPLICATE_POSITION: "Consecutive position is duplicated", INVALID_POSITION_LENGTH: "Position length is invalid", INVALID_POSITION_COORDINATES: "Position coordinates are invalid", INVALID_LONGITUDE_RANGE: "Longitude is out of range", INVALID_LATITUDE_RANGE: "Latitude is out of range", INVALID_ALTITUDE: "Altitude is invalid", EXCESSIVE_LONGITUDE_PRECISION: "Longitude precision is excessive", EXCESSIVE_LATITUDE_PRECISION: "Latitude precision is excessive", INVALID_BBOX_LENGTH: "Bounding box length is invalid", INVALID_BBOX_LATITUDE_ORDER: "Bounding box latitude order is invalid", INVALID_BBOX_LONGITUDE_ORDER: "Bounding box longitude order is invalid", INVALID_BBOX_ALTITUDE_ORDER: "Bounding box altitude order is invalid", BBOX_ANTIMERIDIAN_CROSSING: "Bounding box crosses the antimeridian", INVALID_CRS_OBJECT: "CRS object is invalid", INVALID_CRS_NAME: "CRS name is invalid", INVALID_CRS_LINK: "CRS link is invalid", INVALID_CRS_TYPE: "CRS type is invalid", UNSUPPORTED_CRS: "CRS is not supported", UNSUPPORTED_LINK_CRS: "CRS link is not supported", UNSUPPORTED_NESTED_CRS: "Nested CRS is not supported" }, We = {
|
|
260
|
-
DIRECTIONS: Gt,
|
|
261
|
-
VALIDATION: Mt
|
|
262
|
-
}, Pt = {
|
|
263
|
-
DIRECTIONS: {
|
|
264
|
-
NORTH: { label: a.string, symbol: a.char },
|
|
265
|
-
SOUTH: { label: a.string, symbol: a.char },
|
|
266
|
-
EAST: { label: a.string, symbol: a.char },
|
|
267
|
-
WEST: { label: a.string, symbol: a.char }
|
|
268
|
-
}
|
|
269
|
-
}, P = {
|
|
270
|
-
en: We,
|
|
271
|
-
fr: Ct
|
|
272
|
-
};
|
|
273
|
-
let x = "en";
|
|
274
|
-
const Ce = "en";
|
|
275
|
-
function Kn() {
|
|
276
|
-
return Object.keys(P);
|
|
277
|
-
}
|
|
278
|
-
function qn(e) {
|
|
279
|
-
u.all([
|
|
280
|
-
{ value: e, validator: a.string, message: "code must be a string" },
|
|
281
|
-
{ value: e, validator: (t) => A.key(P, t), message: "code is unknown" }
|
|
282
|
-
]), x = e;
|
|
283
|
-
}
|
|
284
|
-
function Ut() {
|
|
285
|
-
return x;
|
|
286
|
-
}
|
|
287
|
-
function Xe() {
|
|
288
|
-
return x === Ce ? [x] : [x, Ce];
|
|
289
|
-
}
|
|
290
|
-
function Zn(e, t) {
|
|
291
|
-
u.all([
|
|
292
|
-
{ value: e, validator: a.string, message: "code must be a string" },
|
|
293
|
-
{ value: e, validator: (n) => !A.key(P, n), message: "messages already registered" },
|
|
294
|
-
{ value: t, validator: a.plainObject, message: "messages must be an object" },
|
|
295
|
-
{ value: t, validator: (n) => y.schema(n, Pt), message: "messages do not conform to schema" }
|
|
296
|
-
]), P[e] = t;
|
|
297
|
-
}
|
|
298
|
-
function Oe(e) {
|
|
299
|
-
return u.all([
|
|
300
|
-
{ value: e, validator: a.string, message: "code must be a string" },
|
|
301
|
-
{ value: e, validator: (t) => A.key(P, t), message: "code is unknown" }
|
|
302
|
-
]), P[e];
|
|
303
|
-
}
|
|
304
|
-
function $() {
|
|
305
|
-
return Oe(Ut()).DIRECTIONS;
|
|
306
|
-
}
|
|
307
|
-
function ae(e) {
|
|
308
|
-
const t = /* @__PURE__ */ new Set();
|
|
309
|
-
for (const n of Xe()) {
|
|
310
|
-
const { DIRECTIONS: r } = Oe(n);
|
|
311
|
-
for (const i of e) t.add(r[i].symbol);
|
|
312
|
-
}
|
|
313
|
-
return [...t];
|
|
314
|
-
}
|
|
315
|
-
function te(e, t) {
|
|
316
|
-
const n = t.toUpperCase();
|
|
317
|
-
return Xe().some((r) => {
|
|
318
|
-
const { label: i, symbol: s } = Oe(r).DIRECTIONS[e];
|
|
319
|
-
return n === i.toUpperCase() || n === s.toUpperCase();
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
function Qn(e = null) {
|
|
323
|
-
const t = $();
|
|
324
|
-
return a.defined(e) ? (u.that(e, He, "axis must be a valid axis"), X(e) ? [t.SOUTH, t.NORTH] : Ee(e) ? [t.EAST, t.WEST] : []) : [t.SOUTH, t.NORTH, t.EAST, t.WEST];
|
|
325
|
-
}
|
|
326
|
-
function B(e = null) {
|
|
327
|
-
return a.defined(e) ? (u.that(e, He, "axis must be a valid axis"), X(e) ? ae(["NORTH", "SOUTH"]) : Ee(e) ? ae(["EAST", "WEST"]) : []) : ae(["NORTH", "SOUTH", "EAST", "WEST"]);
|
|
328
|
-
}
|
|
329
|
-
function Jn() {
|
|
330
|
-
return $().NORTH;
|
|
331
|
-
}
|
|
332
|
-
function er() {
|
|
333
|
-
return $().SOUTH;
|
|
334
|
-
}
|
|
335
|
-
function tr() {
|
|
336
|
-
return $().EAST;
|
|
337
|
-
}
|
|
338
|
-
function nr() {
|
|
339
|
-
return $().WEST;
|
|
340
|
-
}
|
|
341
|
-
function C(e) {
|
|
342
|
-
return u.that(e, a.string, "dir must be a string"), Vt(e) || ze(e) || Ne(e) || ne(e);
|
|
343
|
-
}
|
|
344
|
-
function Vt(e) {
|
|
345
|
-
return u.that(e, a.string, "dir must be a string"), te("NORTH", e);
|
|
346
|
-
}
|
|
347
|
-
function ze(e) {
|
|
348
|
-
return u.that(e, a.string, "dir must be a string"), te("SOUTH", e);
|
|
349
|
-
}
|
|
350
|
-
function Ne(e) {
|
|
351
|
-
return u.that(e, a.string, "dir must be a string"), te("EAST", e);
|
|
352
|
-
}
|
|
353
|
-
function ne(e) {
|
|
354
|
-
return u.that(e, a.string, "dir must be a string"), te("WEST", e);
|
|
355
|
-
}
|
|
356
|
-
function wt(e) {
|
|
357
|
-
return u.that(e, C, "dir must be a direction"), ne(e) || Ne(e) ? O.LONGITUDE : O.LATITUDE;
|
|
358
|
-
}
|
|
359
|
-
const jt = {
|
|
360
|
-
degrees: l.number,
|
|
361
|
-
direction: h(C)
|
|
362
|
-
}, xt = /^(-?\d{1,3}(?:\.\d+)?)°?$/;
|
|
363
|
-
function kt() {
|
|
364
|
-
return new RegExp(`^(\\d{1,3}(?:\\.\\d+)?)°?([${B()}])$`, "i");
|
|
365
|
-
}
|
|
366
|
-
function Y(e) {
|
|
367
|
-
let t = null, n = null;
|
|
368
|
-
if (l.plainObject(e) && V.schema(e, jt))
|
|
369
|
-
l.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, n = e.direction) : t = e.degrees;
|
|
370
|
-
else if (l.string(e)) {
|
|
371
|
-
const r = e.replace(/\s+/g, ""), i = r.match(xt) ?? r.match(kt());
|
|
372
|
-
i && (t = parseFloat(i[1]), n = i[2] ?? null);
|
|
373
|
-
}
|
|
374
|
-
return {
|
|
375
|
-
get degrees() {
|
|
376
|
-
return t;
|
|
377
|
-
},
|
|
378
|
-
get direction() {
|
|
379
|
-
return n;
|
|
380
|
-
},
|
|
381
|
-
get format() {
|
|
382
|
-
return "DD";
|
|
383
|
-
},
|
|
384
|
-
isValid() {
|
|
385
|
-
return l.number(t);
|
|
386
|
-
},
|
|
387
|
-
toString(r) {
|
|
388
|
-
if (_.that(r, l.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
|
|
389
|
-
let i = `${t.toFixed(r)}°`;
|
|
390
|
-
return n && (i += ` ${n}`), i;
|
|
391
|
-
},
|
|
392
|
-
toDecimal() {
|
|
393
|
-
return this.isValid() ? Y({ degrees: t, direction: n }) : null;
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
const Ft = {
|
|
398
|
-
degrees: l.integer,
|
|
399
|
-
minutes: (e) => l.inRangeExclusiveMax(e, 0, 60),
|
|
400
|
-
direction: h(C)
|
|
401
|
-
}, $t = /^(-?\d{1,3})°(\d{1,2}(?:\.\d+)?)'?$/;
|
|
402
|
-
function Bt() {
|
|
403
|
-
return new RegExp(`^(\\d{1,3})°(\\d{1,2}(?:\\.\\d+)?)'?([${B().join("")}])$`, "i");
|
|
404
|
-
}
|
|
405
|
-
function Ke(e) {
|
|
406
|
-
let t = null, n = null, r = null;
|
|
407
|
-
if (l.plainObject(e) && V.schema(e, Ft))
|
|
408
|
-
l.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, n = e.minutes, r = e.direction) : (t = e.degrees, n = e.minutes);
|
|
409
|
-
else if (l.string(e)) {
|
|
410
|
-
const i = e.replace(/\s+/g, ""), s = i.match($t) ?? i.match(Bt());
|
|
411
|
-
s && (t = parseFloat(s[1]), n = parseFloat(s[2]), r = s[3] ?? null);
|
|
412
|
-
}
|
|
413
|
-
return {
|
|
414
|
-
get degrees() {
|
|
415
|
-
return t;
|
|
416
|
-
},
|
|
417
|
-
get minutes() {
|
|
418
|
-
return n;
|
|
419
|
-
},
|
|
420
|
-
get direction() {
|
|
421
|
-
return r;
|
|
422
|
-
},
|
|
423
|
-
get format() {
|
|
424
|
-
return "DDM";
|
|
425
|
-
},
|
|
426
|
-
isValid() {
|
|
427
|
-
return l.integer(t) && l.inRangeExclusiveMax(n, 0, 60);
|
|
428
|
-
},
|
|
429
|
-
toString(i) {
|
|
430
|
-
if (_.that(i, l.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
|
|
431
|
-
let s = `${t}° ${n.toFixed(i)}'`;
|
|
432
|
-
return r && (s += ` ${r}`), s;
|
|
433
|
-
},
|
|
434
|
-
toDecimal() {
|
|
435
|
-
return this.isValid() ? Y({ degrees: t + n / 60, direction: r }) : null;
|
|
436
|
-
}
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
const Yt = {
|
|
440
|
-
degrees: l.nonNegativeInteger,
|
|
441
|
-
minutes: (e) => l.inRangeExclusiveMax(e, 0, 60),
|
|
442
|
-
direction: C
|
|
443
|
-
};
|
|
444
|
-
function Ht() {
|
|
445
|
-
return new RegExp(`^(\\d{2})(\\d{3})([${B(O.LATITUDE).join("")}])$`, "i");
|
|
446
|
-
}
|
|
447
|
-
function Wt() {
|
|
448
|
-
return new RegExp(`^(\\d{3})(\\d{3})([${B(O.LONGITUDE).join("")}])$`, "i");
|
|
449
|
-
}
|
|
450
|
-
function qe(e) {
|
|
451
|
-
let t = null, n = null, r = null;
|
|
452
|
-
if (l.plainObject(e) && V.schema(e, Yt))
|
|
453
|
-
t = e.degrees, n = e.minutes, r = e.direction;
|
|
454
|
-
else if (l.string(e)) {
|
|
455
|
-
const i = e.trim(), s = i.match(Ht()) ?? i.match(Wt());
|
|
456
|
-
s && (t = parseFloat(s[1]), n = parseFloat(s[2]) / 10, r = s[3]);
|
|
457
|
-
}
|
|
458
|
-
return {
|
|
459
|
-
get degrees() {
|
|
460
|
-
return t;
|
|
461
|
-
},
|
|
462
|
-
get minutes() {
|
|
463
|
-
return n;
|
|
464
|
-
},
|
|
465
|
-
get direction() {
|
|
466
|
-
return r;
|
|
467
|
-
},
|
|
468
|
-
get format() {
|
|
469
|
-
return "DDM_AERO";
|
|
470
|
-
},
|
|
471
|
-
isValid() {
|
|
472
|
-
return l.nonNegativeInteger(t) && l.inRangeExclusiveMax(n, 0, 60) && C(r);
|
|
473
|
-
},
|
|
474
|
-
toString() {
|
|
475
|
-
if (!this.isValid()) return "";
|
|
476
|
-
const i = Ne(r) || ne(r), s = String(t).padStart(i ? 3 : 2, "0"), o = Math.floor(n * 10).toString().padStart(3, "0");
|
|
477
|
-
return `${s}${o}${r}`;
|
|
478
|
-
},
|
|
479
|
-
toDecimal() {
|
|
480
|
-
return this.isValid() ? Y({ degrees: t + n / 60, direction: r }) : null;
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
const Xt = {
|
|
485
|
-
degrees: l.integer,
|
|
486
|
-
minutes: (e) => l.integer(e) && l.inRange(e, 0, 59),
|
|
487
|
-
seconds: (e) => l.inRangeExclusiveMax(e, 0, 60),
|
|
488
|
-
direction: h(C)
|
|
489
|
-
}, zt = /^(-?\d{1,3})°(\d{1,2})'(\d{1,2}(?:\.\d+)?)"?$/;
|
|
490
|
-
function Kt() {
|
|
491
|
-
return new RegExp(`^(\\d{1,3})°(\\d{1,2})'(\\d{1,2}(?:\\.\\d+)?)"?([${B().join("")}])$`, "i");
|
|
492
|
-
}
|
|
493
|
-
function Ze(e) {
|
|
494
|
-
let t = null, n = null, r = null, i = null;
|
|
495
|
-
if (l.plainObject(e) && V.schema(e, Xt))
|
|
496
|
-
l.defined(e.direction) ? e.degrees >= 0 && (t = e.degrees, n = e.minutes, r = e.seconds, i = e.direction) : (t = e.degrees, n = e.minutes, r = e.seconds);
|
|
497
|
-
else if (l.string(e)) {
|
|
498
|
-
const s = e.replace(/\s+/g, ""), o = s.match(zt) ?? s.match(Kt());
|
|
499
|
-
o && (t = parseFloat(o[1]), n = parseFloat(o[2]), r = parseFloat(o[3]), i = o[4] ?? null);
|
|
500
|
-
}
|
|
501
|
-
return {
|
|
502
|
-
get degrees() {
|
|
503
|
-
return t;
|
|
504
|
-
},
|
|
505
|
-
get minutes() {
|
|
506
|
-
return n;
|
|
507
|
-
},
|
|
508
|
-
get seconds() {
|
|
509
|
-
return r;
|
|
510
|
-
},
|
|
511
|
-
get direction() {
|
|
512
|
-
return i;
|
|
513
|
-
},
|
|
514
|
-
get format() {
|
|
515
|
-
return "DMS";
|
|
516
|
-
},
|
|
517
|
-
isValid() {
|
|
518
|
-
return l.integer(t) && l.integer(n) && l.inRange(n, 0, 59) && l.inRangeExclusiveMax(r, 0, 60);
|
|
519
|
-
},
|
|
520
|
-
toString(s) {
|
|
521
|
-
if (_.that(s, l.positiveInteger, "decimalPlaces must be a positive integer"), !this.isValid()) return "";
|
|
522
|
-
let o = `${t}° ${n}' ${r.toFixed(s)}"`;
|
|
523
|
-
return i && (o += ` ${i}`), o;
|
|
524
|
-
},
|
|
525
|
-
toDecimal() {
|
|
526
|
-
return this.isValid() ? Y({ degrees: t + n / 60 + r / 3600, direction: i }) : null;
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
}
|
|
530
|
-
function Ge(e) {
|
|
531
|
-
const t = Math.floor(e.degrees), n = (e.degrees - t) * 60;
|
|
532
|
-
return { degrees: t, minutes: n, direction: e.direction };
|
|
533
|
-
}
|
|
534
|
-
function qt(e) {
|
|
535
|
-
const t = Math.floor(e.degrees), n = (e.degrees - t) * 60, r = Math.floor(n), i = (n - r) * 60;
|
|
536
|
-
return { degrees: t, minutes: r, seconds: i, direction: e.direction };
|
|
537
|
-
}
|
|
538
|
-
const Me = {
|
|
539
|
-
DD: (e) => (_.that(e, (t) => t.isValid(), "dd must be a valid coordinate"), e),
|
|
540
|
-
DDM: (e) => {
|
|
541
|
-
_.that(e, (i) => i.isValid(), "dd must be a valid coordinate");
|
|
542
|
-
const { degrees: t, minutes: n, direction: r } = Ge(e);
|
|
543
|
-
return Ke(r ? { degrees: t, minutes: n, direction: r } : { degrees: t, minutes: n });
|
|
544
|
-
},
|
|
545
|
-
DMS: (e) => {
|
|
546
|
-
_.that(e, (s) => s.isValid(), "dd must be a valid coordinate");
|
|
547
|
-
const { degrees: t, minutes: n, seconds: r, direction: i } = qt(e);
|
|
548
|
-
return Ze(i ? { degrees: t, minutes: n, seconds: r, direction: i } : { degrees: t, minutes: n, seconds: r });
|
|
549
|
-
},
|
|
550
|
-
DDM_AERO: (e) => {
|
|
551
|
-
_.that(e, (i) => i.isValid(), "dd must be a valid coordinate");
|
|
552
|
-
const { degrees: t, minutes: n, direction: r } = Ge(e);
|
|
553
|
-
return qe({ degrees: t, minutes: n, direction: r });
|
|
554
|
-
}
|
|
555
|
-
}, fe = {
|
|
556
|
-
DD: "DD",
|
|
557
|
-
DDM: "DDM",
|
|
558
|
-
DDM_AERO: "DDM_AERO",
|
|
559
|
-
DMS: "DMS"
|
|
560
|
-
}, Zt = {
|
|
561
|
-
DD: Y,
|
|
562
|
-
DDM: Ke,
|
|
563
|
-
DDM_AERO: qe,
|
|
564
|
-
DMS: Ze
|
|
565
|
-
}, v = 7, R = 8, Qt = Array.from({ length: R + 1 }, (e, t) => 10 ** t);
|
|
566
|
-
function Pe(e, t) {
|
|
567
|
-
if (u.that(e, a.number, "coord must be a number"), a.defined(t))
|
|
568
|
-
return u.that(t, C, "dir must be a direction"), wt(t);
|
|
569
|
-
if (Math.abs(e) > 90) return O.LONGITUDE;
|
|
570
|
-
}
|
|
571
|
-
function Ue(e) {
|
|
572
|
-
u.that(e, a.number, "coord must be a number");
|
|
573
|
-
const t = e.toExponential(), [n, r] = t.split("e").map(Number), i = (n.toString().split(".")[1] || "").length;
|
|
574
|
-
return Math.max(0, i - r);
|
|
575
|
-
}
|
|
576
|
-
function Qe(e, t = v) {
|
|
577
|
-
u.all([
|
|
578
|
-
{
|
|
579
|
-
value: e,
|
|
580
|
-
validator: a.number,
|
|
581
|
-
message: "coord must be a number"
|
|
582
|
-
},
|
|
583
|
-
{
|
|
584
|
-
value: t,
|
|
585
|
-
validator: (r) => a.inRange(r, 0, R),
|
|
586
|
-
message: `precision must be in range [0, ${R}]`
|
|
587
|
-
}
|
|
588
|
-
]);
|
|
589
|
-
const n = Qt[t];
|
|
590
|
-
return Math.round(e * n) / n;
|
|
591
|
-
}
|
|
592
|
-
function rr(e, t) {
|
|
593
|
-
if (u.all([
|
|
594
|
-
{ value: e, validator: a.number, message: "coord must be a number" },
|
|
595
|
-
{ value: t, validator: (r) => Ee(r) || X(r), message: "axis must be either a longitude or latitude" }
|
|
596
|
-
]), X(t))
|
|
597
|
-
return Math.max(-90, Math.min(90, e));
|
|
598
|
-
let n = ((e + 180) % 360 + 360) % 360 - 180;
|
|
599
|
-
return n === -180 && (n = 180), Object.is(n, -0) && (n = 0), n;
|
|
600
|
-
}
|
|
601
|
-
function ir(e, t) {
|
|
602
|
-
u.all([
|
|
603
|
-
{ value: e, validator: (r) => a.defined(r) && r.isValid(), message: "from must be a valid coordinate" },
|
|
604
|
-
{ value: t, validator: (r) => A.key(Me, r), message: `unknown format: ${t}` }
|
|
605
|
-
]);
|
|
606
|
-
const n = e.format === fe.DD ? e : e.toDecimal();
|
|
607
|
-
return n.isValid() ? t === fe.DD ? n : Me[t](n) : null;
|
|
608
|
-
}
|
|
609
|
-
function Jt(e) {
|
|
610
|
-
u.that(e, a.nonEmptyString, "pattern must be a non empty string");
|
|
611
|
-
for (const t of Object.keys(fe)) {
|
|
612
|
-
const n = Zt[t](e);
|
|
613
|
-
if (n.isValid()) return n;
|
|
614
|
-
}
|
|
615
|
-
return null;
|
|
616
|
-
}
|
|
617
|
-
typeof process < "u" && process.versions?.node != null, typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope, typeof ServiceWorkerGlobalScope < "u" && self instanceof ServiceWorkerGlobalScope, typeof process < "u" && process.env.NODE_ENV, typeof process < "u" && process.env.NODE_ENV, typeof process < "u" && process.env.NODE_ENV;
|
|
618
|
-
const T = {
|
|
619
|
-
clamp(e, t, n) {
|
|
620
|
-
return u.all([
|
|
621
|
-
{ value: e, validator: a.number, message: "value must be a number" },
|
|
622
|
-
{ value: t, validator: a.number, message: "min must be a number" },
|
|
623
|
-
{ value: n, validator: a.number, message: "max must be a number" }
|
|
624
|
-
]), Math.min(Math.max(e, t), n);
|
|
625
|
-
},
|
|
626
|
-
round(e, t = 2) {
|
|
627
|
-
u.all([
|
|
628
|
-
{ value: e, validator: a.number, message: "value must be a number" },
|
|
629
|
-
{ value: t, validator: a.nonNegativeInteger, message: "precision must be a non-negative integer" }
|
|
630
|
-
]);
|
|
631
|
-
const n = 10 ** t;
|
|
632
|
-
return Math.round(e * n) / n;
|
|
633
|
-
},
|
|
634
|
-
sign(e, t = 0) {
|
|
635
|
-
return u.all([
|
|
636
|
-
{ value: e, validator: a.number, message: "value must be a number" },
|
|
637
|
-
{ value: t, validator: a.nonNegative, message: "epsilon must be a non-negative number" }
|
|
638
|
-
]), e > t ? 1 : e < -t ? -1 : 0;
|
|
639
|
-
},
|
|
640
|
-
percentage(e, t) {
|
|
641
|
-
return u.all([
|
|
642
|
-
{ value: e, validator: a.number, message: "value must be a number" },
|
|
643
|
-
{ value: t, validator: a.number, message: "total must be a number" }
|
|
644
|
-
]), T.round(e / t * 100, 2);
|
|
645
|
-
},
|
|
646
|
-
exponential(e, t = 2) {
|
|
647
|
-
if (u.all([
|
|
648
|
-
{ value: e, validator: a.number, message: "value must be a number" },
|
|
649
|
-
{ value: t, validator: a.nonNegativeInteger, message: "decimals must be a non-negative integer" }
|
|
650
|
-
]), e === 0) return `0.${"0".repeat(t)}e+0`;
|
|
651
|
-
const n = Math.floor(Math.log10(Math.abs(e)));
|
|
652
|
-
return `${(e / Math.pow(10, n)).toFixed(t)}e${n >= 0 ? "+" : ""}${n}`;
|
|
653
|
-
},
|
|
654
|
-
linear(e, t = 0, n = 1) {
|
|
655
|
-
return u.all([
|
|
656
|
-
{ value: e, validator: (r) => a.inRange(r, 0, 1), message: "t must be in range [0, 1]" },
|
|
657
|
-
{ value: t, validator: a.number, message: "initial must be a number" },
|
|
658
|
-
{ value: n, validator: a.number, message: "final must be a number" }
|
|
659
|
-
]), t + e * (n - t);
|
|
660
|
-
},
|
|
661
|
-
to: {
|
|
662
|
-
radians(e) {
|
|
663
|
-
return u.that(e, a.number, "degrees must be a number"), e * Math.PI / 180;
|
|
664
|
-
},
|
|
665
|
-
degrees(e) {
|
|
666
|
-
return u.that(e, a.number, "radians must be a number"), e * 180 / Math.PI;
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
pow: {
|
|
670
|
-
square(e) {
|
|
671
|
-
return u.that(e, a.number, "value must be a number"), e * e;
|
|
672
|
-
},
|
|
673
|
-
cube(e) {
|
|
674
|
-
return u.that(e, a.number, "value must be a number"), T.pow.square(e) * e;
|
|
675
|
-
}
|
|
676
|
-
},
|
|
677
|
-
ease: {
|
|
678
|
-
in(e, t = 0.5) {
|
|
679
|
-
return u.all([
|
|
680
|
-
{ value: e, validator: (n) => a.inRange(n, 0, 1), message: "t must be in range [0, 1]" },
|
|
681
|
-
{ value: t, validator: a.number, message: "linearity must be a number" }
|
|
682
|
-
]), Math.pow(e, 1 / t);
|
|
683
|
-
},
|
|
684
|
-
out(e, t = 0.5) {
|
|
685
|
-
return u.all([
|
|
686
|
-
{ value: e, validator: (n) => a.inRange(n, 0, 1), message: "t must be in range [0, 1]" },
|
|
687
|
-
{ value: t, validator: a.number, message: "linearity must be a number" }
|
|
688
|
-
]), 1 - Math.pow(1 - e, 1 / t);
|
|
689
|
-
},
|
|
690
|
-
cubicBezier(e, t = 0.42, n = 0, r = 0.58, i = 1) {
|
|
691
|
-
u.that(e, (g) => a.inRange(g, 0, 1), "t must be in range [0, 1]");
|
|
692
|
-
const s = 1 - e, o = e * e, c = s * s;
|
|
693
|
-
return c * s * n + 3 * c * e * t + 3 * s * o * r + o * e * i;
|
|
694
|
-
}
|
|
695
|
-
},
|
|
696
|
-
stats: {
|
|
697
|
-
sum(e) {
|
|
698
|
-
return u.that(e, a.array, "values must be an array"), e.reduce((t, n) => t + n, 0);
|
|
699
|
-
},
|
|
700
|
-
average(e) {
|
|
701
|
-
return u.that(e, a.nonEmptyArray, "values must be a non-empty array"), T.stats.sum(e) / e.length;
|
|
702
|
-
},
|
|
703
|
-
median(e) {
|
|
704
|
-
u.that(e, a.nonEmptyArray, "values must be a non-empty array");
|
|
705
|
-
const t = [...e].sort((r, i) => r - i), n = Math.floor(t.length / 2);
|
|
706
|
-
return t.length % 2 === 0 ? T.linear(0.5, t[n - 1], t[n]) : t[n];
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
N(a.boolean), N(a.boolean), N(a.boolean), N(a.string);
|
|
711
|
-
N(a.boolean), N(a.boolean), N(a.boolean), N(a.string);
|
|
712
|
-
N(a.array);
|
|
713
|
-
const z = T.to.radians(1), en = 1e-12;
|
|
714
|
-
function U(e) {
|
|
715
|
-
const t = e[0] * z, n = e[1] * z, r = Math.cos(n);
|
|
716
|
-
return [r * Math.cos(t), r * Math.sin(t), Math.sin(n)];
|
|
717
|
-
}
|
|
718
|
-
function tn(e) {
|
|
719
|
-
const t = Math.atan2(e[1], e[0]), n = Math.asin(e[2]);
|
|
720
|
-
return [t / z, n / z];
|
|
721
|
-
}
|
|
722
|
-
function j(e, t) {
|
|
723
|
-
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
|
|
724
|
-
}
|
|
725
|
-
function k(e, t) {
|
|
726
|
-
return [
|
|
727
|
-
e[1] * t[2] - e[2] * t[1],
|
|
728
|
-
e[2] * t[0] - e[0] * t[2],
|
|
729
|
-
e[0] * t[1] - e[1] * t[0]
|
|
730
|
-
];
|
|
731
|
-
}
|
|
732
|
-
function Je(e, t) {
|
|
733
|
-
return [e[0] + t[0], e[1] + t[1], e[2] + t[2]];
|
|
734
|
-
}
|
|
735
|
-
function K(e, t) {
|
|
736
|
-
return [e[0] * t, e[1] * t, e[2] * t];
|
|
737
|
-
}
|
|
738
|
-
function q(e) {
|
|
739
|
-
return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2]);
|
|
740
|
-
}
|
|
741
|
-
function nn(e) {
|
|
742
|
-
const t = q(e);
|
|
743
|
-
return [e[0] / t, e[1] / t, e[2] / t];
|
|
744
|
-
}
|
|
745
|
-
function rn(e, t) {
|
|
746
|
-
return Math.atan2(q(k(e, t)), j(e, t));
|
|
747
|
-
}
|
|
748
|
-
function an(e) {
|
|
749
|
-
return k(e, et(e));
|
|
750
|
-
}
|
|
751
|
-
function et(e) {
|
|
752
|
-
return nn(k([0, 0, 1], e));
|
|
753
|
-
}
|
|
754
|
-
function sn(e, t) {
|
|
755
|
-
const n = an(e), r = et(e);
|
|
756
|
-
return Je(
|
|
757
|
-
K(n, Math.cos(t)),
|
|
758
|
-
K(r, Math.sin(t))
|
|
759
|
-
);
|
|
760
|
-
}
|
|
761
|
-
function on(e, t, n) {
|
|
762
|
-
const r = sn(e, t);
|
|
763
|
-
return Je(
|
|
764
|
-
K(e, Math.cos(n)),
|
|
765
|
-
K(r, Math.sin(n))
|
|
766
|
-
);
|
|
767
|
-
}
|
|
768
|
-
function tt(e, t, n, r, i = en) {
|
|
769
|
-
const s = k(e, t), o = k(n, r), c = q(s), g = q(o);
|
|
770
|
-
if (c <= i || g <= i) return !1;
|
|
771
|
-
const E = T.sign(j(s, n) / c, i), f = T.sign(j(s, r) / c, i);
|
|
772
|
-
if (E * f !== -1) return !1;
|
|
773
|
-
const I = T.sign(j(o, e) / g, i), D = T.sign(j(o, t) / g, i);
|
|
774
|
-
return I * D === -1;
|
|
775
|
-
}
|
|
776
|
-
const nt = "WGS84", M = "+proj=longlat +datum=WGS84 +no_defs", un = {
|
|
777
|
-
WGS84: M,
|
|
778
|
-
"CRS:84": M,
|
|
779
|
-
CRS84: M,
|
|
780
|
-
"urn:ogc:def:crs:OGC:1.3:CRS84": M,
|
|
781
|
-
"urn:ogc:def:crs:OGC:2:84": M,
|
|
782
|
-
"urn:ogc:def:crs:EPSG::4326": M,
|
|
783
|
-
"EPSG:2154": "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs"
|
|
784
|
-
};
|
|
785
|
-
for (const [e, t] of Object.entries(un))
|
|
786
|
-
b.defs(e) || b.defs(e, t);
|
|
787
|
-
const ln = /^urn:ogc:def:crs:EPSG::(\d+)$/i;
|
|
788
|
-
function rt(e) {
|
|
789
|
-
u.that(e, a.nonEmptyString, "name must be a non empty string");
|
|
790
|
-
const t = e.match(ln);
|
|
791
|
-
return t ? `EPSG:${t[1]}` : e;
|
|
792
|
-
}
|
|
793
|
-
function ar() {
|
|
794
|
-
return Object.keys(b.defs);
|
|
795
|
-
}
|
|
796
|
-
function sr(e, t) {
|
|
797
|
-
u.all([
|
|
798
|
-
{
|
|
799
|
-
value: e,
|
|
800
|
-
validator: a.nonEmptyString,
|
|
801
|
-
message: "name must be a non empty string"
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
value: t,
|
|
805
|
-
validator: (n) => a.nonEmptyString(n) || a.nonEmptyObject(n),
|
|
806
|
-
message: "definition must be a non empty string or a non empty object"
|
|
807
|
-
}
|
|
808
|
-
]), b.defs(e, t);
|
|
809
|
-
}
|
|
810
|
-
function F(e) {
|
|
811
|
-
return u.that(e, a.nonEmptyString, "name must be a non empty string"), a.defined(b.defs(e));
|
|
812
|
-
}
|
|
813
|
-
function or(e) {
|
|
814
|
-
return u.that(e, a.nonEmptyString, "name must be a non empty string"), b.defs(e);
|
|
815
|
-
}
|
|
816
|
-
function it(e) {
|
|
817
|
-
u.that(e, a.nonEmptyString, "name must be a non empty string");
|
|
818
|
-
const t = b.defs(e);
|
|
819
|
-
if (!t) return !1;
|
|
820
|
-
const n = b.defs("EPSG:4326");
|
|
821
|
-
return t.projName === n.projName && t.datumCode === n.datumCode;
|
|
822
|
-
}
|
|
823
|
-
const re = {
|
|
824
|
-
precision: N(a.number),
|
|
825
|
-
consider3D: N(a.boolean)
|
|
826
|
-
}, at = 63710088e-1;
|
|
827
|
-
function ur(e) {
|
|
828
|
-
u.that(e, (E) => a.nonEmptyString(E), "pattern must be a non-empty string");
|
|
829
|
-
const t = e.split(/[,;|]/);
|
|
830
|
-
if (t.length !== 2) return null;
|
|
831
|
-
const [n, r] = t.map(Jt);
|
|
832
|
-
if (!n || !r) return null;
|
|
833
|
-
const i = n.toDecimal(), s = r.toDecimal(), o = Pe(i.degrees, i.direction), c = Pe(s.degrees, s.direction), g = (E) => {
|
|
834
|
-
const { degrees: f, direction: I } = E;
|
|
835
|
-
return I && (ne(I) || ze(I)) ? -f : f;
|
|
836
|
-
};
|
|
837
|
-
return o === O.LONGITUDE && c === O.LATITUDE ? [g(i), g(s)] : c === O.LONGITUDE && o === O.LATITUDE ? [g(s), g(i)] : o === O.LONGITUDE && !c ? [g(i), g(s)] : o === O.LATITUDE && !c ? [g(s), g(i)] : c === O.LONGITUDE && !o ? [g(s), g(i)] : c === O.LATITUDE && !o ? [g(i), g(s)] : !o && !c ? [
|
|
838
|
-
[g(i), g(s)],
|
|
839
|
-
[g(s), g(i)]
|
|
840
|
-
] : null;
|
|
841
|
-
}
|
|
842
|
-
function S(e) {
|
|
843
|
-
return a.arrayOfLengthBetween(e, 2, 3) ? e.every(a.number) : !1;
|
|
844
|
-
}
|
|
845
|
-
function cn(e) {
|
|
846
|
-
return u.that(e, S, "position must be a valid position"), a.arrayOfLength(e, 3);
|
|
847
|
-
}
|
|
848
|
-
function pe(e, t, n = {}) {
|
|
849
|
-
u.all([
|
|
850
|
-
{
|
|
851
|
-
value: e,
|
|
852
|
-
validator: S,
|
|
853
|
-
message: "position1 must be a valid position"
|
|
854
|
-
},
|
|
855
|
-
{
|
|
856
|
-
value: t,
|
|
857
|
-
validator: S,
|
|
858
|
-
message: "position2 must be a valid position"
|
|
859
|
-
},
|
|
860
|
-
{
|
|
861
|
-
value: n,
|
|
862
|
-
validator: (o) => y.schema(o, re),
|
|
863
|
-
message: "options must be a valid options object"
|
|
864
|
-
}
|
|
865
|
-
]);
|
|
866
|
-
const { precision: r = v, consider3D: i = !1 } = n, s = i ? Math.max(e.length, t.length) : 2;
|
|
867
|
-
return Array.from(
|
|
868
|
-
{ length: s },
|
|
869
|
-
(o, c) => (e[c] ?? 0).toFixed(r) === (t[c] ?? 0).toFixed(r)
|
|
870
|
-
).every(Boolean);
|
|
871
|
-
}
|
|
872
|
-
function st(e, t = v) {
|
|
873
|
-
u.all([
|
|
874
|
-
{
|
|
875
|
-
value: e,
|
|
876
|
-
validator: S,
|
|
877
|
-
message: "position must be a position"
|
|
878
|
-
},
|
|
879
|
-
{
|
|
880
|
-
value: t,
|
|
881
|
-
validator: (n) => a.inRange(n, 0, R),
|
|
882
|
-
message: `precision must be in range [0, ${R}]`
|
|
883
|
-
}
|
|
884
|
-
]);
|
|
885
|
-
for (let n = 0; n < e.length; n++)
|
|
886
|
-
e[n] = Qe(e[n], t);
|
|
887
|
-
return e;
|
|
888
|
-
}
|
|
889
|
-
function ot(e, t, n) {
|
|
890
|
-
return u.all([
|
|
891
|
-
{
|
|
892
|
-
value: e,
|
|
893
|
-
validator: S,
|
|
894
|
-
message: "position must be a valid position"
|
|
895
|
-
},
|
|
896
|
-
{
|
|
897
|
-
value: t,
|
|
898
|
-
validator: F,
|
|
899
|
-
message: `unknown source projection: ${t}`
|
|
900
|
-
},
|
|
901
|
-
{
|
|
902
|
-
value: n,
|
|
903
|
-
validator: F,
|
|
904
|
-
message: `unknown target projection: ${n}`
|
|
905
|
-
}
|
|
906
|
-
]), b(t, n, e);
|
|
907
|
-
}
|
|
908
|
-
function lr(e, t, n) {
|
|
909
|
-
u.all([
|
|
910
|
-
{ value: e, validator: S, message: "position must be a valid position" },
|
|
911
|
-
{ value: t, validator: a.number, message: "bearing must be a number" },
|
|
912
|
-
{ value: n, validator: a.number, message: "distance must be a number" }
|
|
913
|
-
]);
|
|
914
|
-
const r = on(
|
|
915
|
-
U(e),
|
|
916
|
-
T.to.radians(t),
|
|
917
|
-
n / at
|
|
918
|
-
);
|
|
919
|
-
return tn(r);
|
|
920
|
-
}
|
|
921
|
-
function dn(e, t) {
|
|
922
|
-
return u.all([
|
|
923
|
-
{ value: e, validator: S, message: "position1 must be a valid position" },
|
|
924
|
-
{ value: t, validator: S, message: "position2 must be a valid position" }
|
|
925
|
-
]), rn(U(e), U(t)) * at;
|
|
926
|
-
}
|
|
927
|
-
function Z(e) {
|
|
928
|
-
if (!a.arrayOfLength(e, 4) && !a.arrayOfLength(e, 6)) return !1;
|
|
929
|
-
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]];
|
|
930
|
-
if (!S(n) || !S(r)) return !1;
|
|
931
|
-
const [, i] = n, [, s] = r;
|
|
932
|
-
return !(i > s || !t && e[2] > e[5]);
|
|
933
|
-
}
|
|
934
|
-
function Ve(e) {
|
|
935
|
-
return u.that(e, Z, "bbox must be a valid bounding-box"), a.arrayOfLength(e, 6);
|
|
936
|
-
}
|
|
937
|
-
function cr(e, t) {
|
|
938
|
-
return u.all([
|
|
939
|
-
{ value: e, validator: Z, message: "bbox1 must be a valid bounding-box" },
|
|
940
|
-
{ value: t, validator: Z, message: "bbox2 must be a valid bounding-box" }
|
|
941
|
-
]), Ve(e) && Ve(t) ? [
|
|
942
|
-
Math.min(e[0], t[0]),
|
|
943
|
-
Math.min(e[1], t[1]),
|
|
944
|
-
Math.min(e[2], t[2]),
|
|
945
|
-
Math.max(e[3], t[3]),
|
|
946
|
-
Math.max(e[4], t[4]),
|
|
947
|
-
Math.max(e[5], t[5])
|
|
948
|
-
] : [
|
|
949
|
-
Math.min(e[0], t[0]),
|
|
950
|
-
Math.min(e[1], t[1]),
|
|
951
|
-
Math.max(e[2], t[2]),
|
|
952
|
-
Math.max(e[3], t[3])
|
|
953
|
-
];
|
|
954
|
-
}
|
|
955
|
-
const fn = {
|
|
956
|
-
ignore3D: N(a.boolean)
|
|
957
|
-
};
|
|
958
|
-
function se(e, t = {}) {
|
|
959
|
-
u.all([
|
|
960
|
-
{
|
|
961
|
-
value: e,
|
|
962
|
-
validator: a.nonEmptyArray,
|
|
963
|
-
message: "positions must be a non-empty array"
|
|
964
|
-
},
|
|
965
|
-
{
|
|
966
|
-
value: e,
|
|
967
|
-
validator: (i) => i.every(S),
|
|
968
|
-
message: "positions must be an array of valid positions"
|
|
969
|
-
},
|
|
970
|
-
{
|
|
971
|
-
value: t,
|
|
972
|
-
validator: (i) => y.schema(i, fn),
|
|
973
|
-
message: "options must be a valid options object"
|
|
974
|
-
}
|
|
975
|
-
]);
|
|
976
|
-
const { ignore3D: n = !1 } = t;
|
|
977
|
-
return !n && e.some(cn) ? e.reduce((i, s) => [
|
|
978
|
-
Math.min(i[0], s[0]),
|
|
979
|
-
Math.min(i[1], s[1]),
|
|
980
|
-
Math.min(i[2], s[2] ?? 0),
|
|
981
|
-
Math.max(i[3], s[0]),
|
|
982
|
-
Math.max(i[4], s[1]),
|
|
983
|
-
Math.max(i[5], s[2] ?? 0)
|
|
984
|
-
], [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0]) : e.reduce((i, s) => [
|
|
985
|
-
Math.min(i[0], s[0]),
|
|
986
|
-
Math.min(i[1], s[1]),
|
|
987
|
-
Math.max(i[2], s[0]),
|
|
988
|
-
Math.max(i[3], s[1])
|
|
989
|
-
], [1 / 0, 1 / 0, -1 / 0, -1 / 0]);
|
|
990
|
-
}
|
|
991
|
-
function ut(e, t = v) {
|
|
992
|
-
u.all([
|
|
993
|
-
{
|
|
994
|
-
value: e,
|
|
995
|
-
validator: Z,
|
|
996
|
-
message: "bbox must be a valid bounding box"
|
|
997
|
-
},
|
|
998
|
-
{
|
|
999
|
-
value: t,
|
|
1000
|
-
validator: (n) => a.inRange(n, 0, R),
|
|
1001
|
-
message: `precision must be in range [0, ${R}]`
|
|
1002
|
-
}
|
|
1003
|
-
]);
|
|
1004
|
-
for (let n = 0; n < e.length; n++)
|
|
1005
|
-
e[n] = Qe(e[n], t);
|
|
1006
|
-
return e;
|
|
1007
|
-
}
|
|
1008
|
-
const mn = {
|
|
1009
|
-
...re,
|
|
1010
|
-
deduplicate: N(a.boolean)
|
|
1011
|
-
};
|
|
1012
|
-
function ve(e) {
|
|
1013
|
-
return a.array(e) && e.every(S);
|
|
1014
|
-
}
|
|
1015
|
-
function lt(e, t = {}) {
|
|
1016
|
-
u.that(t, (s) => y.schema(s, re), "options must be a valid options object");
|
|
1017
|
-
const { precision: n = v, consider3D: r = !1 } = t, i = [];
|
|
1018
|
-
for (const s of e) {
|
|
1019
|
-
const o = i[i.length - 1];
|
|
1020
|
-
(!o || !pe(s, o, { precision: n, consider3D: r })) && i.push(s);
|
|
1021
|
-
}
|
|
1022
|
-
return i;
|
|
1023
|
-
}
|
|
1024
|
-
function me(e, t = {}) {
|
|
1025
|
-
u.all([
|
|
1026
|
-
{
|
|
1027
|
-
value: e,
|
|
1028
|
-
validator: a.array,
|
|
1029
|
-
message: "positions must be an array"
|
|
1030
|
-
},
|
|
1031
|
-
{
|
|
1032
|
-
value: t,
|
|
1033
|
-
validator: (o) => y.schema(o, mn),
|
|
1034
|
-
message: "options must be a valid options object"
|
|
1035
|
-
}
|
|
1036
|
-
]);
|
|
1037
|
-
const { precision: n = v, deduplicate: r = !1, consider3D: i = !1 } = t, s = e.map((o) => st(o, n));
|
|
1038
|
-
return r ? lt(s, { precision: n, consider3D: i }) : s;
|
|
1039
|
-
}
|
|
1040
|
-
function oe(e, t, n) {
|
|
1041
|
-
return u.that(e, a.array, "positions must be an array"), e.map((r) => ot(r, t, n));
|
|
1042
|
-
}
|
|
1043
|
-
function dr(e) {
|
|
1044
|
-
return a.arrayOfLengthAtLeast(e, 2) && ve(e);
|
|
1045
|
-
}
|
|
1046
|
-
function fr(e) {
|
|
1047
|
-
u.that(e, ve, "line must be a valid array of positions");
|
|
1048
|
-
let t = 0;
|
|
1049
|
-
for (let n = 0; n < e.length - 1; n++)
|
|
1050
|
-
t += dn(e[n], e[n + 1]);
|
|
1051
|
-
return t;
|
|
1052
|
-
}
|
|
1053
|
-
function Q(e, t = {}) {
|
|
1054
|
-
return !a.arrayOfLengthAtLeast(e, 4) || !ve(e) ? !1 : Le(e, t);
|
|
1055
|
-
}
|
|
1056
|
-
function Le(e, t = {}) {
|
|
1057
|
-
if (u.that(t, (i) => y.schema(i, re), "options must be a valid options object"), !a.arrayOfLengthAtLeast(e, 1)) return !1;
|
|
1058
|
-
const n = e[0], r = e[e.length - 1];
|
|
1059
|
-
return pe(n, r, t);
|
|
1060
|
-
}
|
|
1061
|
-
function gn(e, t = {}) {
|
|
1062
|
-
return !a.nonEmptyArray(e) || Le(e, t) ? e : [...e, [...e[0]]];
|
|
1063
|
-
}
|
|
1064
|
-
function we(e, t = {}) {
|
|
1065
|
-
const n = me(e, { deduplicate: !0, ...t });
|
|
1066
|
-
return gn(n, t);
|
|
1067
|
-
}
|
|
1068
|
-
function In(e) {
|
|
1069
|
-
u.that(e, Q, "ring must be a valid closed ring of at least 4 positions");
|
|
1070
|
-
let t = 0;
|
|
1071
|
-
for (let n = 0; n < e.length - 1; n++) {
|
|
1072
|
-
const [r, i] = e[n], [s, o] = e[n + 1];
|
|
1073
|
-
t += T.to.radians(s - r) * (2 + Math.sin(T.to.radians(i)) + Math.sin(T.to.radians(o)));
|
|
1074
|
-
}
|
|
1075
|
-
return -t / 2;
|
|
1076
|
-
}
|
|
1077
|
-
function ct(e) {
|
|
1078
|
-
return In(e) < 0;
|
|
1079
|
-
}
|
|
1080
|
-
function dt(e, t) {
|
|
1081
|
-
u.all([
|
|
1082
|
-
{ value: e, validator: Q, message: "ring1 must be a valid closed ring" },
|
|
1083
|
-
{ value: t, validator: Q, message: "ring2 must be a valid closed ring" }
|
|
1084
|
-
]);
|
|
1085
|
-
const n = e.map(U), r = t.map(U);
|
|
1086
|
-
for (let i = 0; i < n.length - 1; i++)
|
|
1087
|
-
for (let s = 0; s < r.length - 1; s++)
|
|
1088
|
-
if (tt(n[i], n[i + 1], r[s], r[s + 1]))
|
|
1089
|
-
return !0;
|
|
1090
|
-
return !1;
|
|
1091
|
-
}
|
|
1092
|
-
function ft(e) {
|
|
1093
|
-
u.that(e, Q, "ring must be a valid closed ring");
|
|
1094
|
-
const t = e.map(U), n = [], r = t.length - 1;
|
|
1095
|
-
for (let i = 0; i < r; i++)
|
|
1096
|
-
for (let s = i + 1; s < r; s++)
|
|
1097
|
-
s !== i + 1 && (i === 0 && s === r - 1 || tt(t[i], t[i + 1], t[s], t[s + 1]) && n.push([i, s]));
|
|
1098
|
-
return n;
|
|
1099
|
-
}
|
|
1100
|
-
const J = {
|
|
1101
|
-
NAME: "name",
|
|
1102
|
-
LINK: "link"
|
|
1103
|
-
}, m = {
|
|
1104
|
-
POINT: "Point",
|
|
1105
|
-
MULTI_POINT: "MultiPoint",
|
|
1106
|
-
LINESTRING: "LineString",
|
|
1107
|
-
MULTI_LINESTRING: "MultiLineString",
|
|
1108
|
-
POLYGON: "Polygon",
|
|
1109
|
-
MULTI_POLYGON: "MultiPolygon",
|
|
1110
|
-
GEOMETRY_COLLECTION: "GeometryCollection"
|
|
1111
|
-
}, p = {
|
|
1112
|
-
FEATURE: "Feature",
|
|
1113
|
-
FEATURE_COLLECTION: "FeatureCollection"
|
|
1114
|
-
};
|
|
1115
|
-
function mr(e) {
|
|
1116
|
-
return a.plainObject(e) ? e.type === J.NAME ? a.nonEmptyString(e.properties?.name) : e.type === J.LINK ? a.nonEmptyString(e.properties?.href) : !1 : !1;
|
|
1117
|
-
}
|
|
1118
|
-
function gr(e) {
|
|
1119
|
-
return S(e);
|
|
1120
|
-
}
|
|
1121
|
-
function Ir(e) {
|
|
1122
|
-
return !a.arrayOfLength(e, 4) && !a.arrayOfLength(e, 6) ? !1 : e.every(a.number);
|
|
1123
|
-
}
|
|
1124
|
-
function En(e) {
|
|
1125
|
-
return !a.plainObject(e) || !a.oneOf(e.type, Object.values(m)) ? !1 : e.type === m.GEOMETRY_COLLECTION ? a.array(e.geometries) : a.array(e.coordinates);
|
|
1126
|
-
}
|
|
1127
|
-
function On(e) {
|
|
1128
|
-
return a.plainObject(e) && e.type === p.FEATURE;
|
|
1129
|
-
}
|
|
1130
|
-
function Nn(e) {
|
|
1131
|
-
return a.plainObject(e) && e.type === p.FEATURE_COLLECTION && a.array(e.features);
|
|
1132
|
-
}
|
|
1133
|
-
function pn(e) {
|
|
1134
|
-
return On(e) || Nn(e);
|
|
1135
|
-
}
|
|
1136
|
-
function G(e) {
|
|
1137
|
-
return pn(e) || En(e);
|
|
1138
|
-
}
|
|
1139
|
-
const vn = {
|
|
1140
|
-
ignore3D: N(a.boolean)
|
|
1141
|
-
};
|
|
1142
|
-
function Er(e, t = {}) {
|
|
1143
|
-
if (u.all([
|
|
1144
|
-
{ value: e, validator: G, message: "geoJson must be a GeoJson object" },
|
|
1145
|
-
{ value: t, validator: (n) => y.schema(n, vn), message: "options must be a valid options object" }
|
|
1146
|
-
]), e.type === p.FEATURE)
|
|
1147
|
-
return e.geometry ? se(W(e.geometry), t) : null;
|
|
1148
|
-
if (e.type === p.FEATURE_COLLECTION) {
|
|
1149
|
-
const n = W(e);
|
|
1150
|
-
return n.length ? se(n, t) : null;
|
|
1151
|
-
}
|
|
1152
|
-
return se(W(e), t);
|
|
1153
|
-
}
|
|
1154
|
-
function Ln(e) {
|
|
1155
|
-
if (e.length === 0) return null;
|
|
1156
|
-
if (e.length === 1) return { type: "Point", coordinates: e[0] };
|
|
1157
|
-
if (e.length === 2) return { type: "LineString", coordinates: [e[0], e[1]] };
|
|
1158
|
-
const t = _t(ht(e.map((n) => bt({ type: "Point", coordinates: n }))));
|
|
1159
|
-
return t ? t.geometry : { type: "LineString", coordinates: [e[0], e[e.length - 1]] };
|
|
1160
|
-
}
|
|
1161
|
-
function Tn(e) {
|
|
1162
|
-
if (u.that(e, G, "geoJson must be a GeoJson object"), e.type === p.FEATURE)
|
|
1163
|
-
return e.geometry ? Tn(e.geometry) : null;
|
|
1164
|
-
const t = W(e).map((n) => [n[0], n[1]]);
|
|
1165
|
-
return Ln(t);
|
|
1166
|
-
}
|
|
1167
|
-
function mt(e, t) {
|
|
1168
|
-
return _.that(e, G, "geoJson must be a GeoJson object"), St.lookup(e, t);
|
|
1169
|
-
}
|
|
1170
|
-
function Or(e) {
|
|
1171
|
-
return mt(e, "bbox");
|
|
1172
|
-
}
|
|
1173
|
-
function Sn(e) {
|
|
1174
|
-
const t = mt(e, "crs");
|
|
1175
|
-
if (!l.defined(t)) return nt;
|
|
1176
|
-
const n = t.properties?.name;
|
|
1177
|
-
return l.nonEmptyString(n) ? rt(n) : n;
|
|
1178
|
-
}
|
|
1179
|
-
const d = Object.freeze(
|
|
1180
|
-
Object.fromEntries(
|
|
1181
|
-
Object.keys(We.VALIDATION).map((e) => [e, e])
|
|
1182
|
-
)
|
|
1183
|
-
), _n = [m.POLYGON, m.MULTI_POLYGON], hn = [
|
|
1184
|
-
m.LINESTRING,
|
|
1185
|
-
m.MULTI_LINESTRING,
|
|
1186
|
-
m.POLYGON,
|
|
1187
|
-
m.MULTI_POLYGON
|
|
1188
|
-
], ge = [
|
|
1189
|
-
d.INVALID_WINDING_ORDER,
|
|
1190
|
-
d.SELF_INTERSECTION,
|
|
1191
|
-
d.HOLE_INTERSECTS_SHELL,
|
|
1192
|
-
d.DUPLICATE_POSITION
|
|
1193
|
-
], bn = {
|
|
1194
|
-
validation: l.nonEmptyObject,
|
|
1195
|
-
windingOrder: h(l.boolean),
|
|
1196
|
-
selfIntersection: h(l.boolean),
|
|
1197
|
-
holeIntersectsShell: h(l.boolean),
|
|
1198
|
-
duplicatePosition: h(l.boolean),
|
|
1199
|
-
// Coordinate precision (decimal places) used to decide when two positions are
|
|
1200
|
-
// the same during deduplication -- the same notion validate uses, so fix and
|
|
1201
|
-
// validate stay in lockstep on duplicates.
|
|
1202
|
-
precision: h(l.number)
|
|
1203
|
-
};
|
|
1204
|
-
function je(e, t) {
|
|
1205
|
-
return ct(e) !== t ? (e.reverse(), !0) : !1;
|
|
1206
|
-
}
|
|
1207
|
-
function xe(e) {
|
|
1208
|
-
let t = !1;
|
|
1209
|
-
je(e[0], !1) && (t = !0);
|
|
1210
|
-
for (let n = 1; n < e.length; n++)
|
|
1211
|
-
je(e[n], !0) && (t = !0);
|
|
1212
|
-
return t;
|
|
1213
|
-
}
|
|
1214
|
-
function Rn(e) {
|
|
1215
|
-
if (e.type === m.POLYGON)
|
|
1216
|
-
return xe(e.coordinates);
|
|
1217
|
-
let t = !1;
|
|
1218
|
-
for (const n of e.coordinates)
|
|
1219
|
-
xe(n) && (t = !0);
|
|
1220
|
-
return t;
|
|
1221
|
-
}
|
|
1222
|
-
function Dn(e) {
|
|
1223
|
-
return e.type === m.POLYGON ? e.coordinates : e.coordinates.flat(1);
|
|
1224
|
-
}
|
|
1225
|
-
function An(e) {
|
|
1226
|
-
return e.type === m.POLYGON ? [e.coordinates] : e.coordinates;
|
|
1227
|
-
}
|
|
1228
|
-
function ke(e) {
|
|
1229
|
-
return Dn(e).some((t) => ft(t).length > 0);
|
|
1230
|
-
}
|
|
1231
|
-
function Fe(e) {
|
|
1232
|
-
return An(e).some((t) => {
|
|
1233
|
-
const n = t[0];
|
|
1234
|
-
for (let r = 1; r < t.length; r++)
|
|
1235
|
-
if (dt(n, t[r])) return !0;
|
|
1236
|
-
return !1;
|
|
1237
|
-
});
|
|
1238
|
-
}
|
|
1239
|
-
function yn(e) {
|
|
1240
|
-
const n = Rt({ type: "Feature", properties: {}, geometry: e }, 0);
|
|
1241
|
-
return n ? { type: n.geometry.type, coordinates: n.geometry.coordinates } : null;
|
|
1242
|
-
}
|
|
1243
|
-
function Cn(e, t) {
|
|
1244
|
-
let n = !1;
|
|
1245
|
-
const r = (i) => {
|
|
1246
|
-
const s = i.length, o = lt(i, { precision: t });
|
|
1247
|
-
return o.length !== s && (n = !0), o;
|
|
1248
|
-
};
|
|
1249
|
-
switch (e.type) {
|
|
1250
|
-
case m.LINESTRING:
|
|
1251
|
-
e.coordinates = r(e.coordinates);
|
|
1252
|
-
break;
|
|
1253
|
-
case m.MULTI_LINESTRING:
|
|
1254
|
-
e.coordinates = e.coordinates.map(r);
|
|
1255
|
-
break;
|
|
1256
|
-
case m.POLYGON:
|
|
1257
|
-
e.coordinates = e.coordinates.map(r);
|
|
1258
|
-
break;
|
|
1259
|
-
case m.MULTI_POLYGON:
|
|
1260
|
-
e.coordinates = e.coordinates.map((i) => i.map(r));
|
|
1261
|
-
break;
|
|
1262
|
-
}
|
|
1263
|
-
return n;
|
|
1264
|
-
}
|
|
1265
|
-
function Gn(e, t) {
|
|
1266
|
-
const n = t.selfIntersection, r = t.holeIntersectsShell;
|
|
1267
|
-
if (!n && !r) return [];
|
|
1268
|
-
const i = n && ke(e), s = r && Fe(e), o = [];
|
|
1269
|
-
if (n && !i && o.push(d.SELF_INTERSECTION), r && !s && o.push(d.HOLE_INTERSECTS_SHELL), !i && !s) return o;
|
|
1270
|
-
const c = yn(e);
|
|
1271
|
-
return !c || i && ke(c) || s && Fe(c) || (e.type = c.type, e.coordinates = c.coordinates, i && o.push(d.SELF_INTERSECTION), s && o.push(d.HOLE_INTERSECTS_SHELL)), o;
|
|
1272
|
-
}
|
|
1273
|
-
function Mn(e, t) {
|
|
1274
|
-
const n = [], r = t.precision ?? v;
|
|
1275
|
-
if (t.duplicatePosition && hn.includes(e.type) && Cn(e, r) && n.push({ code: d.DUPLICATE_POSITION }), !_n.includes(e.type))
|
|
1276
|
-
return { fixed: e, corrections: n };
|
|
1277
|
-
t.windingOrder && Rn(e) && n.push({ code: d.INVALID_WINDING_ORDER });
|
|
1278
|
-
for (const i of Gn(e, t))
|
|
1279
|
-
n.push({ code: i });
|
|
1280
|
-
return { fixed: e, corrections: n };
|
|
1281
|
-
}
|
|
1282
|
-
function ue(e, t) {
|
|
1283
|
-
return e.filter((n) => n.path === t || n.path?.startsWith(`${t}/`));
|
|
1284
|
-
}
|
|
1285
|
-
function le(e, t, n, r) {
|
|
1286
|
-
const i = {
|
|
1287
|
-
windingOrder: r.windingOrder !== !1 && t.some((E) => E.code === d.INVALID_WINDING_ORDER),
|
|
1288
|
-
selfIntersection: r.selfIntersection !== !1 && t.some((E) => E.code === d.SELF_INTERSECTION),
|
|
1289
|
-
holeIntersectsShell: r.holeIntersectsShell !== !1 && t.some((E) => E.code === d.HOLE_INTERSECTS_SHELL),
|
|
1290
|
-
duplicatePosition: r.duplicatePosition !== !1 && t.some((E) => E.code === d.DUPLICATE_POSITION),
|
|
1291
|
-
precision: r.precision
|
|
1292
|
-
}, s = i.windingOrder || i.selfIntersection || i.holeIntersectsShell || i.duplicatePosition ? Mn(e, i) : { corrections: [] }, o = new Set(s.corrections.map((E) => E.code)), c = s.corrections.map((E) => ({ ...E, path: n })), g = t.filter((E) => !o.has(E.code));
|
|
1293
|
-
return { corrections: c, unfixed: g };
|
|
1294
|
-
}
|
|
1295
|
-
function Nr(e, t) {
|
|
1296
|
-
_.all([
|
|
1297
|
-
{ value: e, validator: G, message: "geoJson must be a GeoJson object" },
|
|
1298
|
-
{ value: t, validator: (c) => V.schema(c, bn), message: "options must be a valid options object, with a mandatory validation result" }
|
|
1299
|
-
]);
|
|
1300
|
-
const n = [...t.validation.errors, ...t.validation.warnings], r = n.filter((c) => ge.includes(c.code)), i = n.filter((c) => !ge.includes(c.code));
|
|
1301
|
-
if (r.length === 0) return { fixed: e, corrections: [], unfixed: i };
|
|
1302
|
-
if (e.type === p.FEATURE_COLLECTION) {
|
|
1303
|
-
const c = [];
|
|
1304
|
-
return e.features.forEach((g, E) => {
|
|
1305
|
-
const f = `/features/${E}/geometry`, I = ue(r, f);
|
|
1306
|
-
if (I.length === 0) return;
|
|
1307
|
-
const D = le(g.geometry, I, f, t);
|
|
1308
|
-
c.push(...D.corrections), i.push(...D.unfixed);
|
|
1309
|
-
}), { fixed: e, corrections: c, unfixed: i };
|
|
1310
|
-
}
|
|
1311
|
-
if (e.type === p.FEATURE) {
|
|
1312
|
-
const c = ue(r, "/geometry"), g = le(e.geometry, c, "/geometry", t);
|
|
1313
|
-
return { fixed: e, corrections: g.corrections, unfixed: [...i, ...g.unfixed] };
|
|
1314
|
-
}
|
|
1315
|
-
const s = ue(r, ""), o = le(e, s, "", t);
|
|
1316
|
-
return { fixed: e, corrections: o.corrections, unfixed: [...i, ...o.unfixed] };
|
|
1317
|
-
}
|
|
1318
|
-
function pr(e) {
|
|
1319
|
-
return _.all([
|
|
1320
|
-
{
|
|
1321
|
-
value: e,
|
|
1322
|
-
validator: l.nonEmptyObject,
|
|
1323
|
-
message: "validation must be a non-empty object"
|
|
1324
|
-
},
|
|
1325
|
-
{
|
|
1326
|
-
value: e?.errors,
|
|
1327
|
-
validator: l.array,
|
|
1328
|
-
message: "validation.errors must be an array"
|
|
1329
|
-
}
|
|
1330
|
-
]), e.errors.length === 0 ? !1 : e.errors.every(
|
|
1331
|
-
(t) => ge.includes(t.code)
|
|
1332
|
-
);
|
|
1333
|
-
}
|
|
1334
|
-
function Pn(e) {
|
|
1335
|
-
const t = e.match(/^EPSG:(\d+)$/i);
|
|
1336
|
-
return t ? `urn:ogc:def:crs:EPSG::${t[1]}` : e;
|
|
1337
|
-
}
|
|
1338
|
-
function Te(e, t, n) {
|
|
1339
|
-
switch (e.type) {
|
|
1340
|
-
case m.POINT:
|
|
1341
|
-
e.coordinates = ot(e.coordinates, t, n);
|
|
1342
|
-
break;
|
|
1343
|
-
case m.MULTI_POINT:
|
|
1344
|
-
case m.LINESTRING:
|
|
1345
|
-
e.coordinates = oe(e.coordinates, t, n);
|
|
1346
|
-
break;
|
|
1347
|
-
case m.MULTI_LINESTRING:
|
|
1348
|
-
case m.POLYGON:
|
|
1349
|
-
e.coordinates = e.coordinates.map(
|
|
1350
|
-
(r) => oe(r, t, n)
|
|
1351
|
-
);
|
|
1352
|
-
break;
|
|
1353
|
-
case m.MULTI_POLYGON:
|
|
1354
|
-
e.coordinates = e.coordinates.map(
|
|
1355
|
-
(r) => r.map(
|
|
1356
|
-
(i) => oe(i, t, n)
|
|
1357
|
-
)
|
|
1358
|
-
);
|
|
1359
|
-
break;
|
|
1360
|
-
case m.GEOMETRY_COLLECTION:
|
|
1361
|
-
for (const r of e.geometries)
|
|
1362
|
-
Te(r, t, n);
|
|
1363
|
-
break;
|
|
1364
|
-
}
|
|
1365
|
-
return delete e.bbox, delete e.crs, e;
|
|
1366
|
-
}
|
|
1367
|
-
function gt(e, t, n) {
|
|
1368
|
-
if (e.type === p.FEATURE)
|
|
1369
|
-
e.geometry && Te(e.geometry, t, n);
|
|
1370
|
-
else
|
|
1371
|
-
for (const r of e.features)
|
|
1372
|
-
gt(r, t, n);
|
|
1373
|
-
return delete e.bbox, delete e.crs, e;
|
|
1374
|
-
}
|
|
1375
|
-
function vr(e, t) {
|
|
1376
|
-
u.that(e, G, "geoJson must be a GeoJson object");
|
|
1377
|
-
const n = Sn(e);
|
|
1378
|
-
return u.all([
|
|
1379
|
-
{ value: n, validator: F, message: `unknown source projection: ${n}` },
|
|
1380
|
-
{ value: t, validator: F, message: `unknown target projection: ${t}` }
|
|
1381
|
-
]), a.oneOf(e.type, Object.values(m)) ? Te(e, n, t) : gt(e, n, t), it(t) ? delete e.crs : e.crs = {
|
|
1382
|
-
type: "name",
|
|
1383
|
-
properties: { name: Pn(t) }
|
|
1384
|
-
}, e;
|
|
1385
|
-
}
|
|
1386
|
-
const Un = {
|
|
1387
|
-
tolerance: h(l.number),
|
|
1388
|
-
getWeight: h(l.function)
|
|
1389
|
-
};
|
|
1390
|
-
function Vn(e, t, n) {
|
|
1391
|
-
return Math.abs(
|
|
1392
|
-
(e[0] * (t[1] - n[1]) + t[0] * (n[1] - e[1]) + n[0] * (e[1] - t[1])) / 2
|
|
1393
|
-
);
|
|
1394
|
-
}
|
|
1395
|
-
function ce(e, { tolerance: t = 0, getWeight: n = () => 1 } = {}) {
|
|
1396
|
-
if (e.length <= 2) return e;
|
|
1397
|
-
const r = e.map((f, I) => ({ coord: f, i: I, area: 1 / 0, removed: !1, prev: null, next: null }));
|
|
1398
|
-
for (let f = 0; f < r.length; f++)
|
|
1399
|
-
f > 0 && (r[f].prev = r[f - 1]), f < r.length - 1 && (r[f].next = r[f + 1]);
|
|
1400
|
-
const i = (f) => !f.prev || !f.next ? 1 / 0 : Vn(f.prev.coord, f.coord, f.next.coord) * n(f.coord, f.i), s = new Dt((f, I) => f.area - I.area), o = (f) => {
|
|
1401
|
-
f.area = i(f), s.push({ node: f, area: f.area });
|
|
1402
|
-
};
|
|
1403
|
-
for (let f = 1; f < r.length - 1; f++) o(r[f]);
|
|
1404
|
-
let c = 0;
|
|
1405
|
-
for (; s.size() > 0; ) {
|
|
1406
|
-
const f = s.pop(), I = f.node;
|
|
1407
|
-
if (!I.removed && f.area === I.area) {
|
|
1408
|
-
if (I.area < c ? I.area = c : c = I.area, I.area >= t) break;
|
|
1409
|
-
I.removed = !0, I.prev && (I.prev.next = I.next), I.next && (I.next.prev = I.prev), I.prev?.prev && o(I.prev), I.next?.next && o(I.next);
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
const g = [];
|
|
1413
|
-
let E = r[0];
|
|
1414
|
-
for (; E; )
|
|
1415
|
-
E.removed || g.push(E.coord), E = E.next;
|
|
1416
|
-
return g;
|
|
1417
|
-
}
|
|
1418
|
-
function de(e, t = {}) {
|
|
1419
|
-
if (_.all([
|
|
1420
|
-
{ value: e, validator: G, message: "geoJson must be a GeoJson object" },
|
|
1421
|
-
{ value: t, validator: (n) => V.schema(n, Un), message: "options must be a valid options object" }
|
|
1422
|
-
]), e.type === p.FEATURE)
|
|
1423
|
-
return e.geometry && de(e.geometry, t), e;
|
|
1424
|
-
if (e.type === p.FEATURE_COLLECTION) {
|
|
1425
|
-
for (const n of e.features) de(n, t);
|
|
1426
|
-
return e;
|
|
1427
|
-
}
|
|
1428
|
-
switch (e.type) {
|
|
1429
|
-
case m.LINESTRING:
|
|
1430
|
-
e.coordinates = ce(e.coordinates, t);
|
|
1431
|
-
break;
|
|
1432
|
-
case m.POLYGON:
|
|
1433
|
-
case m.MULTI_LINESTRING:
|
|
1434
|
-
e.coordinates = e.coordinates.map((n) => ce(n, t));
|
|
1435
|
-
break;
|
|
1436
|
-
case m.MULTI_POLYGON:
|
|
1437
|
-
e.coordinates = e.coordinates.map((n) => n.map((r) => ce(r, t)));
|
|
1438
|
-
break;
|
|
1439
|
-
case m.GEOMETRY_COLLECTION:
|
|
1440
|
-
e.geometries.forEach((n) => de(n, t));
|
|
1441
|
-
break;
|
|
1442
|
-
}
|
|
1443
|
-
return e;
|
|
1444
|
-
}
|
|
1445
|
-
function Se(e, t, n) {
|
|
1446
|
-
switch (e.type) {
|
|
1447
|
-
case m.POINT:
|
|
1448
|
-
st(e.coordinates, t);
|
|
1449
|
-
break;
|
|
1450
|
-
case m.MULTI_POINT:
|
|
1451
|
-
case m.LINESTRING:
|
|
1452
|
-
me(e.coordinates, { precision: t });
|
|
1453
|
-
break;
|
|
1454
|
-
case m.MULTI_LINESTRING:
|
|
1455
|
-
for (const r of e.coordinates) me(r, { precision: t });
|
|
1456
|
-
break;
|
|
1457
|
-
case m.POLYGON:
|
|
1458
|
-
e.coordinates = e.coordinates.map((r) => we(r, { precision: t, consider3D: n }));
|
|
1459
|
-
break;
|
|
1460
|
-
case m.MULTI_POLYGON:
|
|
1461
|
-
e.coordinates = e.coordinates.map(
|
|
1462
|
-
(r) => r.map((i) => we(i, { precision: t, consider3D: n }))
|
|
1463
|
-
);
|
|
1464
|
-
break;
|
|
1465
|
-
case m.GEOMETRY_COLLECTION:
|
|
1466
|
-
for (const r of e.geometries) Se(r, t, n);
|
|
1467
|
-
break;
|
|
1468
|
-
}
|
|
1469
|
-
return e.bbox && ut(e.bbox, t), e;
|
|
1470
|
-
}
|
|
1471
|
-
function It(e, t, n) {
|
|
1472
|
-
if (e.type === p.FEATURE)
|
|
1473
|
-
e.geometry && Se(e.geometry, t, n);
|
|
1474
|
-
else
|
|
1475
|
-
for (const r of e.features) It(r, t, n);
|
|
1476
|
-
return e.bbox && ut(e.bbox, t), e;
|
|
1477
|
-
}
|
|
1478
|
-
function Lr(e, t = {}) {
|
|
1479
|
-
const { precision: n = v, consider3D: r = !1 } = t;
|
|
1480
|
-
return u.all([
|
|
1481
|
-
{
|
|
1482
|
-
value: e,
|
|
1483
|
-
validator: G,
|
|
1484
|
-
message: "geoJson must be a valid GeoJson"
|
|
1485
|
-
},
|
|
1486
|
-
{
|
|
1487
|
-
value: n,
|
|
1488
|
-
validator: (i) => a.inRange(i, 0, R),
|
|
1489
|
-
message: `precision must be in range [0, ${R}]`
|
|
1490
|
-
}
|
|
1491
|
-
]), a.oneOf(e.type, Object.values(m)) ? Se(e, n, r) : It(e, n, r);
|
|
1492
|
-
}
|
|
1493
|
-
const $e = "/crs";
|
|
1494
|
-
function Et(e, t = "", n = {}) {
|
|
1495
|
-
if (!l.defined(e))
|
|
1496
|
-
return t === $e ? (n.geodesic = !0, { crs: nt, valid: !0 }) : { valid: !0 };
|
|
1497
|
-
if (t !== $e)
|
|
1498
|
-
return {
|
|
1499
|
-
valid: !1,
|
|
1500
|
-
errors: [{ code: d.UNSUPPORTED_NESTED_CRS, path: t }],
|
|
1501
|
-
warnings: []
|
|
1502
|
-
};
|
|
1503
|
-
if (!l.plainObject(e))
|
|
1504
|
-
return {
|
|
1505
|
-
valid: !1,
|
|
1506
|
-
errors: [{ code: d.INVALID_CRS_OBJECT, path: t }],
|
|
1507
|
-
warnings: []
|
|
1508
|
-
};
|
|
1509
|
-
switch (e.type) {
|
|
1510
|
-
case J.NAME: {
|
|
1511
|
-
if (!l.nonEmptyString(e.properties?.name))
|
|
1512
|
-
return {
|
|
1513
|
-
valid: !1,
|
|
1514
|
-
errors: [{ code: d.INVALID_CRS_NAME, path: t }],
|
|
1515
|
-
warnings: []
|
|
1516
|
-
};
|
|
1517
|
-
const r = rt(e.properties.name);
|
|
1518
|
-
return F(r) ? (n.geodesic = it(r), {
|
|
1519
|
-
crs: r,
|
|
1520
|
-
valid: !0,
|
|
1521
|
-
errors: [],
|
|
1522
|
-
warnings: []
|
|
1523
|
-
}) : {
|
|
1524
|
-
valid: !1,
|
|
1525
|
-
errors: [{
|
|
1526
|
-
code: d.UNSUPPORTED_CRS,
|
|
1527
|
-
path: t,
|
|
1528
|
-
params: { name: e.properties.name }
|
|
1529
|
-
}],
|
|
1530
|
-
warnings: []
|
|
1531
|
-
};
|
|
1532
|
-
}
|
|
1533
|
-
case J.LINK:
|
|
1534
|
-
return l.nonEmptyString(e.properties?.href) ? {
|
|
1535
|
-
valid: !1,
|
|
1536
|
-
errors: [{ code: d.UNSUPPORTED_LINK_CRS, path: t }],
|
|
1537
|
-
warnings: []
|
|
1538
|
-
} : {
|
|
1539
|
-
valid: !1,
|
|
1540
|
-
errors: [{ code: d.INVALID_CRS_LINK, path: t }],
|
|
1541
|
-
warnings: []
|
|
1542
|
-
};
|
|
1543
|
-
default:
|
|
1544
|
-
return {
|
|
1545
|
-
valid: !1,
|
|
1546
|
-
errors: [{
|
|
1547
|
-
code: d.INVALID_CRS_TYPE,
|
|
1548
|
-
path: t,
|
|
1549
|
-
params: { type: e.type }
|
|
1550
|
-
}],
|
|
1551
|
-
warnings: []
|
|
1552
|
-
};
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
|
-
function ee(e, t = "", n = {}) {
|
|
1556
|
-
const r = n.geodesic;
|
|
1557
|
-
if (!l.arrayOfLengthBetween(e, 2, 3))
|
|
1558
|
-
return {
|
|
1559
|
-
valid: !1,
|
|
1560
|
-
errors: [{ code: d.INVALID_POSITION_LENGTH, path: t }],
|
|
1561
|
-
warnings: []
|
|
1562
|
-
};
|
|
1563
|
-
if (!l.number(e[0]) || !l.number(e[1]))
|
|
1564
|
-
return {
|
|
1565
|
-
valid: !1,
|
|
1566
|
-
errors: [{ code: d.INVALID_POSITION_COORDINATES, path: t }],
|
|
1567
|
-
warnings: []
|
|
1568
|
-
};
|
|
1569
|
-
if (r) {
|
|
1570
|
-
if (!l.inRange(e[0], -180, 180))
|
|
1571
|
-
return {
|
|
1572
|
-
valid: !1,
|
|
1573
|
-
errors: [{ code: d.INVALID_LONGITUDE_RANGE, path: t, params: { value: e[0] } }],
|
|
1574
|
-
warnings: []
|
|
1575
|
-
};
|
|
1576
|
-
if (!l.inRange(e[1], -90, 90))
|
|
1577
|
-
return {
|
|
1578
|
-
valid: !1,
|
|
1579
|
-
errors: [{ code: d.INVALID_LATITUDE_RANGE, path: t, params: { value: e[1] } }],
|
|
1580
|
-
warnings: []
|
|
1581
|
-
};
|
|
1582
|
-
}
|
|
1583
|
-
if (e.length === 3 && !l.number(e[2]))
|
|
1584
|
-
return {
|
|
1585
|
-
valid: !1,
|
|
1586
|
-
errors: [{ code: d.INVALID_ALTITUDE, path: t }],
|
|
1587
|
-
warnings: []
|
|
1588
|
-
};
|
|
1589
|
-
const i = { valid: !0, errors: [], warnings: [] };
|
|
1590
|
-
if (r) {
|
|
1591
|
-
const s = n.precision ?? v, o = Ue(e[0]);
|
|
1592
|
-
o > s && i.warnings.push({ code: d.EXCESSIVE_LONGITUDE_PRECISION, path: t, params: { precision: o, max: s } });
|
|
1593
|
-
const c = Ue(e[1]);
|
|
1594
|
-
c > s && i.warnings.push({ code: d.EXCESSIVE_LATITUDE_PRECISION, path: t, params: { precision: c, max: s } });
|
|
1595
|
-
}
|
|
1596
|
-
return i;
|
|
1597
|
-
}
|
|
1598
|
-
function Ot(e, t = "", n = {}) {
|
|
1599
|
-
const r = n?.geodesic;
|
|
1600
|
-
if (!l.defined(e))
|
|
1601
|
-
return {
|
|
1602
|
-
valid: !0
|
|
1603
|
-
};
|
|
1604
|
-
if (!l.arrayOfLength(e, 4) && !l.arrayOfLength(e, 6))
|
|
1605
|
-
return {
|
|
1606
|
-
valid: !1,
|
|
1607
|
-
errors: [{ code: d.INVALID_BBOX_LENGTH, path: t }],
|
|
1608
|
-
warnings: []
|
|
1609
|
-
};
|
|
1610
|
-
const i = e.length === 4, s = i ? [e[0], e[1]] : [e[0], e[1], e[2]], o = i ? [e[2], e[3]] : [e[3], e[4], e[5]], c = ee(s, `${t}/min`, n);
|
|
1611
|
-
if (!c.valid)
|
|
1612
|
-
return { valid: !1, errors: c.errors, warnings: [] };
|
|
1613
|
-
const g = ee(o, `${t}/max`, n);
|
|
1614
|
-
if (!g.valid)
|
|
1615
|
-
return { valid: !1, errors: g.errors, warnings: [] };
|
|
1616
|
-
const [E, f] = s, [I, D] = o;
|
|
1617
|
-
if (f > D)
|
|
1618
|
-
return {
|
|
1619
|
-
valid: !1,
|
|
1620
|
-
errors: [{ code: d.INVALID_BBOX_LATITUDE_ORDER, path: t, params: { south: f, north: D } }],
|
|
1621
|
-
warnings: []
|
|
1622
|
-
};
|
|
1623
|
-
if (!r && E > I)
|
|
1624
|
-
return {
|
|
1625
|
-
valid: !1,
|
|
1626
|
-
errors: [{ code: d.INVALID_BBOX_LONGITUDE_ORDER, path: t, params: { west: E, east: I } }],
|
|
1627
|
-
warnings: []
|
|
1628
|
-
};
|
|
1629
|
-
if (!i) {
|
|
1630
|
-
const De = e[2], Ae = e[5];
|
|
1631
|
-
if (De > Ae)
|
|
1632
|
-
return {
|
|
1633
|
-
valid: !1,
|
|
1634
|
-
errors: [{ code: d.INVALID_BBOX_ALTITUDE_ORDER, path: t, params: { minAlt: De, maxAlt: Ae } }],
|
|
1635
|
-
warnings: []
|
|
1636
|
-
};
|
|
1637
|
-
}
|
|
1638
|
-
const H = { valid: !0, errors: [], warnings: [] };
|
|
1639
|
-
return r && E > I && H.warnings.push({ code: d.BBOX_ANTIMERIDIAN_CROSSING, path: t, params: { west: E, east: I } }), H.warnings.push(...c.warnings), H.warnings.push(...g.warnings), H;
|
|
1640
|
-
}
|
|
1641
|
-
function _e() {
|
|
1642
|
-
return { Feature: 0, FeatureCollection: 0, geometries: {} };
|
|
1643
|
-
}
|
|
1644
|
-
function he() {
|
|
1645
|
-
return {
|
|
1646
|
-
crs: void 0,
|
|
1647
|
-
valid: !0,
|
|
1648
|
-
errors: [],
|
|
1649
|
-
warnings: [],
|
|
1650
|
-
statistics: _e()
|
|
1651
|
-
};
|
|
1652
|
-
}
|
|
1653
|
-
function Nt(...e) {
|
|
1654
|
-
const t = _e();
|
|
1655
|
-
for (const n of e) {
|
|
1656
|
-
const r = n.statistics;
|
|
1657
|
-
if (r) {
|
|
1658
|
-
t.Feature += r.Feature ?? 0, t.FeatureCollection += r.FeatureCollection ?? 0;
|
|
1659
|
-
for (const [i, s] of Object.entries(r.geometries ?? {}))
|
|
1660
|
-
t.geometries[i] = (t.geometries[i] ?? 0) + s;
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
return t;
|
|
1664
|
-
}
|
|
1665
|
-
function L(e, ...t) {
|
|
1666
|
-
for (const n of t)
|
|
1667
|
-
e.valid = e.valid && (n.valid ?? !0), n.errors && e.errors.push(...n.errors), n.warnings && e.warnings.push(...n.warnings), n.crs !== void 0 && (e.crs = n.crs);
|
|
1668
|
-
return e.statistics = Nt(e, ...t), e;
|
|
1669
|
-
}
|
|
1670
|
-
function w(e, t, n = "") {
|
|
1671
|
-
const r = {
|
|
1672
|
-
valid: !0,
|
|
1673
|
-
errors: [],
|
|
1674
|
-
warnings: [],
|
|
1675
|
-
statistics: _e()
|
|
1676
|
-
};
|
|
1677
|
-
for (let i = 0; i < e.length; i++) {
|
|
1678
|
-
const s = `${n}/${i}`, o = t(e[i], s, i);
|
|
1679
|
-
o.statistics && (r.statistics = Nt(r, o)), o.valid || (r.valid = !1, r.errors = r.errors.concat(o.errors.map((c) => ({ ...c, path: c.path || s, index: i })))), l.empty(o.warnings) || (r.warnings = r.warnings.concat(o.warnings.map((c) => ({ ...c, path: c.path || s, index: i }))));
|
|
1680
|
-
}
|
|
1681
|
-
return r;
|
|
1682
|
-
}
|
|
1683
|
-
function Be(e, t = 0, n = v) {
|
|
1684
|
-
for (let r = t; r < e.length - 1; r++)
|
|
1685
|
-
if (pe(e[r], e[r + 1], { precision: n })) return r;
|
|
1686
|
-
return -1;
|
|
1687
|
-
}
|
|
1688
|
-
function pt(e, t, n, r = v) {
|
|
1689
|
-
let i = Be(e, 0, r);
|
|
1690
|
-
for (; i !== -1; )
|
|
1691
|
-
n.push({ code: d.DUPLICATE_POSITION, path: `${t}/${i}` }), i = Be(e, i + 1, r);
|
|
1692
|
-
}
|
|
1693
|
-
function be(e, t = 0, n = "", r = {}) {
|
|
1694
|
-
return l.arrayOfLengthAtLeast(e, t) ? w(e, (i, s) => ee(i, s, r), n) : {
|
|
1695
|
-
valid: !1,
|
|
1696
|
-
errors: [{ code: d.INVALID_COORDINATES_LENGTH, path: n, params: { minimumLength: t } }],
|
|
1697
|
-
warnings: []
|
|
1698
|
-
};
|
|
1699
|
-
}
|
|
1700
|
-
function vt(e, t = "", n = {}) {
|
|
1701
|
-
const r = be(e, 2, t, n);
|
|
1702
|
-
if (!r.valid) return r;
|
|
1703
|
-
if (pt(e, t, r.warnings, n.precision ?? v), n.geodesic ?? !0)
|
|
1704
|
-
for (let i = 0; i < e.length - 1; i++) {
|
|
1705
|
-
const s = e[i][0], o = e[i + 1][0];
|
|
1706
|
-
Math.abs(o - s) > 180 && r.warnings.push({ code: d.ANTIMERIDIAN_CROSSING, path: `${t}/${i}` });
|
|
1707
|
-
}
|
|
1708
|
-
return r;
|
|
1709
|
-
}
|
|
1710
|
-
function wn(e, t = "", n = {}) {
|
|
1711
|
-
return l.nonEmptyArray(e) ? w(e, (r, i) => vt(r, i, n), t) : {
|
|
1712
|
-
valid: !1,
|
|
1713
|
-
errors: [{ code: d.INVALID_MULTI_LINESTRING_COORDINATES, path: t }],
|
|
1714
|
-
warnings: []
|
|
1715
|
-
};
|
|
1716
|
-
}
|
|
1717
|
-
function jn(e, t, n = "", r = {}) {
|
|
1718
|
-
const i = r.precision ?? v, s = r.geodesic ?? !0, o = be(e, 4, n, r);
|
|
1719
|
-
if (!o.valid) return o;
|
|
1720
|
-
if (!Le(e, { precision: i }))
|
|
1721
|
-
return o.valid = !1, o.errors.push({ code: d.RING_NOT_CLOSED, path: n }), o;
|
|
1722
|
-
if (pt(e, n, o.warnings, i), s) {
|
|
1723
|
-
const c = ct(e) ? "clockwise" : "counter-clockwise";
|
|
1724
|
-
c !== t && (o.valid = !1, o.errors.push({
|
|
1725
|
-
code: d.INVALID_WINDING_ORDER,
|
|
1726
|
-
path: n,
|
|
1727
|
-
params: { expected: t, actual: c }
|
|
1728
|
-
}));
|
|
1729
|
-
const g = ft(e);
|
|
1730
|
-
g.length > 0 && (o.valid = !1, o.errors.push({
|
|
1731
|
-
code: d.SELF_INTERSECTION,
|
|
1732
|
-
path: n,
|
|
1733
|
-
params: { count: g.length }
|
|
1734
|
-
}));
|
|
1735
|
-
}
|
|
1736
|
-
return o;
|
|
1737
|
-
}
|
|
1738
|
-
function Lt(e, t = "", n = {}) {
|
|
1739
|
-
if (!l.nonEmptyArray(e))
|
|
1740
|
-
return {
|
|
1741
|
-
valid: !1,
|
|
1742
|
-
errors: [{ code: d.INVALID_POLYGON_COORDINATES, path: t }],
|
|
1743
|
-
warnings: []
|
|
1744
|
-
};
|
|
1745
|
-
const r = w(e, (i, s, o) => jn(i, o === 0 ? "counter-clockwise" : "clockwise", s, n), t);
|
|
1746
|
-
if ((n.geodesic ?? !0) && r.valid && e.length > 1) {
|
|
1747
|
-
const i = e[0];
|
|
1748
|
-
for (let s = 1; s < e.length; s++)
|
|
1749
|
-
dt(i, e[s]) && (r.valid = !1, r.errors.push({ code: d.HOLE_INTERSECTS_SHELL, path: `${t}/${s}` }));
|
|
1750
|
-
}
|
|
1751
|
-
return r;
|
|
1752
|
-
}
|
|
1753
|
-
function xn(e, t = "", n = {}) {
|
|
1754
|
-
return l.nonEmptyArray(e) ? w(e, (r, i) => Lt(r, i, n), t) : {
|
|
1755
|
-
valid: !1,
|
|
1756
|
-
errors: [{ code: d.INVALID_MULTIPOLYGON_COORDINATES, path: t }],
|
|
1757
|
-
warnings: []
|
|
1758
|
-
};
|
|
1759
|
-
}
|
|
1760
|
-
function kn(e, t = "", n = {}) {
|
|
1761
|
-
return l.nonEmptyArray(e) ? w(e, (r, i) => Re(r, i, n), t) : {
|
|
1762
|
-
valid: !1,
|
|
1763
|
-
errors: [{ code: d.INVALID_GEOMETRYCOLLECTION_GEOMETRIES, path: t }],
|
|
1764
|
-
warnings: []
|
|
1765
|
-
};
|
|
1766
|
-
}
|
|
1767
|
-
function Re(e, t = "", n = {}) {
|
|
1768
|
-
let r = he();
|
|
1769
|
-
if (!l.nonEmptyObject(e))
|
|
1770
|
-
return r.valid = !1, r.errors.push({ code: d.INVALID_GEOMETRY, path: t }), r;
|
|
1771
|
-
r = L(r, Et(e.crs, `${t}/crs`, n)), r = L(r, Ot(e.bbox, `${t}/bbox`, n));
|
|
1772
|
-
const i = `${t}/coordinates`;
|
|
1773
|
-
switch (e.type) {
|
|
1774
|
-
case m.POINT:
|
|
1775
|
-
r = L(r, ee(e.coordinates, i, n));
|
|
1776
|
-
break;
|
|
1777
|
-
case m.MULTI_POINT:
|
|
1778
|
-
r = L(r, be(e.coordinates, 0, i, n));
|
|
1779
|
-
break;
|
|
1780
|
-
case m.LINESTRING:
|
|
1781
|
-
r = L(r, vt(e.coordinates, i, n));
|
|
1782
|
-
break;
|
|
1783
|
-
case m.MULTI_LINESTRING:
|
|
1784
|
-
r = L(r, wn(e.coordinates, i, n));
|
|
1785
|
-
break;
|
|
1786
|
-
case m.POLYGON:
|
|
1787
|
-
r = L(r, Lt(e.coordinates, i, n));
|
|
1788
|
-
break;
|
|
1789
|
-
case m.MULTI_POLYGON:
|
|
1790
|
-
r = L(r, xn(e.coordinates, i, n));
|
|
1791
|
-
break;
|
|
1792
|
-
case m.GEOMETRY_COLLECTION:
|
|
1793
|
-
r = L(r, kn(e.geometries, `${t}/geometries`, n));
|
|
1794
|
-
break;
|
|
1795
|
-
default:
|
|
1796
|
-
return r.valid = !1, r.errors.push({ code: d.INVALID_GEOMETRY_TYPE, path: t, params: { type: e.type } }), r;
|
|
1797
|
-
}
|
|
1798
|
-
return r.statistics = { Feature: 0, FeatureCollection: 0, geometries: { [e.type]: 1 } }, r;
|
|
1799
|
-
}
|
|
1800
|
-
function Tt(e, t, n) {
|
|
1801
|
-
let r = he();
|
|
1802
|
-
return l.nonEmptyObject(e) ? (r = L(r, Et(e.crs, `${t}/crs`, n)), r = L(r, Ot(e.bbox, `${t}/bbox`, n)), e.type === p.FEATURE ? (r.statistics.Feature++, l.nonEmptyObject(e.geometry) ? r = L(r, Re(e.geometry, `${t}/geometry`, n)) : r.warnings.push({
|
|
1803
|
-
code: d.MISSING_GEOMETRY,
|
|
1804
|
-
path: t
|
|
1805
|
-
}), r) : (r.statistics.FeatureCollection++, l.nonEmptyArray(e.features) ? r = L(r, w(e.features, (i, s) => Tt(i, s, n), `${t}/features`)) : l.array(e.features) || (r.valid = !1, r.errors.push({
|
|
1806
|
-
code: d.INVALID_FEATURES_ARRAY,
|
|
1807
|
-
path: t
|
|
1808
|
-
})), r)) : (r.valid = !1, r.errors.push({
|
|
1809
|
-
code: d.EMPTY_OBJECT,
|
|
1810
|
-
path: t
|
|
1811
|
-
}), r);
|
|
1812
|
-
}
|
|
1813
|
-
function Tr(e, t = {}) {
|
|
1814
|
-
_.that(e, l.nonEmptyObject, "geojson must be a non empty object");
|
|
1815
|
-
const { precision: n = v } = t;
|
|
1816
|
-
return e.type === p.FEATURE || e.type === p.FEATURE_COLLECTION ? Tt(e, "", { precision: n }) : l.oneOf(e.type, Object.values(m)) ? Re(e, "", { precision: n }) : {
|
|
1817
|
-
...he(),
|
|
1818
|
-
valid: !1,
|
|
1819
|
-
errors: [{
|
|
1820
|
-
code: d.UNKNOWN_TYPE,
|
|
1821
|
-
path: "",
|
|
1822
|
-
params: { type: e.type }
|
|
1823
|
-
}]
|
|
1824
|
-
};
|
|
1825
|
-
}
|
|
1
|
+
import { A as e, C as i, a as o, b as t, D as n, E as r, I as c, M as l, T as C, W as S, c as g, d, e as O, f as P, g as A, h as E, i as R, j as T, k as u, l as I, m as x, n as N, o as _, p as L, q as m, r as B, s as G, t as D, u as p, v as J, w as F, x as f, y as k, z as j, B as M, F as V, G as h, H as b, J as v, K as U, L as H, N as W, O as Y, P as y, Q as z, R as w, S as X, U as q, V as K, X as Q, Y as Z, Z as $, _ as ss, $ as as, a0 as es, a1 as is, a2 as os, a3 as ts, a4 as ns, a5 as rs, a6 as cs, a7 as ls, a8 as Cs, a9 as Ss, aa as gs, ab as ds, ac as Os, ad as Ps, ae as As, af as Es } from "./ring-Cks2pGr8.js";
|
|
2
|
+
import { i as Ts, l as us } from "./line-CcfAx7LP.js";
|
|
3
|
+
import { C as xs, F as Ns, G as _s, V as Ls, c as ms, f as Bs, i as Gs, a as Ds, b as ps, d as Js, e as Fs, g as fs, h as ks, j as js, k as Ms, s as Vs, v as hs } from "./geojson-CJ6QZ9pN.js";
|
|
4
|
+
import { c as vs, e as Us, a as Hs, b as Ws, r as Ys, t as ys } from "./truncate-Cs8jmwOi.js";
|
|
1826
5
|
export {
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
F as
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
6
|
+
e as AXES,
|
|
7
|
+
i as COORDINATE_FORMATS,
|
|
8
|
+
o as COORDINATE_MODELS,
|
|
9
|
+
t as COORDINATE_TRUNCATION_FACTORS,
|
|
10
|
+
xs as CRS_TYPES,
|
|
11
|
+
n as DEFAULT_COORDINATE_PRECISION,
|
|
12
|
+
r as EARTH_RADIUS,
|
|
13
|
+
Ns as FEATURE_TYPES,
|
|
14
|
+
_s as GEOMETRY_TYPES,
|
|
15
|
+
c as IS_SAME_POSITION_OPTIONS_SCHEMA,
|
|
16
|
+
l as MAX_COORDINATE_PRECISION,
|
|
17
|
+
C as TRUNCATE_POSITIONS_OPTIONS_SCHEMA,
|
|
18
|
+
Ls as VALIDATION_CODES,
|
|
19
|
+
S as WGS84,
|
|
20
|
+
g as closeRing,
|
|
21
|
+
d as computeBBox,
|
|
22
|
+
ms as computeGeoJsonBoundingBox,
|
|
23
|
+
vs as computeGeoJsonConvexHull,
|
|
24
|
+
O as convertCoordinate,
|
|
25
|
+
P as deduplicatePositions,
|
|
26
|
+
A as defineProjection,
|
|
27
|
+
E as denormalizeCrsName,
|
|
28
|
+
R as destinationFromPosition,
|
|
29
|
+
T as distanceBetweenPositions,
|
|
30
|
+
Us as extractGeoJsonBBox,
|
|
31
|
+
Hs as extractGeoJsonCRS,
|
|
32
|
+
Ws as extractGeoJsonNode,
|
|
33
|
+
Bs as fixGeoJson,
|
|
34
|
+
u as getActiveLocales,
|
|
35
|
+
I as getCoordinatePrecision,
|
|
36
|
+
x as getDirectionAxis,
|
|
37
|
+
N as getDirectionSymbols,
|
|
38
|
+
_ as getDirections,
|
|
39
|
+
L as getEast,
|
|
40
|
+
m as getLocale,
|
|
41
|
+
B as getMessages,
|
|
42
|
+
G as getNorth,
|
|
43
|
+
D as getProjection,
|
|
44
|
+
p as getSouth,
|
|
45
|
+
J as getWest,
|
|
46
|
+
F as guessCoordinateAxis,
|
|
47
|
+
f as hasProjection,
|
|
48
|
+
k as is3DBBox,
|
|
49
|
+
j as is3DPosition,
|
|
50
|
+
M as isAltitude,
|
|
51
|
+
V as isClockwiseRing,
|
|
52
|
+
h as isClosedRing,
|
|
53
|
+
b as isEast,
|
|
54
|
+
Gs as isGeoJsonFixable,
|
|
55
|
+
v as isLatitude,
|
|
56
|
+
Ds as isLikeBBox,
|
|
57
|
+
ps as isLikeCRS,
|
|
58
|
+
Js as isLikeFeature,
|
|
59
|
+
Fs as isLikeFeatureCollection,
|
|
60
|
+
fs as isLikeFeatureOrFeatureCollection,
|
|
61
|
+
ks as isLikeGeoJson,
|
|
62
|
+
js as isLikeGeometry,
|
|
63
|
+
Ms as isLikePosition,
|
|
64
|
+
U as isLongitude,
|
|
65
|
+
H as isNorth,
|
|
66
|
+
W as isSamePosition,
|
|
67
|
+
Y as isSouth,
|
|
68
|
+
y as isValidAxis,
|
|
69
|
+
z as isValidBBox,
|
|
70
|
+
w as isValidDirection,
|
|
71
|
+
Ts as isValidLine,
|
|
72
|
+
X as isValidPosition,
|
|
73
|
+
q as isValidPositions,
|
|
74
|
+
K as isValidRing,
|
|
75
|
+
Q as isWGS84Projection,
|
|
76
|
+
Z as isWest,
|
|
77
|
+
us as lineLength,
|
|
78
|
+
$ as listLocales,
|
|
79
|
+
ss as listProjections,
|
|
80
|
+
as as mergeBBox,
|
|
81
|
+
es as normalizeCoordinate,
|
|
82
|
+
is as normalizeCrsName,
|
|
83
|
+
os as parseCoordinate,
|
|
84
|
+
ts as parsePosition,
|
|
85
|
+
ns as registerMessages,
|
|
86
|
+
Ys as reprojectGeoJson,
|
|
87
|
+
rs as reprojectPosition,
|
|
88
|
+
cs as reprojectPositions,
|
|
89
|
+
ls as ringSelfIntersections,
|
|
90
|
+
Cs as ringsIntersect,
|
|
91
|
+
Ss as setLocale,
|
|
92
|
+
Vs as simplifyGeoJson,
|
|
93
|
+
gs as sphericalRingArea,
|
|
94
|
+
ds as truncateBBox,
|
|
95
|
+
Os as truncateCoordinate,
|
|
96
|
+
ys as truncateGeoJson,
|
|
97
|
+
Ps as truncatePosition,
|
|
98
|
+
As as truncatePositions,
|
|
99
|
+
Es as truncateRing,
|
|
100
|
+
hs as validateGeoJson
|
|
1921
101
|
};
|
|
1922
102
|
//# sourceMappingURL=index.mjs.map
|