@math.gl/dggs 5.0.0-alpha.17 → 5.0.0-alpha.19
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/a5-decoder.d.ts +1 -1
- package/dist/a5-decoder.d.ts.map +1 -1
- package/dist/dggs-decoder.d.ts +1 -1
- package/dist/dggs-decoder.d.ts.map +1 -1
- package/dist/expressions.cjs +637 -0
- package/dist/expressions.cjs.map +6 -0
- package/dist/expressions.d.ts +7 -0
- package/dist/expressions.d.ts.map +1 -0
- package/dist/expressions.js +32 -0
- package/dist/expressions.js.map +1 -0
- package/dist/geohash-decoder.d.ts +1 -1
- package/dist/geohash-decoder.d.ts.map +1 -1
- package/dist/h3-decoder.d.ts +1 -1
- package/dist/h3-decoder.d.ts.map +1 -1
- package/dist/plus-code-decoder.d.ts +1 -1
- package/dist/plus-code-decoder.d.ts.map +1 -1
- package/dist/quadkey-decoder.d.ts +1 -1
- package/dist/quadkey-decoder.d.ts.map +1 -1
- package/dist/s2-decoder.d.ts +1 -1
- package/dist/s2-decoder.d.ts.map +1 -1
- package/package.json +8 -3
- package/src/a5-decoder.ts +1 -1
- package/src/converters/s2-to-obb-points.ts +1 -1
- package/src/dggs-decoder.ts +1 -1
- package/src/expressions.ts +37 -0
- package/src/geohash-decoder.ts +1 -1
- package/src/h3-decoder.ts +1 -1
- package/src/plus-code-decoder.ts +1 -1
- package/src/quadkey-decoder.ts +1 -1
- package/src/s2-decoder.ts +1 -1
package/dist/a5-decoder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Bounds2D } from '@math.gl/types';
|
|
1
|
+
import { type Bounds2D } from '@math.gl/core/types';
|
|
2
2
|
import { type DGGSCell, type DGGSDecoder } from "./dggs-decoder.js";
|
|
3
3
|
/** Lightweight cell geometry decoder for the A5 pentagonal DGGS. */
|
|
4
4
|
export declare const A5Decoder: Omit<{
|
package/dist/a5-decoder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a5-decoder.d.ts","sourceRoot":"","sources":["../src/a5-decoder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"a5-decoder.d.ts","sourceRoot":"","sources":["../src/a5-decoder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,0BAAuB;AAExB,oEAAoE;AACpE,eAAO,MAAM,SAAS;;;;kCAaC,MAAM,KAAG,MAAM;iCAChB,QAAQ,KAAG,MAAM;kCAEhB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;oCACzB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;wCACzB,QAAQ,KAAG,MAAM,EAAE;kCACzB,QAAQ,KAAG,QAAQ;0IACT,CAAC"}
|
package/dist/dggs-decoder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Bounds2D } from '@math.gl/types';
|
|
1
|
+
import { type Bounds2D } from '@math.gl/core/types';
|
|
2
2
|
/** Optional continuous-longitude geometry output for DGGS decoders. */
|
|
3
3
|
export type DGGSBoundaryOptions = {
|
|
4
4
|
/** Unwrap ordinary antimeridian crossings. Defaults to false. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dggs-decoder.d.ts","sourceRoot":"","sources":["../src/dggs-decoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"dggs-decoder.d.ts","sourceRoot":"","sources":["../src/dggs-decoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAGlD,uEAAuE;AACvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,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,MAAM,CAKzE;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,QAAQ,CAiBxE;AAED,sEAAsE;AACtE,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,WAAW,EAC3D,OAAO,EAAE,CAAC,GACT,IAAI,CAAC,CAAC,EAAE,gBAAgB,GAAG,oBAAoB,GAAG,cAAc,CAAC,GAClE,IAAI,CAAC,WAAW,EAAE,gBAAgB,GAAG,oBAAoB,GAAG,cAAc,CAAC,CAsB5E"}
|
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// dist/expressions.js
|
|
20
|
+
var expressions_exports = {};
|
|
21
|
+
__export(expressions_exports, {
|
|
22
|
+
DGGS_FUNCTION_LIBRARY: () => DGGS_FUNCTION_LIBRARY,
|
|
23
|
+
GEOHASH_FUNCTION_LIBRARY: () => GEOHASH_FUNCTION_LIBRARY,
|
|
24
|
+
QUADKEY_FUNCTION_LIBRARY: () => QUADKEY_FUNCTION_LIBRARY,
|
|
25
|
+
S2_FUNCTION_LIBRARY: () => S2_FUNCTION_LIBRARY
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(expressions_exports);
|
|
28
|
+
|
|
29
|
+
// dist/unwrap-dggs-boundary.js
|
|
30
|
+
function unwrapDGGSBoundary(boundary, referenceLongitude) {
|
|
31
|
+
const result = boundary.map(([longitude, latitude]) => [longitude, latitude]);
|
|
32
|
+
if (result.length === 0) {
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
let west = Infinity;
|
|
36
|
+
let east = -Infinity;
|
|
37
|
+
for (const [longitude] of boundary) {
|
|
38
|
+
west = Math.min(west, longitude);
|
|
39
|
+
east = Math.max(east, longitude);
|
|
40
|
+
}
|
|
41
|
+
if (east - west >= 360) {
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
let previous = referenceLongitude ?? result[0][0];
|
|
45
|
+
for (const point of result) {
|
|
46
|
+
const delta = point[0] - previous;
|
|
47
|
+
if (delta > 180) {
|
|
48
|
+
point[0] -= 360 * Math.ceil((delta - 180) / 360);
|
|
49
|
+
} else if (delta < -180) {
|
|
50
|
+
point[0] += 360 * Math.ceil((-delta - 180) / 360);
|
|
51
|
+
}
|
|
52
|
+
previous = point[0];
|
|
53
|
+
}
|
|
54
|
+
const first = boundary[0];
|
|
55
|
+
const last = boundary[boundary.length - 1];
|
|
56
|
+
if (first[0] === last[0] && first[1] === last[1]) {
|
|
57
|
+
if (Math.abs(result[result.length - 1][0] - result[0][0]) > 180) {
|
|
58
|
+
return boundary.map(([longitude, latitude]) => [longitude, latitude]);
|
|
59
|
+
}
|
|
60
|
+
result[result.length - 1] = [...result[0]];
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// dist/dggs-decoder.js
|
|
66
|
+
function getDGGSCellToken(cell, gridName) {
|
|
67
|
+
if (typeof cell !== "string") {
|
|
68
|
+
throw new Error(`${gridName} cell identifiers must be strings`);
|
|
69
|
+
}
|
|
70
|
+
return cell;
|
|
71
|
+
}
|
|
72
|
+
function getDGGSCellBounds(boundary) {
|
|
73
|
+
let west = Infinity;
|
|
74
|
+
let south = Infinity;
|
|
75
|
+
let east = -Infinity;
|
|
76
|
+
let north = -Infinity;
|
|
77
|
+
for (const [longitude, latitude] of boundary) {
|
|
78
|
+
west = Math.min(west, longitude);
|
|
79
|
+
south = Math.min(south, latitude);
|
|
80
|
+
east = Math.max(east, longitude);
|
|
81
|
+
north = Math.max(north, latitude);
|
|
82
|
+
}
|
|
83
|
+
return [
|
|
84
|
+
[west, south],
|
|
85
|
+
[east, north]
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
function withDGGSBoundaryOptions(decoder) {
|
|
89
|
+
const cellToBoundary = (cell, options) => {
|
|
90
|
+
const boundary = decoder.cellToBoundary(cell);
|
|
91
|
+
return (options == null ? void 0 : options.unwrap) ? unwrapDGGSBoundary(boundary, options.referenceLongitude) : boundary;
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
...decoder,
|
|
95
|
+
cellToBoundary,
|
|
96
|
+
cellToBoundaryFlat: (cell, options) => (options == null ? void 0 : options.unwrap) ? cellToBoundary(cell, options).flat() : decoder.cellToBoundaryFlat(cell),
|
|
97
|
+
cellToBounds: (cell, options) => {
|
|
98
|
+
const bounds = decoder.cellToBounds(cell);
|
|
99
|
+
if (!(options == null ? void 0 : options.unwrap) || bounds[1][0] - bounds[0][0] >= 360) {
|
|
100
|
+
return bounds;
|
|
101
|
+
}
|
|
102
|
+
const unwrapped = getDGGSCellBounds(cellToBoundary(cell, options));
|
|
103
|
+
unwrapped[0][1] = bounds[0][1];
|
|
104
|
+
unwrapped[1][1] = bounds[1][1];
|
|
105
|
+
return unwrapped;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// dist/geohash-decoder.js
|
|
111
|
+
var GeohashDecoder = withDGGSBoundaryOptions({
|
|
112
|
+
name: "geohash",
|
|
113
|
+
hasNumericRepresentation: false,
|
|
114
|
+
cellColumnNames: ["geohash", "geohashId", "geohash_id"],
|
|
115
|
+
cellToLngLat: (cell) => getGeohashLngLat(getDGGSCellToken(cell, "GeoHash")),
|
|
116
|
+
cellToBoundary: (cell) => getGeohashBoundary(getDGGSCellToken(cell, "GeoHash")),
|
|
117
|
+
cellToBoundaryFlat: (cell) => getGeohashBoundaryFlat(getDGGSCellToken(cell, "GeoHash")),
|
|
118
|
+
cellToBounds: (cell) => getGeohashBounds(getDGGSCellToken(cell, "GeoHash"))
|
|
119
|
+
});
|
|
120
|
+
var BASE32_CODES = "0123456789bcdefghjkmnpqrstuvwxyz";
|
|
121
|
+
var BASE32_CODES_DICT = {};
|
|
122
|
+
for (let i = 0; i < BASE32_CODES.length; i++) {
|
|
123
|
+
BASE32_CODES_DICT[BASE32_CODES.charAt(i)] = i;
|
|
124
|
+
}
|
|
125
|
+
var MIN_LAT = -90;
|
|
126
|
+
var MAX_LAT = 90;
|
|
127
|
+
var MIN_LON = -180;
|
|
128
|
+
var MAX_LON = 180;
|
|
129
|
+
function getGeohashLngLat(geohash) {
|
|
130
|
+
const [[w, s], [e, n]] = getGeohashBounds(geohash);
|
|
131
|
+
return [(e + w) / 2, (n + s) / 2];
|
|
132
|
+
}
|
|
133
|
+
function getGeohashBoundary(geohash) {
|
|
134
|
+
const [[w, s], [e, n]] = getGeohashBounds(geohash);
|
|
135
|
+
return [
|
|
136
|
+
[e, n],
|
|
137
|
+
[e, s],
|
|
138
|
+
[w, s],
|
|
139
|
+
[w, n],
|
|
140
|
+
[e, n]
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
function getGeohashBoundaryFlat(geohash) {
|
|
144
|
+
const [[w, s], [e, n]] = getGeohashBounds(geohash);
|
|
145
|
+
return [e, n, e, s, w, s, w, n, e, n];
|
|
146
|
+
}
|
|
147
|
+
function getGeohashBounds(geohash) {
|
|
148
|
+
let isLon = true;
|
|
149
|
+
let maxLat = MAX_LAT;
|
|
150
|
+
let minLat = MIN_LAT;
|
|
151
|
+
let maxLon = MAX_LON;
|
|
152
|
+
let minLon = MIN_LON;
|
|
153
|
+
let mid;
|
|
154
|
+
let hashValue = 0;
|
|
155
|
+
for (let i = 0, l = geohash.length; i < l; i++) {
|
|
156
|
+
const code = geohash[i].toLowerCase();
|
|
157
|
+
hashValue = BASE32_CODES_DICT[code];
|
|
158
|
+
for (let bits = 4; bits >= 0; bits--) {
|
|
159
|
+
const bit = hashValue >> bits & 1;
|
|
160
|
+
if (isLon) {
|
|
161
|
+
mid = (maxLon + minLon) / 2;
|
|
162
|
+
if (bit === 1) {
|
|
163
|
+
minLon = mid;
|
|
164
|
+
} else {
|
|
165
|
+
maxLon = mid;
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
mid = (maxLat + minLat) / 2;
|
|
169
|
+
if (bit === 1) {
|
|
170
|
+
minLat = mid;
|
|
171
|
+
} else {
|
|
172
|
+
maxLat = mid;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
isLon = !isLon;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return [
|
|
179
|
+
[minLon, minLat],
|
|
180
|
+
[maxLon, maxLat]
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// dist/quadkey-decoder.js
|
|
185
|
+
var TILE_SIZE = 512;
|
|
186
|
+
var QuadkeyDecoder = withDGGSBoundaryOptions({
|
|
187
|
+
name: "quadkey",
|
|
188
|
+
hasNumericRepresentation: false,
|
|
189
|
+
cellColumnNames: ["quadkey", "quadkeyId", "quadkey_id"],
|
|
190
|
+
cellToLngLat: (cell) => getQuadkeyLngLat(getDGGSCellToken(cell, "Quadkey")),
|
|
191
|
+
cellToBoundary: (cell) => getQuadkeyBoundary(getDGGSCellToken(cell, "Quadkey")),
|
|
192
|
+
cellToBoundaryFlat: (cell) => getQuadkeyBoundaryFlat(getDGGSCellToken(cell, "Quadkey")),
|
|
193
|
+
cellToBounds: (cell) => getQuadkeyBounds(getDGGSCellToken(cell, "Quadkey"))
|
|
194
|
+
});
|
|
195
|
+
function getQuadkeyLngLat(quadkey) {
|
|
196
|
+
const [topLeft, bottomRight] = quadkeyToWorldBounds(quadkey);
|
|
197
|
+
const [w, n] = worldToLngLat(topLeft);
|
|
198
|
+
const [e, s] = worldToLngLat(bottomRight);
|
|
199
|
+
return [(e + w) / 2, (s + n) / 2];
|
|
200
|
+
}
|
|
201
|
+
function getQuadkeyBoundary(quadkey) {
|
|
202
|
+
const [topLeft, bottomRight] = quadkeyToWorldBounds(quadkey);
|
|
203
|
+
const [w, n] = worldToLngLat(topLeft);
|
|
204
|
+
const [e, s] = worldToLngLat(bottomRight);
|
|
205
|
+
return [
|
|
206
|
+
[e, n],
|
|
207
|
+
[e, s],
|
|
208
|
+
[w, s],
|
|
209
|
+
[w, n],
|
|
210
|
+
[e, n]
|
|
211
|
+
];
|
|
212
|
+
}
|
|
213
|
+
function getQuadkeyBoundaryFlat(quadkey) {
|
|
214
|
+
const [topLeft, bottomRight] = quadkeyToWorldBounds(quadkey);
|
|
215
|
+
const [w, n] = worldToLngLat(topLeft);
|
|
216
|
+
const [e, s] = worldToLngLat(bottomRight);
|
|
217
|
+
return [e, n, e, s, w, s, w, n, e, n];
|
|
218
|
+
}
|
|
219
|
+
function getQuadkeyBounds(quadkey) {
|
|
220
|
+
const [topLeft, bottomRight] = quadkeyToWorldBounds(quadkey);
|
|
221
|
+
const [w, n] = worldToLngLat(topLeft);
|
|
222
|
+
const [e, s] = worldToLngLat(bottomRight);
|
|
223
|
+
return [
|
|
224
|
+
[w, s],
|
|
225
|
+
[e, n]
|
|
226
|
+
];
|
|
227
|
+
}
|
|
228
|
+
function quadkeyToWorldBounds(quadkey) {
|
|
229
|
+
let x = 0;
|
|
230
|
+
let y = 0;
|
|
231
|
+
let mask = 1 << quadkey.length;
|
|
232
|
+
const scale = mask / TILE_SIZE;
|
|
233
|
+
for (let i = 0; i < quadkey.length; i++) {
|
|
234
|
+
mask >>= 1;
|
|
235
|
+
const q = parseInt(quadkey[i], 10);
|
|
236
|
+
if (q % 2)
|
|
237
|
+
x |= mask;
|
|
238
|
+
if (q > 1)
|
|
239
|
+
y |= mask;
|
|
240
|
+
}
|
|
241
|
+
return [
|
|
242
|
+
[x / scale, TILE_SIZE - y / scale],
|
|
243
|
+
[(x + 0.99) / scale, TILE_SIZE - (y + 0.99) / scale]
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
var PI = Math.PI;
|
|
247
|
+
var PI_4 = PI / 4;
|
|
248
|
+
var RADIANS_TO_DEGREES = 180 / PI;
|
|
249
|
+
function worldToLngLat(xy) {
|
|
250
|
+
const [x, y] = xy;
|
|
251
|
+
const lambda2 = x / TILE_SIZE * (2 * PI) - PI;
|
|
252
|
+
const phi2 = 2 * (Math.atan(Math.exp(y / TILE_SIZE * (2 * PI) - PI)) - PI_4);
|
|
253
|
+
return [lambda2 * RADIANS_TO_DEGREES, phi2 * RADIANS_TO_DEGREES];
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// dist/s2-geometry/s2-token.js
|
|
257
|
+
var MAXIMUM_TOKEN_LENGTH = 16;
|
|
258
|
+
var MAXIMUM_S2_INDEX = (1n << 64n) - 1n;
|
|
259
|
+
var VALID_LOWEST_ON_BITS = 0x1555555555555555n;
|
|
260
|
+
var MAXIMUM_LEVEL = 30;
|
|
261
|
+
function getS2IndexFromToken(token) {
|
|
262
|
+
if (token === "X") {
|
|
263
|
+
return 0n;
|
|
264
|
+
}
|
|
265
|
+
if (!isS2TokenValid(token)) {
|
|
266
|
+
throw new Error(`Invalid S2 token: ${token}`);
|
|
267
|
+
}
|
|
268
|
+
const paddedToken = token.padEnd(MAXIMUM_TOKEN_LENGTH, "0");
|
|
269
|
+
return BigInt(`0x${paddedToken}`);
|
|
270
|
+
}
|
|
271
|
+
function getS2TokenFromIndex(cellId) {
|
|
272
|
+
if (cellId === 0n) {
|
|
273
|
+
return "X";
|
|
274
|
+
}
|
|
275
|
+
if (!isS2IndexValid(cellId)) {
|
|
276
|
+
throw new Error(`Invalid S2 index: ${cellId}`);
|
|
277
|
+
}
|
|
278
|
+
let numZeroDigits = countTrailingZeros(cellId);
|
|
279
|
+
const remainder = numZeroDigits % 4;
|
|
280
|
+
numZeroDigits = (numZeroDigits - remainder) / 4;
|
|
281
|
+
const trailingZeroHexChars = numZeroDigits;
|
|
282
|
+
numZeroDigits *= 4;
|
|
283
|
+
const x = cellId >> BigInt(numZeroDigits);
|
|
284
|
+
const hexString = x.toString(16).replace(/0+$/, "");
|
|
285
|
+
const zeroString = Array(17 - trailingZeroHexChars - hexString.length).join("0");
|
|
286
|
+
return zeroString + hexString;
|
|
287
|
+
}
|
|
288
|
+
function isS2IndexValid(s2Index) {
|
|
289
|
+
if (typeof s2Index !== "bigint" || s2Index <= 0n || s2Index > MAXIMUM_S2_INDEX) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
const face = s2Index >> 61n;
|
|
293
|
+
const lowestOnBit = s2Index & -s2Index;
|
|
294
|
+
return face < 6n && (lowestOnBit & VALID_LOWEST_ON_BITS) !== 0n;
|
|
295
|
+
}
|
|
296
|
+
function isS2TokenValid(token) {
|
|
297
|
+
if (typeof token !== "string" || !/^[0-9a-fA-F]{1,16}$/.test(token) || token.endsWith("0")) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
const paddedToken = token.padEnd(MAXIMUM_TOKEN_LENGTH, "0");
|
|
301
|
+
return isS2IndexValid(BigInt(`0x${paddedToken}`));
|
|
302
|
+
}
|
|
303
|
+
function getS2Level(s2Index) {
|
|
304
|
+
if (!isS2IndexValid(s2Index)) {
|
|
305
|
+
throw new Error(`Invalid S2 index: ${s2Index}`);
|
|
306
|
+
}
|
|
307
|
+
return (60 - countTrailingZeros(s2Index)) / 2;
|
|
308
|
+
}
|
|
309
|
+
function getS2ChildIndex(s2Index, index) {
|
|
310
|
+
if (!isS2IndexValid(s2Index)) {
|
|
311
|
+
throw new Error(`Invalid S2 index: ${s2Index}`);
|
|
312
|
+
}
|
|
313
|
+
if (!Number.isInteger(index) || index < 0 || index > 3) {
|
|
314
|
+
throw new Error(`Invalid S2 child index: ${index}`);
|
|
315
|
+
}
|
|
316
|
+
if (getS2Level(s2Index) === MAXIMUM_LEVEL) {
|
|
317
|
+
throw new Error("Cannot subdivide an S2 leaf cell");
|
|
318
|
+
}
|
|
319
|
+
const newLsb = lsb(s2Index) >> 2n;
|
|
320
|
+
const childCellId = s2Index + BigInt(2 * index + 1 - 4) * newLsb;
|
|
321
|
+
return childCellId;
|
|
322
|
+
}
|
|
323
|
+
function lsb(cellId) {
|
|
324
|
+
return cellId & -cellId;
|
|
325
|
+
}
|
|
326
|
+
function countTrailingZeros(n) {
|
|
327
|
+
let count = 0;
|
|
328
|
+
while (n % 2n === 0n) {
|
|
329
|
+
n /= 2n;
|
|
330
|
+
count++;
|
|
331
|
+
}
|
|
332
|
+
return count;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// dist/s2-geometry/s2-geometry.js
|
|
336
|
+
function getS2Cell(s2Index) {
|
|
337
|
+
if (!isS2IndexValid(s2Index)) {
|
|
338
|
+
throw new Error(`Invalid S2 index: ${s2Index}`);
|
|
339
|
+
}
|
|
340
|
+
const key = toHilbertQuadkey(s2Index);
|
|
341
|
+
const s2cell = fromHilbertQuadKey(key);
|
|
342
|
+
return s2cell;
|
|
343
|
+
}
|
|
344
|
+
var FACE_BITS = 3;
|
|
345
|
+
var MAX_LEVEL = 30;
|
|
346
|
+
var POS_BITS = 2 * MAX_LEVEL + 1;
|
|
347
|
+
var RADIAN_TO_DEGREE = 180 / Math.PI;
|
|
348
|
+
function fromHilbertQuadKey(hilbertQuadkey) {
|
|
349
|
+
if (!/^[0-5]\/[0-3]{0,30}$/.test(hilbertQuadkey)) {
|
|
350
|
+
throw new Error(`Invalid S2 Hilbert quadkey: ${hilbertQuadkey}`);
|
|
351
|
+
}
|
|
352
|
+
const parts = hilbertQuadkey.split("/");
|
|
353
|
+
const face = parseInt(parts[0], 10);
|
|
354
|
+
const position = parts[1] || "";
|
|
355
|
+
const maxLevel = position.length;
|
|
356
|
+
let level = 0;
|
|
357
|
+
const point = [0, 0];
|
|
358
|
+
for (let i = maxLevel - 1; i >= 0; i--) {
|
|
359
|
+
level = maxLevel - i;
|
|
360
|
+
const bit = position[i];
|
|
361
|
+
let rx = 0;
|
|
362
|
+
let ry = 0;
|
|
363
|
+
if (bit === "1") {
|
|
364
|
+
ry = 1;
|
|
365
|
+
} else if (bit === "2") {
|
|
366
|
+
rx = 1;
|
|
367
|
+
ry = 1;
|
|
368
|
+
} else if (bit === "3") {
|
|
369
|
+
rx = 1;
|
|
370
|
+
}
|
|
371
|
+
const val = Math.pow(2, level - 1);
|
|
372
|
+
rotateAndFlipQuadrant(val, point, rx, ry);
|
|
373
|
+
point[0] += val * rx;
|
|
374
|
+
point[1] += val * ry;
|
|
375
|
+
}
|
|
376
|
+
if (face % 2 === 1) {
|
|
377
|
+
const t = point[0];
|
|
378
|
+
point[0] = point[1];
|
|
379
|
+
point[1] = t;
|
|
380
|
+
}
|
|
381
|
+
return { face, ij: point, level };
|
|
382
|
+
}
|
|
383
|
+
function toHilbertQuadkey(id) {
|
|
384
|
+
if (!isS2IndexValid(id)) {
|
|
385
|
+
throw new Error(`Invalid S2 index: ${id}`);
|
|
386
|
+
}
|
|
387
|
+
let bin = id.toString(2);
|
|
388
|
+
while (bin.length < FACE_BITS + POS_BITS) {
|
|
389
|
+
bin = "0" + bin;
|
|
390
|
+
}
|
|
391
|
+
const lsbIndex = bin.lastIndexOf("1");
|
|
392
|
+
const faceB = bin.substring(0, 3);
|
|
393
|
+
const posB = bin.substring(3, lsbIndex);
|
|
394
|
+
const levelN = posB.length / 2;
|
|
395
|
+
const faceS = BigInt(`0b${faceB}`).toString(10);
|
|
396
|
+
let posS = "";
|
|
397
|
+
if (levelN !== 0) {
|
|
398
|
+
posS = BigInt(`0b${posB}`).toString(4);
|
|
399
|
+
while (posS.length < levelN) {
|
|
400
|
+
posS = "0" + posS;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return `${faceS}/${posS}`;
|
|
404
|
+
}
|
|
405
|
+
function IJToST(ij, order, offsets) {
|
|
406
|
+
const maxSize = 1 << order;
|
|
407
|
+
return [(ij[0] + offsets[0]) / maxSize, (ij[1] + offsets[1]) / maxSize];
|
|
408
|
+
}
|
|
409
|
+
function singleSTtoUV(st) {
|
|
410
|
+
if (st >= 0.5) {
|
|
411
|
+
return 1 / 3 * (4 * st * st - 1);
|
|
412
|
+
}
|
|
413
|
+
return 1 / 3 * (1 - 4 * (1 - st) * (1 - st));
|
|
414
|
+
}
|
|
415
|
+
function STToUV(st) {
|
|
416
|
+
return [singleSTtoUV(st[0]), singleSTtoUV(st[1])];
|
|
417
|
+
}
|
|
418
|
+
function FaceUVToXYZ(face, [u, v]) {
|
|
419
|
+
switch (face) {
|
|
420
|
+
case 0:
|
|
421
|
+
return [1, u, v];
|
|
422
|
+
case 1:
|
|
423
|
+
return [-u, 1, v];
|
|
424
|
+
case 2:
|
|
425
|
+
return [-u, -v, 1];
|
|
426
|
+
case 3:
|
|
427
|
+
return [-1, -v, -u];
|
|
428
|
+
case 4:
|
|
429
|
+
return [v, -1, -u];
|
|
430
|
+
case 5:
|
|
431
|
+
return [v, u, -1];
|
|
432
|
+
default:
|
|
433
|
+
throw new Error("Invalid face");
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function XYZToLngLat([x, y, z]) {
|
|
437
|
+
const lat = Math.atan2(z, Math.sqrt(x * x + y * y));
|
|
438
|
+
const lng = Math.atan2(y, x);
|
|
439
|
+
return [lng * RADIAN_TO_DEGREE, lat * RADIAN_TO_DEGREE];
|
|
440
|
+
}
|
|
441
|
+
function rotateAndFlipQuadrant(n, point, rx, ry) {
|
|
442
|
+
if (ry === 0) {
|
|
443
|
+
if (rx === 1) {
|
|
444
|
+
point[0] = n - 1 - point[0];
|
|
445
|
+
point[1] = n - 1 - point[1];
|
|
446
|
+
}
|
|
447
|
+
const x = point[0];
|
|
448
|
+
point[0] = point[1];
|
|
449
|
+
point[1] = x;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// dist/s2-geometry/s2-to-boundary.js
|
|
454
|
+
var MAX_RESOLUTION = 100;
|
|
455
|
+
function getS2GeoBounds(s2Index) {
|
|
456
|
+
const s2Cell = getS2Cell(s2Index);
|
|
457
|
+
return getS2GeoBoundsFromCell(s2Cell);
|
|
458
|
+
}
|
|
459
|
+
function getS2GeoBoundsFromCell({ face, ij, level }) {
|
|
460
|
+
const offsets = [
|
|
461
|
+
[0, 0],
|
|
462
|
+
[0, 1],
|
|
463
|
+
[1, 1],
|
|
464
|
+
[1, 0],
|
|
465
|
+
[0, 0]
|
|
466
|
+
];
|
|
467
|
+
const resolution = Math.max(1, Math.ceil(MAX_RESOLUTION * Math.pow(2, -level)));
|
|
468
|
+
const result = new Float64Array(4 * resolution * 2 + 2);
|
|
469
|
+
let ptIndex = 0;
|
|
470
|
+
let prevLng = 0;
|
|
471
|
+
for (let i = 0; i < 4; i++) {
|
|
472
|
+
const offset = offsets[i].slice(0);
|
|
473
|
+
const nextOffset = offsets[i + 1];
|
|
474
|
+
const stepI = (nextOffset[0] - offset[0]) / resolution;
|
|
475
|
+
const stepJ = (nextOffset[1] - offset[1]) / resolution;
|
|
476
|
+
for (let j = 0; j < resolution; j++) {
|
|
477
|
+
offset[0] += stepI;
|
|
478
|
+
offset[1] += stepJ;
|
|
479
|
+
const st = IJToST(ij, level, offset);
|
|
480
|
+
const uv = STToUV(st);
|
|
481
|
+
const xyz = FaceUVToXYZ(face, uv);
|
|
482
|
+
const lngLat = XYZToLngLat(xyz);
|
|
483
|
+
if (Math.abs(lngLat[1]) > 89.999) {
|
|
484
|
+
lngLat[0] = prevLng;
|
|
485
|
+
}
|
|
486
|
+
const deltaLng = lngLat[0] - prevLng;
|
|
487
|
+
lngLat[0] += deltaLng > 180 ? -360 : deltaLng < -180 ? 360 : 0;
|
|
488
|
+
result[ptIndex++] = lngLat[0];
|
|
489
|
+
result[ptIndex++] = lngLat[1];
|
|
490
|
+
prevLng = lngLat[0];
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
result[ptIndex++] = result[0];
|
|
494
|
+
result[ptIndex++] = result[1];
|
|
495
|
+
return result;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// dist/s2-decoder.js
|
|
499
|
+
var S2Decoder = withDGGSBoundaryOptions({
|
|
500
|
+
name: "s2",
|
|
501
|
+
hasNumericRepresentation: true,
|
|
502
|
+
cellColumnNames: ["s2", "s2Token", "s2_token", "s2Cell", "s2_cell", "s2CellId", "s2_cell_id"],
|
|
503
|
+
tokenToCell: (s2Token) => getS2IndexFromToken(s2Token),
|
|
504
|
+
cellToToken: (cell) => getS2TokenFromIndex(getS2CellIndex(cell)),
|
|
505
|
+
cellToLngLat: (cell) => getS2LngLat(cell),
|
|
506
|
+
cellToBoundary: (cell) => getS2Boundary(cell),
|
|
507
|
+
cellToBoundaryFlat: (cell) => getS2BoundaryFlat(cell),
|
|
508
|
+
cellToBounds: (cell) => getS2Bounds(cell)
|
|
509
|
+
});
|
|
510
|
+
function getS2LngLat(cell) {
|
|
511
|
+
const s2Index = getS2CellIndex(cell);
|
|
512
|
+
const s2Cell = getS2Cell(s2Index);
|
|
513
|
+
const st = IJToST(s2Cell.ij, s2Cell.level, [0.5, 0.5]);
|
|
514
|
+
const uv = STToUV(st);
|
|
515
|
+
const xyz = FaceUVToXYZ(s2Cell.face, uv);
|
|
516
|
+
const lngLat = XYZToLngLat(xyz);
|
|
517
|
+
return lngLat;
|
|
518
|
+
}
|
|
519
|
+
function getS2BoundaryFlat(cell) {
|
|
520
|
+
const s2Index = getS2CellIndex(cell);
|
|
521
|
+
const float64Array = getS2GeoBounds(s2Index);
|
|
522
|
+
return Array.from(float64Array);
|
|
523
|
+
}
|
|
524
|
+
function getS2Boundary(cell) {
|
|
525
|
+
const flatBoundary = getS2BoundaryFlat(cell);
|
|
526
|
+
const boundary = [];
|
|
527
|
+
for (let i = 0; i < flatBoundary.length; i += 2) {
|
|
528
|
+
boundary.push([flatBoundary[i], flatBoundary[i + 1]]);
|
|
529
|
+
}
|
|
530
|
+
return boundary;
|
|
531
|
+
}
|
|
532
|
+
function getS2Bounds(cell) {
|
|
533
|
+
const s2Cell = getS2Cell(getS2CellIndex(cell));
|
|
534
|
+
if (s2Cell.level === 0) {
|
|
535
|
+
return getS2RootBounds(s2Cell.face);
|
|
536
|
+
}
|
|
537
|
+
const offsets = [
|
|
538
|
+
[0, 0],
|
|
539
|
+
[0, 1],
|
|
540
|
+
[1, 1],
|
|
541
|
+
[1, 0]
|
|
542
|
+
];
|
|
543
|
+
let west = Infinity;
|
|
544
|
+
let south = Infinity;
|
|
545
|
+
let east = -Infinity;
|
|
546
|
+
let north = -Infinity;
|
|
547
|
+
let previousLongitude;
|
|
548
|
+
for (const offset of offsets) {
|
|
549
|
+
const st = IJToST(s2Cell.ij, s2Cell.level, offset);
|
|
550
|
+
const uv = STToUV(st);
|
|
551
|
+
const [x, y, z] = FaceUVToXYZ(s2Cell.face, uv);
|
|
552
|
+
let [longitude, latitude] = XYZToLngLat([x, y, z]);
|
|
553
|
+
if (x === 0 && y === 0 && previousLongitude !== void 0) {
|
|
554
|
+
longitude = previousLongitude;
|
|
555
|
+
}
|
|
556
|
+
if (previousLongitude !== void 0) {
|
|
557
|
+
const longitudeDelta = longitude - previousLongitude;
|
|
558
|
+
longitude += longitudeDelta > 180 ? -360 : longitudeDelta < -180 ? 360 : 0;
|
|
559
|
+
}
|
|
560
|
+
previousLongitude = longitude;
|
|
561
|
+
west = Math.min(west, longitude);
|
|
562
|
+
south = Math.min(south, latitude);
|
|
563
|
+
east = Math.max(east, longitude);
|
|
564
|
+
north = Math.max(north, latitude);
|
|
565
|
+
}
|
|
566
|
+
const angularEpsilon = 2 * Number.EPSILON * 180 / Math.PI;
|
|
567
|
+
return [
|
|
568
|
+
[west - angularEpsilon, Math.max(-90, south - angularEpsilon)],
|
|
569
|
+
[east + angularEpsilon, Math.min(90, north + angularEpsilon)]
|
|
570
|
+
];
|
|
571
|
+
}
|
|
572
|
+
function getS2CellIndex(cell) {
|
|
573
|
+
return typeof cell === "bigint" ? cell : getS2IndexFromToken(cell);
|
|
574
|
+
}
|
|
575
|
+
function getS2RootBounds(face) {
|
|
576
|
+
const polarLatitude = Math.asin(Math.sqrt(1 / 3)) * 180 / Math.PI;
|
|
577
|
+
switch (face) {
|
|
578
|
+
case 0:
|
|
579
|
+
return [
|
|
580
|
+
[-45, -45],
|
|
581
|
+
[45, 45]
|
|
582
|
+
];
|
|
583
|
+
case 1:
|
|
584
|
+
return [
|
|
585
|
+
[45, -45],
|
|
586
|
+
[135, 45]
|
|
587
|
+
];
|
|
588
|
+
case 2:
|
|
589
|
+
return [
|
|
590
|
+
[-180, polarLatitude],
|
|
591
|
+
[180, 90]
|
|
592
|
+
];
|
|
593
|
+
case 3:
|
|
594
|
+
return [
|
|
595
|
+
[135, -45],
|
|
596
|
+
[225, 45]
|
|
597
|
+
];
|
|
598
|
+
case 4:
|
|
599
|
+
return [
|
|
600
|
+
[-135, -45],
|
|
601
|
+
[-45, 45]
|
|
602
|
+
];
|
|
603
|
+
case 5:
|
|
604
|
+
return [
|
|
605
|
+
[-180, -90],
|
|
606
|
+
[180, -polarLatitude]
|
|
607
|
+
];
|
|
608
|
+
default:
|
|
609
|
+
throw new Error(`Invalid S2 face: ${face}`);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// dist/expressions.js
|
|
614
|
+
var GEOHASH_FUNCTION_LIBRARY = {
|
|
615
|
+
getGeohashBoundary: GeohashDecoder.cellToBoundary,
|
|
616
|
+
getGeohashBoundaryFlat: GeohashDecoder.cellToBoundaryFlat,
|
|
617
|
+
getGeohashBounds: GeohashDecoder.cellToBounds,
|
|
618
|
+
getGeohashLngLat: GeohashDecoder.cellToLngLat
|
|
619
|
+
};
|
|
620
|
+
var QUADKEY_FUNCTION_LIBRARY = {
|
|
621
|
+
getQuadkeyBoundary: QuadkeyDecoder.cellToBoundary,
|
|
622
|
+
getQuadkeyBoundaryFlat: QuadkeyDecoder.cellToBoundaryFlat,
|
|
623
|
+
getQuadkeyLngLat: QuadkeyDecoder.cellToLngLat,
|
|
624
|
+
quadkeyToWorldBounds
|
|
625
|
+
};
|
|
626
|
+
var S2_FUNCTION_LIBRARY = {
|
|
627
|
+
getS2BoundaryFlat: S2Decoder.cellToBoundaryFlat,
|
|
628
|
+
getS2ChildIndex,
|
|
629
|
+
getS2IndexFromToken: S2Decoder.tokenToCell,
|
|
630
|
+
getS2TokenFromIndex: S2Decoder.cellToToken
|
|
631
|
+
};
|
|
632
|
+
var DGGS_FUNCTION_LIBRARY = {
|
|
633
|
+
...GEOHASH_FUNCTION_LIBRARY,
|
|
634
|
+
...QUADKEY_FUNCTION_LIBRARY,
|
|
635
|
+
...S2_FUNCTION_LIBRARY
|
|
636
|
+
};
|
|
637
|
+
//# sourceMappingURL=expressions.cjs.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/expressions.ts", "../src/unwrap-dggs-boundary.ts", "../src/dggs-decoder.ts", "../src/geohash-decoder.ts", "../src/quadkey-decoder.ts", "../src/s2-geometry/s2-token.ts", "../src/s2-geometry/s2-geometry.ts", "../src/s2-geometry/s2-to-boundary.ts", "../src/s2-decoder.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACcM,SAAU,mBACd,UACA,oBAA2B;AAE3B,QAAM,SAA6B,SAAS,IAAI,CAAC,CAAC,WAAW,QAAQ,MAAM,CAAC,WAAW,QAAQ,CAAC;AAChG,MAAI,OAAO,WAAW,GA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rary = Record<string, (...args: any[]) => any>;
|
|
2
|
+
export declare const GEOHASH_FUNCTION_LIBRARY: ExpressionFunctionLibrary;
|
|
3
|
+
export declare const QUADKEY_FUNCTION_LIBRARY: ExpressionFunctionLibrary;
|
|
4
|
+
export declare const S2_FUNCTION_LIBRARY: ExpressionFunctionLibrary;
|
|
5
|
+
export declare const DGGS_FUNCTION_LIBRARY: ExpressionFunctionLibrary;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=expressions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../src/expressions.ts"],"names":[],"mappings":"AASA,KAAK,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;AAEzE,eAAO,MAAM,wBAAwB,EAAE,yBAKtC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,yBAKtC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,yBAKjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,yBAInC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return */
|
|
5
|
+
import { GeohashDecoder } from "./geohash-decoder.js";
|
|
6
|
+
import { QuadkeyDecoder, quadkeyToWorldBounds } from "./quadkey-decoder.js";
|
|
7
|
+
import { S2Decoder } from "./s2-decoder.js";
|
|
8
|
+
import { getS2ChildIndex } from "./s2-geometry/s2-token.js";
|
|
9
|
+
export const GEOHASH_FUNCTION_LIBRARY = {
|
|
10
|
+
getGeohashBoundary: GeohashDecoder.cellToBoundary,
|
|
11
|
+
getGeohashBoundaryFlat: GeohashDecoder.cellToBoundaryFlat,
|
|
12
|
+
getGeohashBounds: GeohashDecoder.cellToBounds,
|
|
13
|
+
getGeohashLngLat: GeohashDecoder.cellToLngLat
|
|
14
|
+
};
|
|
15
|
+
export const QUADKEY_FUNCTION_LIBRARY = {
|
|
16
|
+
getQuadkeyBoundary: QuadkeyDecoder.cellToBoundary,
|
|
17
|
+
getQuadkeyBoundaryFlat: QuadkeyDecoder.cellToBoundaryFlat,
|
|
18
|
+
getQuadkeyLngLat: QuadkeyDecoder.cellToLngLat,
|
|
19
|
+
quadkeyToWorldBounds
|
|
20
|
+
};
|
|
21
|
+
export const S2_FUNCTION_LIBRARY = {
|
|
22
|
+
getS2BoundaryFlat: S2Decoder.cellToBoundaryFlat,
|
|
23
|
+
getS2ChildIndex,
|
|
24
|
+
getS2IndexFromToken: S2Decoder.tokenToCell,
|
|
25
|
+
getS2TokenFromIndex: S2Decoder.cellToToken
|
|
26
|
+
};
|
|
27
|
+
export const DGGS_FUNCTION_LIBRARY = {
|
|
28
|
+
...GEOHASH_FUNCTION_LIBRARY,
|
|
29
|
+
...QUADKEY_FUNCTION_LIBRARY,
|
|
30
|
+
...S2_FUNCTION_LIBRARY
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=expressions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expressions.js","sourceRoot":"","sources":["../src/expressions.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,4FAA4F;AAE5F,OAAO,EAAC,cAAc,EAAC,6BAA0B;AACjD,OAAO,EAAC,cAAc,EAAE,oBAAoB,EAAC,6BAA0B;AACvE,OAAO,EAAC,SAAS,EAAC,wBAAqB;AACvC,OAAO,EAAC,eAAe,EAAC,kCAA+B;AAGvD,MAAM,CAAC,MAAM,wBAAwB,GAA8B;IACjE,kBAAkB,EAAE,cAAc,CAAC,cAAc;IACjD,sBAAsB,EAAE,cAAc,CAAC,kBAAkB;IACzD,gBAAgB,EAAE,cAAc,CAAC,YAAY;IAC7C,gBAAgB,EAAE,cAAc,CAAC,YAAY;CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAA8B;IACjE,kBAAkB,EAAE,cAAc,CAAC,cAAc;IACjD,sBAAsB,EAAE,cAAc,CAAC,kBAAkB;IACzD,gBAAgB,EAAE,cAAc,CAAC,YAAY;IAC7C,oBAAoB;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAA8B;IAC5D,iBAAiB,EAAE,SAAS,CAAC,kBAAkB;IAC/C,eAAe;IACf,mBAAmB,EAAE,SAAS,CAAC,WAAW;IAC1C,mBAAmB,EAAE,SAAS,CAAC,WAAW;CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAA8B;IAC9D,GAAG,wBAAwB;IAC3B,GAAG,wBAAwB;IAC3B,GAAG,mBAAmB;CACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geohash-decoder.d.ts","sourceRoot":"","sources":["../src/geohash-decoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"geohash-decoder.d.ts","sourceRoot":"","sources":["../src/geohash-decoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,0BAAuB;AAExB,mCAAmC;AACnC,eAAO,MAAM,cAAc;;;;kCAIJ,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;oCAEzB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;wCAEzB,QAAQ,KAAG,MAAM,EAAE;kCAEzB,QAAQ,KAAG,QAAQ;0IACT,CAAC;AAqClC;;GAEG;AAEH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAsC1D"}
|
package/dist/h3-decoder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Bounds2D } from '@math.gl/types';
|
|
1
|
+
import { type Bounds2D } from '@math.gl/core/types';
|
|
2
2
|
import { type DGGSCell, type DGGSDecoder } from "./dggs-decoder.js";
|
|
3
3
|
/** Lightweight cell geometry decoder for the H3 hexagonal DGGS. */
|
|
4
4
|
export declare const H3Decoder: Omit<{
|
package/dist/h3-decoder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h3-decoder.d.ts","sourceRoot":"","sources":["../src/h3-decoder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"h3-decoder.d.ts","sourceRoot":"","sources":["../src/h3-decoder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,0BAAuB;AAExB,mEAAmE;AACnE,eAAO,MAAM,SAAS;;;;kCAaC,MAAM,KAAG,MAAM;iCAChB,QAAQ,KAAG,MAAM;kCAChB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;oCACzB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;wCACzB,QAAQ,KAAG,MAAM,EAAE;kCACzB,QAAQ,KAAG,QAAQ;0IACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plus-code-decoder.d.ts","sourceRoot":"","sources":["../src/plus-code-decoder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"plus-code-decoder.d.ts","sourceRoot":"","sources":["../src/plus-code-decoder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,0BAAuB;AAIxB;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;kCAIL,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;oCACzB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;wCACzB,QAAQ,KAAG,MAAM,EAAE;kCAIzB,QAAQ,KAAG,QAAQ;0IAOT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quadkey-decoder.d.ts","sourceRoot":"","sources":["../src/quadkey-decoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"quadkey-decoder.d.ts","sourceRoot":"","sources":["../src/quadkey-decoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,0BAAuB;AAIxB,mCAAmC;AACnC,eAAO,MAAM,cAAc;;;;kCAIJ,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;oCAEzB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;wCAEzB,QAAQ,KAAG,MAAM,EAAE;kCAEzB,QAAQ,KAAG,QAAQ;0IACT,CAAC;AAuClC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgB1F"}
|
package/dist/s2-decoder.d.ts
CHANGED
package/dist/s2-decoder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s2-decoder.d.ts","sourceRoot":"","sources":["../src/s2-decoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"s2-decoder.d.ts","sourceRoot":"","sources":["../src/s2-decoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAA0B,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAC,0BAAuB;AAMxF,8BAA8B;AAC9B,eAAO,MAAM,SAAS;;;;oCAIG,MAAM,KAAG,MAAM;iCAClB,QAAQ,KAAG,MAAM;kCAChB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC;oCACzB,QAAQ,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;wCACzB,QAAQ,KAAG,MAAM,EAAE;kCACzB,QAAQ,KAAG,QAAQ;0IACT,CAAC;AAElC;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAU5D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,CAK1D;AAWD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CA4CpD"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
|
-
"version": "5.0.0-alpha.
|
|
9
|
+
"version": "5.0.0-alpha.19",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"javascript",
|
|
12
12
|
"math",
|
|
@@ -61,6 +61,11 @@
|
|
|
61
61
|
"types": "./dist/s2.d.ts",
|
|
62
62
|
"import": "./dist/s2.js",
|
|
63
63
|
"require": "./dist/s2.cjs"
|
|
64
|
+
},
|
|
65
|
+
"./expressions": {
|
|
66
|
+
"types": "./dist/expressions.d.ts",
|
|
67
|
+
"import": "./dist/expressions.js",
|
|
68
|
+
"require": "./dist/expressions.cjs"
|
|
64
69
|
}
|
|
65
70
|
},
|
|
66
71
|
"files": [
|
|
@@ -68,7 +73,7 @@
|
|
|
68
73
|
"src"
|
|
69
74
|
],
|
|
70
75
|
"dependencies": {
|
|
71
|
-
"@math.gl/
|
|
76
|
+
"@math.gl/core": "5.0.0-alpha.19",
|
|
72
77
|
"a5-js": "^0.10.0",
|
|
73
78
|
"h3-js": "^4.5.0",
|
|
74
79
|
"open-location-code": "^1.0.3"
|
|
@@ -76,5 +81,5 @@
|
|
|
76
81
|
"devDependencies": {
|
|
77
82
|
"s2-geometry": "^1.2.10"
|
|
78
83
|
},
|
|
79
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "f5700027934faf25c37230905c7ffa14d7f677a7"
|
|
80
85
|
}
|
package/src/a5-decoder.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {cellToBoundary, cellToLonLat, hexToU64, u64ToHex} from 'a5-js';
|
|
6
|
-
import {type Bounds2D} from '@math.gl/types';
|
|
6
|
+
import {type Bounds2D} from '@math.gl/core/types';
|
|
7
7
|
import {
|
|
8
8
|
withDGGSBoundaryOptions,
|
|
9
9
|
type DGGSCell,
|
|
@@ -6,7 +6,7 @@ import {getS2Cell} from '../s2-geometry/s2-geometry';
|
|
|
6
6
|
import {getS2Region} from './s2-to-region';
|
|
7
7
|
import {getS2IndexFromToken} from '../s2-geometry/s2-token';
|
|
8
8
|
|
|
9
|
-
// import {OrientedBoundingBox, makeOrientedBoundingBoxFromPoints} from '@math.gl/culling';
|
|
9
|
+
// import {OrientedBoundingBox, makeOrientedBoundingBoxFromPoints} from '@math.gl/geometry/culling';
|
|
10
10
|
// import {Ellipsoid} from '@math.gl/geospatial';
|
|
11
11
|
|
|
12
12
|
export type S2HeightInfo = {
|
package/src/dggs-decoder.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {type Bounds2D} from '@math.gl/types';
|
|
5
|
+
import {type Bounds2D} from '@math.gl/core/types';
|
|
6
6
|
import {unwrapDGGSBoundary} from './unwrap-dggs-boundary';
|
|
7
7
|
|
|
8
8
|
/** Optional continuous-longitude geometry output for DGGS decoders. */
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return */
|
|
5
|
+
|
|
6
|
+
import {GeohashDecoder} from './geohash-decoder';
|
|
7
|
+
import {QuadkeyDecoder, quadkeyToWorldBounds} from './quadkey-decoder';
|
|
8
|
+
import {S2Decoder} from './s2-decoder';
|
|
9
|
+
import {getS2ChildIndex} from './s2-geometry/s2-token';
|
|
10
|
+
type ExpressionFunctionLibrary = Record<string, (...args: any[]) => any>;
|
|
11
|
+
|
|
12
|
+
export const GEOHASH_FUNCTION_LIBRARY: ExpressionFunctionLibrary = {
|
|
13
|
+
getGeohashBoundary: GeohashDecoder.cellToBoundary,
|
|
14
|
+
getGeohashBoundaryFlat: GeohashDecoder.cellToBoundaryFlat,
|
|
15
|
+
getGeohashBounds: GeohashDecoder.cellToBounds,
|
|
16
|
+
getGeohashLngLat: GeohashDecoder.cellToLngLat
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const QUADKEY_FUNCTION_LIBRARY: ExpressionFunctionLibrary = {
|
|
20
|
+
getQuadkeyBoundary: QuadkeyDecoder.cellToBoundary,
|
|
21
|
+
getQuadkeyBoundaryFlat: QuadkeyDecoder.cellToBoundaryFlat,
|
|
22
|
+
getQuadkeyLngLat: QuadkeyDecoder.cellToLngLat,
|
|
23
|
+
quadkeyToWorldBounds
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const S2_FUNCTION_LIBRARY: ExpressionFunctionLibrary = {
|
|
27
|
+
getS2BoundaryFlat: S2Decoder.cellToBoundaryFlat,
|
|
28
|
+
getS2ChildIndex,
|
|
29
|
+
getS2IndexFromToken: S2Decoder.tokenToCell,
|
|
30
|
+
getS2TokenFromIndex: S2Decoder.cellToToken
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const DGGS_FUNCTION_LIBRARY: ExpressionFunctionLibrary = {
|
|
34
|
+
...GEOHASH_FUNCTION_LIBRARY,
|
|
35
|
+
...QUADKEY_FUNCTION_LIBRARY,
|
|
36
|
+
...S2_FUNCTION_LIBRARY
|
|
37
|
+
};
|
package/src/geohash-decoder.ts
CHANGED
package/src/h3-decoder.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {cellToBoundary, cellToLatLng} from 'h3-js';
|
|
6
|
-
import {type Bounds2D} from '@math.gl/types';
|
|
6
|
+
import {type Bounds2D} from '@math.gl/core/types';
|
|
7
7
|
import {
|
|
8
8
|
withDGGSBoundaryOptions,
|
|
9
9
|
type DGGSCell,
|
package/src/plus-code-decoder.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import OpenLocationCodePackage, {type OpenLocationCodeArea} from 'open-location-code';
|
|
6
|
-
import {type Bounds2D} from '@math.gl/types';
|
|
6
|
+
import {type Bounds2D} from '@math.gl/core/types';
|
|
7
7
|
import {
|
|
8
8
|
withDGGSBoundaryOptions,
|
|
9
9
|
type DGGSCell,
|
package/src/quadkey-decoder.ts
CHANGED
package/src/s2-decoder.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {type Bounds2D} from '@math.gl/types';
|
|
5
|
+
import {type Bounds2D} from '@math.gl/core/types';
|
|
6
6
|
import {withDGGSBoundaryOptions, type DGGSCell, type DGGSDecoder} from './dggs-decoder';
|
|
7
7
|
|
|
8
8
|
import {getS2IndexFromToken, getS2TokenFromIndex} from './s2-geometry/s2-token';
|