@loaders.gl/arcgis 5.0.0-beta.4 → 5.0.0-beta.6
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 +1 -1
- package/dist/index.cjs +170 -236
- package/dist/index.cjs.map +3 -3
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -367,6 +367,7 @@ async function loadLibraryInWorker(libraryUrl, moduleLibraryUrl = libraryUrl) {
|
|
|
367
367
|
} catch {
|
|
368
368
|
const moduleUrl = new URL(moduleLibraryUrl, globalThis.location.href).href;
|
|
369
369
|
const library = await import(
|
|
370
|
+
/* webpackIgnore: true */
|
|
370
371
|
/* @vite-ignore */
|
|
371
372
|
moduleUrl
|
|
372
373
|
);
|
|
@@ -427,12 +428,10 @@ var init_library_utils = __esm({
|
|
|
427
428
|
});
|
|
428
429
|
|
|
429
430
|
// ../core/src/worker-utils/index.ts
|
|
430
|
-
var import_tasks;
|
|
431
431
|
var init_worker_utils = __esm({
|
|
432
432
|
"../core/src/worker-utils/index.ts"() {
|
|
433
433
|
"use strict";
|
|
434
434
|
init_globals2();
|
|
435
|
-
import_tasks = require("@math.gl/core/tasks");
|
|
436
435
|
init_library_utils();
|
|
437
436
|
}
|
|
438
437
|
});
|
|
@@ -1829,6 +1828,8 @@ var init_http_file_transport = __esm({
|
|
|
1829
1828
|
identityHints;
|
|
1830
1829
|
/** Failure objects already included in telemetry. */
|
|
1831
1830
|
countedFailures = /* @__PURE__ */ new WeakSet();
|
|
1831
|
+
/** Observer for cumulative transport counters, including asynchronous cancellation. */
|
|
1832
|
+
onTelemetry;
|
|
1832
1833
|
/** Mutable counters backing immutable telemetry snapshots. */
|
|
1833
1834
|
telemetry = {
|
|
1834
1835
|
requestedBytes: 0,
|
|
@@ -1842,6 +1843,7 @@ var init_http_file_transport = __esm({
|
|
|
1842
1843
|
constructor(url, options) {
|
|
1843
1844
|
validateKnownByteLength(options.byteLength);
|
|
1844
1845
|
this.url = url;
|
|
1846
|
+
this.onTelemetry = options.onTelemetry;
|
|
1845
1847
|
this.fetchFunction = options.fetch || ((input, init) => globalThis.fetch(input, init));
|
|
1846
1848
|
this.fetchOptions = options.fetchOptions ? { ...options.fetchOptions, headers: new Headers(options.fetchOptions.headers) } : void 0;
|
|
1847
1849
|
this.consistency = options.consistency || "best-effort";
|
|
@@ -1868,6 +1870,7 @@ var init_http_file_transport = __esm({
|
|
|
1868
1870
|
}
|
|
1869
1871
|
/** Counts each failure object once even when it passes through several async layers. */
|
|
1870
1872
|
trackFailure(error) {
|
|
1873
|
+
var _a2;
|
|
1871
1874
|
if (typeof error === "object" && error !== null) {
|
|
1872
1875
|
if (this.countedFailures.has(error)) {
|
|
1873
1876
|
return;
|
|
@@ -1879,10 +1882,11 @@ var init_http_file_transport = __esm({
|
|
|
1879
1882
|
} else {
|
|
1880
1883
|
this.telemetry.errorCount++;
|
|
1881
1884
|
}
|
|
1885
|
+
(_a2 = this.onTelemetry) == null ? void 0 : _a2.call(this, this.getTelemetry(), error);
|
|
1882
1886
|
}
|
|
1883
1887
|
/** Performs and validates one exact HTTP range request. */
|
|
1884
1888
|
async requestRange(offset, length, signal, expectedIdentity) {
|
|
1885
|
-
var _a2;
|
|
1889
|
+
var _a2, _b;
|
|
1886
1890
|
const requestStartTime = getTimestamp2();
|
|
1887
1891
|
const abortContext = createCombinedAbortContext(signal, (_a2 = this.fetchOptions) == null ? void 0 : _a2.signal);
|
|
1888
1892
|
this.telemetry.requestCount++;
|
|
@@ -1899,7 +1903,13 @@ var init_http_file_transport = __esm({
|
|
|
1899
1903
|
await cancelResponse(response);
|
|
1900
1904
|
throw new Error(`HTTP byte-range request expected 206, received ${response.status}`);
|
|
1901
1905
|
}
|
|
1902
|
-
const contentRange = await readContentRange(response)
|
|
1906
|
+
const contentRange = response.headers.has("Content-Range") ? await readContentRange(response) : await this.inferContentRange(
|
|
1907
|
+
response,
|
|
1908
|
+
offset,
|
|
1909
|
+
length,
|
|
1910
|
+
expectedIdentity,
|
|
1911
|
+
abortContext.signal
|
|
1912
|
+
);
|
|
1903
1913
|
const responseIdentity = getResponseIdentity(response, contentRange.byteLength);
|
|
1904
1914
|
const responseError = getIdentityError(
|
|
1905
1915
|
expectedIdentity,
|
|
@@ -1933,6 +1943,45 @@ var init_http_file_transport = __esm({
|
|
|
1933
1943
|
} finally {
|
|
1934
1944
|
abortContext.removeAbortListeners();
|
|
1935
1945
|
this.telemetry.networkTimeMs += getTimestamp2() - requestStartTime;
|
|
1946
|
+
(_b = this.onTelemetry) == null ? void 0 : _b.call(this, this.getTelemetry());
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
/** Infers bounds for a CORS-filtered 206; the caller still validates the body length. */
|
|
1950
|
+
async inferContentRange(response, offset, length, expectedIdentity, signal) {
|
|
1951
|
+
var _a2;
|
|
1952
|
+
try {
|
|
1953
|
+
let byteLength = (expectedIdentity == null ? void 0 : expectedIdentity.byteLength) ?? this.identityHints.byteLength;
|
|
1954
|
+
if (byteLength === void 0) {
|
|
1955
|
+
const headers = new Headers((_a2 = this.fetchOptions) == null ? void 0 : _a2.headers);
|
|
1956
|
+
headers.delete("Range");
|
|
1957
|
+
this.telemetry.requestCount++;
|
|
1958
|
+
const metadata = await this.fetchFunction(this.url, {
|
|
1959
|
+
...this.fetchOptions,
|
|
1960
|
+
method: "HEAD",
|
|
1961
|
+
body: void 0,
|
|
1962
|
+
headers,
|
|
1963
|
+
signal
|
|
1964
|
+
});
|
|
1965
|
+
await cancelResponse(metadata);
|
|
1966
|
+
const value = metadata.headers.get("Content-Length");
|
|
1967
|
+
byteLength = value && /^\d+$/.test(value) ? Number(value) : NaN;
|
|
1968
|
+
if (metadata.status !== 200 || !Number.isSafeInteger(byteLength) || byteLength < offset + length) {
|
|
1969
|
+
throw new Error(
|
|
1970
|
+
"HTTP byte-range response is missing Content-Range and HEAD did not provide a valid file length"
|
|
1971
|
+
);
|
|
1972
|
+
}
|
|
1973
|
+
const identityError = getIdentityError(
|
|
1974
|
+
getResponseIdentity(metadata, byteLength),
|
|
1975
|
+
getResponseIdentity(response, byteLength),
|
|
1976
|
+
this.identityHints,
|
|
1977
|
+
this.consistency
|
|
1978
|
+
);
|
|
1979
|
+
if (identityError) throw new Error(identityError);
|
|
1980
|
+
}
|
|
1981
|
+
return { offset, endOffset: offset + length - 1, byteLength };
|
|
1982
|
+
} catch (error) {
|
|
1983
|
+
await cancelResponse(response);
|
|
1984
|
+
throw error;
|
|
1936
1985
|
}
|
|
1937
1986
|
}
|
|
1938
1987
|
/** Validates and consumes the special empty-object identity response. */
|
|
@@ -2182,7 +2231,7 @@ function getSourceLoaderOptions(options) {
|
|
|
2182
2231
|
if (options == null ? void 0 : options.core) {
|
|
2183
2232
|
loadOptions.core = { ...options.core };
|
|
2184
2233
|
const parserCore = loadOptions.core;
|
|
2185
|
-
for (const key of ["type", "attributions", "loaders", "onError", "loadOptions"]) {
|
|
2234
|
+
for (const key of ["type", "name", "attributions", "loaders", "onError", "loadOptions"]) {
|
|
2186
2235
|
delete parserCore[key];
|
|
2187
2236
|
}
|
|
2188
2237
|
if (Object.keys(parserCore).length === 0) {
|
|
@@ -2217,6 +2266,44 @@ function unavailableCoreApiMethod(methodName) {
|
|
|
2217
2266
|
);
|
|
2218
2267
|
};
|
|
2219
2268
|
}
|
|
2269
|
+
function getDataSourceName(data, options) {
|
|
2270
|
+
var _a2, _b, _c;
|
|
2271
|
+
const explicitName = (_a2 = options.core) == null ? void 0 : _a2.name;
|
|
2272
|
+
if (explicitName !== void 0) {
|
|
2273
|
+
if (typeof explicitName !== "string" || !explicitName.trim())
|
|
2274
|
+
throw new Error("Data source name must be a non-empty string.");
|
|
2275
|
+
return explicitName;
|
|
2276
|
+
}
|
|
2277
|
+
if (data && typeof data === "object") {
|
|
2278
|
+
const named = data;
|
|
2279
|
+
if (typeof named.name === "string" && named.name.trim())
|
|
2280
|
+
return data instanceof Blob ? removeFileExtension(named.name) : named.name;
|
|
2281
|
+
const metadata = (_b = named.schema) == null ? void 0 : _b.metadata;
|
|
2282
|
+
const embeddedName = metadata instanceof Map ? metadata.get("name") : metadata == null ? void 0 : metadata.name;
|
|
2283
|
+
if (typeof embeddedName === "string" && embeddedName.trim()) return embeddedName;
|
|
2284
|
+
}
|
|
2285
|
+
if (typeof data === "string") {
|
|
2286
|
+
try {
|
|
2287
|
+
const url = new URL(data.replace(/\\/g, "/"), "https://source.invalid/");
|
|
2288
|
+
if (!["data:", "blob:"].includes(url.protocol)) {
|
|
2289
|
+
let basename = url.pathname.split("/").filter(Boolean).pop();
|
|
2290
|
+
if (basename) {
|
|
2291
|
+
try {
|
|
2292
|
+
basename = decodeURIComponent(basename);
|
|
2293
|
+
} catch {
|
|
2294
|
+
}
|
|
2295
|
+
return removeFileExtension(basename);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
} catch {
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
return ((_c = options.core) == null ? void 0 : _c.type) && options.core.type !== "auto" ? options.core.type : "source";
|
|
2302
|
+
}
|
|
2303
|
+
function removeFileExtension(name) {
|
|
2304
|
+
const extension = name.lastIndexOf(".");
|
|
2305
|
+
return extension > 0 ? name.slice(0, extension) : name;
|
|
2306
|
+
}
|
|
2220
2307
|
var UNAVAILABLE_CORE_API, DataSource;
|
|
2221
2308
|
var init_data_source = __esm({
|
|
2222
2309
|
"../core/src/loader-utils/lib/sources/data-source.ts"() {
|
|
@@ -2248,6 +2335,8 @@ var init_data_source = __esm({
|
|
|
2248
2335
|
options;
|
|
2249
2336
|
data;
|
|
2250
2337
|
url;
|
|
2338
|
+
/** Stable query-visible name, resolved without fetching source data. */
|
|
2339
|
+
name;
|
|
2251
2340
|
/** Shared parser options derived from the source options, excluding source-only core controls. */
|
|
2252
2341
|
loadOptions;
|
|
2253
2342
|
/** A resolved fetch function extracted from the shared core options. */
|
|
@@ -2264,6 +2353,7 @@ var init_data_source = __esm({
|
|
|
2264
2353
|
);
|
|
2265
2354
|
this.data = data;
|
|
2266
2355
|
this.url = typeof data === "string" ? resolvePath(data) : "";
|
|
2356
|
+
this.name = getDataSourceName(data, this.options);
|
|
2267
2357
|
const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(this.options));
|
|
2268
2358
|
this.loadOptions = loadOptions;
|
|
2269
2359
|
const fetch2 = getFetchFunction(loadOptions);
|
|
@@ -2272,6 +2362,9 @@ var init_data_source = __esm({
|
|
|
2272
2362
|
this.fetch = fetch2;
|
|
2273
2363
|
}
|
|
2274
2364
|
setProps(options) {
|
|
2365
|
+
var _a2;
|
|
2366
|
+
if (((_a2 = options.core) == null ? void 0 : _a2.name) !== void 0 && options.core.name !== this.name)
|
|
2367
|
+
throw new Error("Data source names are fixed at creation.");
|
|
2275
2368
|
const mergedOptions = mergeOptions(this.options, options);
|
|
2276
2369
|
const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(mergedOptions));
|
|
2277
2370
|
this.options = mergedOptions;
|
|
@@ -3820,7 +3913,7 @@ function convertGeometryToWKT(geometry, options) {
|
|
|
3820
3913
|
if (geometry.geometries.length === 0) return "GEOMETRYCOLLECTION EMPTY";
|
|
3821
3914
|
return `GEOMETRYCOLLECTION (${geometry.geometries.map((child) => convertGeometryToWKT(child)).join(", ")})`;
|
|
3822
3915
|
}
|
|
3823
|
-
return (0,
|
|
3916
|
+
return (0, import_wkb.formatWKT)(normalizeGeometryDimension(geometry, dimension), dimension);
|
|
3824
3917
|
}
|
|
3825
3918
|
function normalizeGeometryDimension(geometry, dimension) {
|
|
3826
3919
|
if (geometry.type === "GeometryCollection") {
|
|
@@ -3879,11 +3972,11 @@ function getFirstCoordinate(geometry) {
|
|
|
3879
3972
|
function getDimensionSize(dimension) {
|
|
3880
3973
|
return dimension === "xy" ? 2 : dimension === "xyzm" ? 4 : 3;
|
|
3881
3974
|
}
|
|
3882
|
-
var
|
|
3975
|
+
var import_wkb;
|
|
3883
3976
|
var init_geometry_to_wkt = __esm({
|
|
3884
3977
|
"../core/src/arrow-geometry/geometry-to-wkt.ts"() {
|
|
3885
3978
|
"use strict";
|
|
3886
|
-
|
|
3979
|
+
import_wkb = require("@math.gl/arrow/wkb");
|
|
3887
3980
|
}
|
|
3888
3981
|
});
|
|
3889
3982
|
|
|
@@ -3897,7 +3990,7 @@ function convertGeometryToWKB(input, options = {}) {
|
|
|
3897
3990
|
}
|
|
3898
3991
|
function encodeGeometry(geometry, dimension) {
|
|
3899
3992
|
if (geometry.type !== "GeometryCollection") {
|
|
3900
|
-
return (0,
|
|
3993
|
+
return (0, import_wkb2.writeWKB)(geometry, dimension);
|
|
3901
3994
|
}
|
|
3902
3995
|
const children = geometry.geometries.map(
|
|
3903
3996
|
(child) => encodeGeometry(
|
|
@@ -3905,13 +3998,13 @@ function encodeGeometry(geometry, dimension) {
|
|
|
3905
3998
|
child.__geoarrowDimension ?? dimension
|
|
3906
3999
|
)
|
|
3907
4000
|
);
|
|
3908
|
-
const headerBuilder = new
|
|
4001
|
+
const headerBuilder = new import_wkb2.WKBBuilder({ mode: "measure", dimension });
|
|
3909
4002
|
headerBuilder.beginGeometry("GeometryCollection", children.length);
|
|
3910
4003
|
const headerLength = headerBuilder.finishGeometry();
|
|
3911
4004
|
const bytes = new Uint8Array(
|
|
3912
4005
|
headerLength + children.reduce((total, child) => total + child.length, 0)
|
|
3913
4006
|
);
|
|
3914
|
-
const writer = new
|
|
4007
|
+
const writer = new import_wkb2.WKBBuilder({ mode: "write", target: bytes, dimension });
|
|
3915
4008
|
writer.beginGeometry("GeometryCollection", children.length);
|
|
3916
4009
|
let byteOffset = writer.finishGeometry();
|
|
3917
4010
|
for (const child of children) {
|
|
@@ -3920,11 +4013,11 @@ function encodeGeometry(geometry, dimension) {
|
|
|
3920
4013
|
}
|
|
3921
4014
|
return bytes;
|
|
3922
4015
|
}
|
|
3923
|
-
var
|
|
4016
|
+
var import_wkb2;
|
|
3924
4017
|
var init_geometry_codecs = __esm({
|
|
3925
4018
|
"../core/src/arrow-geometry/geometry-codecs.ts"() {
|
|
3926
4019
|
"use strict";
|
|
3927
|
-
|
|
4020
|
+
import_wkb2 = require("@math.gl/arrow/wkb");
|
|
3928
4021
|
init_geometry_to_wkt();
|
|
3929
4022
|
}
|
|
3930
4023
|
});
|
|
@@ -9856,109 +9949,7 @@ var init_usd = __esm({
|
|
|
9856
9949
|
}
|
|
9857
9950
|
});
|
|
9858
9951
|
|
|
9859
|
-
// ../core/src/
|
|
9860
|
-
function splitArrowBuffers(input, options = {}) {
|
|
9861
|
-
const context = { ...options, copies: /* @__PURE__ */ new WeakMap() };
|
|
9862
|
-
if (isArrowTable(input)) {
|
|
9863
|
-
return splitArrowTableBuffersInternal(input, context);
|
|
9864
|
-
}
|
|
9865
|
-
if (isArrowRecordBatch(input)) {
|
|
9866
|
-
return splitArrowRecordBatchBuffers(input, context);
|
|
9867
|
-
}
|
|
9868
|
-
if (isArrowVector(input)) {
|
|
9869
|
-
return splitArrowVectorBuffers(input, context);
|
|
9870
|
-
}
|
|
9871
|
-
return splitArrowDataBuffers(input, context);
|
|
9872
|
-
}
|
|
9873
|
-
function isArrowTable(input) {
|
|
9874
|
-
return "batches" in input;
|
|
9875
|
-
}
|
|
9876
|
-
function isArrowRecordBatch(input) {
|
|
9877
|
-
return "schema" in input && "data" in input && !Array.isArray(input.data);
|
|
9878
|
-
}
|
|
9879
|
-
function isArrowVector(input) {
|
|
9880
|
-
return "data" in input && Array.isArray(input.data);
|
|
9881
|
-
}
|
|
9882
|
-
function splitArrowTableBuffersInternal(table, options) {
|
|
9883
|
-
const recordBatches = table.batches.map(
|
|
9884
|
-
(recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options)
|
|
9885
|
-
);
|
|
9886
|
-
return new arrow8.Table(table.schema, recordBatches);
|
|
9887
|
-
}
|
|
9888
|
-
function splitArrowRecordBatchBuffers(recordBatch, options) {
|
|
9889
|
-
return new arrow8.RecordBatch(
|
|
9890
|
-
recordBatch.schema,
|
|
9891
|
-
splitArrowDataBuffers(recordBatch.data, options)
|
|
9892
|
-
);
|
|
9893
|
-
}
|
|
9894
|
-
function splitArrowDataBuffers(data, options) {
|
|
9895
|
-
const children = data.children.map((childData) => splitArrowDataBuffers(childData, options));
|
|
9896
|
-
const dictionary = data.dictionary ? splitArrowVectorBuffers(data.dictionary, options) : void 0;
|
|
9897
|
-
const buffers = {
|
|
9898
|
-
[arrow8.BufferType.OFFSET]: splitArrowBuffer(data.buffers[arrow8.BufferType.OFFSET], options),
|
|
9899
|
-
[arrow8.BufferType.DATA]: splitArrowBuffer(data.buffers[arrow8.BufferType.DATA], options),
|
|
9900
|
-
[arrow8.BufferType.VALIDITY]: splitArrowBuffer(data.buffers[arrow8.BufferType.VALIDITY], options),
|
|
9901
|
-
[arrow8.BufferType.TYPE]: splitArrowBuffer(data.buffers[arrow8.BufferType.TYPE], options)
|
|
9902
|
-
};
|
|
9903
|
-
return new arrow8.Data(
|
|
9904
|
-
data.type,
|
|
9905
|
-
data.offset,
|
|
9906
|
-
data.length,
|
|
9907
|
-
// @ts-expect-error _nullCount is protected. Reuse it to preserve lazy null-count state.
|
|
9908
|
-
data._nullCount,
|
|
9909
|
-
buffers,
|
|
9910
|
-
children,
|
|
9911
|
-
dictionary
|
|
9912
|
-
);
|
|
9913
|
-
}
|
|
9914
|
-
function splitArrowVectorBuffers(vector, options) {
|
|
9915
|
-
return new arrow8.Vector(vector.data.map((data) => splitArrowDataBuffers(data, options)));
|
|
9916
|
-
}
|
|
9917
|
-
function splitArrowBuffer(array, options) {
|
|
9918
|
-
if (!isArrowTypedArray(array)) {
|
|
9919
|
-
return array;
|
|
9920
|
-
}
|
|
9921
|
-
if (options.copy === "none") {
|
|
9922
|
-
return array;
|
|
9923
|
-
}
|
|
9924
|
-
if (options.copy !== "all" && array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {
|
|
9925
|
-
return array;
|
|
9926
|
-
}
|
|
9927
|
-
let copy = options.copies.get(array);
|
|
9928
|
-
if (!copy) {
|
|
9929
|
-
copy = array.slice();
|
|
9930
|
-
options.copies.set(array, copy);
|
|
9931
|
-
}
|
|
9932
|
-
return copy;
|
|
9933
|
-
}
|
|
9934
|
-
function isArrowTypedArray(value) {
|
|
9935
|
-
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
9936
|
-
}
|
|
9937
|
-
var arrow8;
|
|
9938
|
-
var init_split_arrow_buffers = __esm({
|
|
9939
|
-
"../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts"() {
|
|
9940
|
-
"use strict";
|
|
9941
|
-
arrow8 = __toESM(require("apache-arrow"), 1);
|
|
9942
|
-
}
|
|
9943
|
-
});
|
|
9944
|
-
|
|
9945
|
-
// ../core/src/schema-utils/lib/arrow/arrow-table-transport.ts
|
|
9946
|
-
function dehydrateArrowTable(table, options) {
|
|
9947
|
-
const splitTable = splitArrowBuffers(table, options);
|
|
9948
|
-
return {
|
|
9949
|
-
shape: "arrow-table",
|
|
9950
|
-
transport: "arrow-js",
|
|
9951
|
-
schema: serializeArrowSchema(splitTable.schema),
|
|
9952
|
-
batches: splitTable.batches.map((recordBatch) => dehydrateArrowRecordBatch(recordBatch))
|
|
9953
|
-
};
|
|
9954
|
-
}
|
|
9955
|
-
function hydrateArrowTable(table) {
|
|
9956
|
-
const schema = deserializeArrowSchema(table.schema);
|
|
9957
|
-
const recordBatches = table.batches.map(
|
|
9958
|
-
(recordBatch) => new arrow9.RecordBatch(schema, hydrateArrowData(recordBatch.data))
|
|
9959
|
-
);
|
|
9960
|
-
return new arrow9.Table(schema, recordBatches);
|
|
9961
|
-
}
|
|
9952
|
+
// ../core/src/arrow-worker-transport.ts
|
|
9962
9953
|
function serializeArrowWorkerResult(result, options) {
|
|
9963
9954
|
var _a2;
|
|
9964
9955
|
if (!isArrowTableWrapper(result)) {
|
|
@@ -9968,14 +9959,14 @@ function serializeArrowWorkerResult(result, options) {
|
|
|
9968
9959
|
const bufferCopyMode = ((_a2 = workerOptions == null ? void 0 : workerOptions.core) == null ? void 0 : _a2.workerTransferBufferCopy) ?? (workerOptions == null ? void 0 : workerOptions.workerTransferBufferCopy);
|
|
9969
9960
|
return {
|
|
9970
9961
|
...result,
|
|
9971
|
-
data: dehydrateArrowTable(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
9962
|
+
data: (0, import_arrow.dehydrateArrowTable)(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
9972
9963
|
};
|
|
9973
9964
|
}
|
|
9974
9965
|
function deserializeArrowWorkerResult(result) {
|
|
9975
9966
|
if (!isDehydratedArrowTableWrapper(result)) {
|
|
9976
9967
|
return result;
|
|
9977
9968
|
}
|
|
9978
|
-
return { ...result, data: hydrateArrowTable(result.data) };
|
|
9969
|
+
return { ...result, data: (0, import_arrow.hydrateArrowTable)(result.data) };
|
|
9979
9970
|
}
|
|
9980
9971
|
function isArrowTableWrapper(value) {
|
|
9981
9972
|
const table = value;
|
|
@@ -9989,61 +9980,11 @@ function isDehydratedArrowTableWrapper(value) {
|
|
|
9989
9980
|
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
9990
9981
|
);
|
|
9991
9982
|
}
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
function dehydrateArrowData(data) {
|
|
9996
|
-
return {
|
|
9997
|
-
type: serializeArrowType(data.type),
|
|
9998
|
-
offset: data.offset,
|
|
9999
|
-
length: data.length,
|
|
10000
|
-
// @ts-expect-error _nullCount is protected. Preserve the Arrow lazy null-count state.
|
|
10001
|
-
nullCount: data._nullCount,
|
|
10002
|
-
buffers: {
|
|
10003
|
-
[arrow9.BufferType.OFFSET]: data.buffers[arrow9.BufferType.OFFSET],
|
|
10004
|
-
[arrow9.BufferType.DATA]: data.buffers[arrow9.BufferType.DATA],
|
|
10005
|
-
[arrow9.BufferType.VALIDITY]: data.buffers[arrow9.BufferType.VALIDITY],
|
|
10006
|
-
[arrow9.BufferType.TYPE]: data.buffers[arrow9.BufferType.TYPE]
|
|
10007
|
-
},
|
|
10008
|
-
children: data.children.map((childData) => dehydrateArrowData(childData)),
|
|
10009
|
-
dictionary: data.dictionary ? dehydrateArrowVector(data.dictionary) : void 0
|
|
10010
|
-
};
|
|
10011
|
-
}
|
|
10012
|
-
function dehydrateArrowVector(vector) {
|
|
10013
|
-
return { data: vector.data.map((data) => dehydrateArrowData(data)) };
|
|
10014
|
-
}
|
|
10015
|
-
function hydrateArrowData(data) {
|
|
10016
|
-
const children = data.children.map((childData) => hydrateArrowData(childData));
|
|
10017
|
-
const dictionary = data.dictionary ? hydrateArrowVector(data.dictionary) : void 0;
|
|
10018
|
-
return new arrow9.Data(
|
|
10019
|
-
deserializeArrowType(data.type),
|
|
10020
|
-
data.offset,
|
|
10021
|
-
data.length,
|
|
10022
|
-
data.nullCount,
|
|
10023
|
-
data.buffers,
|
|
10024
|
-
children,
|
|
10025
|
-
dictionary
|
|
10026
|
-
);
|
|
10027
|
-
}
|
|
10028
|
-
function hydrateArrowVector(vector) {
|
|
10029
|
-
return new arrow9.Vector(vector.data.map((data) => hydrateArrowData(data)));
|
|
10030
|
-
}
|
|
10031
|
-
var arrow9;
|
|
10032
|
-
var init_arrow_table_transport = __esm({
|
|
10033
|
-
"../core/src/schema-utils/lib/arrow/arrow-table-transport.ts"() {
|
|
10034
|
-
"use strict";
|
|
10035
|
-
arrow9 = __toESM(require("apache-arrow"), 1);
|
|
10036
|
-
init_convert_arrow_schema();
|
|
10037
|
-
init_split_arrow_buffers();
|
|
10038
|
-
}
|
|
10039
|
-
});
|
|
10040
|
-
|
|
10041
|
-
// ../core/src/schema-utils/arrow-transport.ts
|
|
10042
|
-
var init_arrow_transport = __esm({
|
|
10043
|
-
"../core/src/schema-utils/arrow-transport.ts"() {
|
|
9983
|
+
var import_arrow;
|
|
9984
|
+
var init_arrow_worker_transport = __esm({
|
|
9985
|
+
"../core/src/arrow-worker-transport.ts"() {
|
|
10044
9986
|
"use strict";
|
|
10045
|
-
|
|
10046
|
-
init_split_arrow_buffers();
|
|
9987
|
+
import_arrow = require("@math.gl/arrow");
|
|
10047
9988
|
}
|
|
10048
9989
|
});
|
|
10049
9990
|
|
|
@@ -11143,7 +11084,7 @@ var DracoLoader;
|
|
|
11143
11084
|
var init_draco_loader_types = __esm({
|
|
11144
11085
|
"../scene/src/draco/draco-loader-types.ts"() {
|
|
11145
11086
|
"use strict";
|
|
11146
|
-
|
|
11087
|
+
init_arrow_worker_transport();
|
|
11147
11088
|
init_version3();
|
|
11148
11089
|
init_draco_format();
|
|
11149
11090
|
init_draco_loader_options();
|
|
@@ -11690,7 +11631,7 @@ function createBoundingVolume(boundingVolumeHeader, transform, result, initialTr
|
|
|
11690
11631
|
return createBox(boundingVolumeHeader.box, boxTransform, result);
|
|
11691
11632
|
}
|
|
11692
11633
|
if (boundingVolumeHeader.region) {
|
|
11693
|
-
const boundingVolume = (0,
|
|
11634
|
+
const boundingVolume = (0, import_geospatial2.makeOBBFromRegion)(boundingVolumeHeader.region);
|
|
11694
11635
|
const regionTransform = transform.equals(initialTransform) ? identityTransform : transform.clone().multiplyRight(initialTransform.clone().invert());
|
|
11695
11636
|
return createBox(
|
|
11696
11637
|
[...boundingVolume.center, ...boundingVolume.halfAxes],
|
|
@@ -11799,10 +11740,10 @@ function orientedBoundingBoxToCartographicBounds(boundingVolume) {
|
|
|
11799
11740
|
function boundingSphereToCartographicBounds(boundingVolume) {
|
|
11800
11741
|
const result = emptyCartographicBounds();
|
|
11801
11742
|
const { center, radius } = boundingVolume;
|
|
11802
|
-
const point =
|
|
11743
|
+
const point = import_geospatial2.Ellipsoid.WGS84.scaleToGeodeticSurface(center, scratchPoint);
|
|
11803
11744
|
let zAxis;
|
|
11804
11745
|
if (point) {
|
|
11805
|
-
zAxis =
|
|
11746
|
+
zAxis = import_geospatial2.Ellipsoid.WGS84.geodeticSurfaceNormal(point);
|
|
11806
11747
|
} else {
|
|
11807
11748
|
zAxis = new import_core5.Vector3(0, 0, 1);
|
|
11808
11749
|
}
|
|
@@ -11831,7 +11772,7 @@ function emptyCartographicBounds() {
|
|
|
11831
11772
|
];
|
|
11832
11773
|
}
|
|
11833
11774
|
function addToCartographicBounds(target, cartesian) {
|
|
11834
|
-
|
|
11775
|
+
import_geospatial2.Ellipsoid.WGS84.cartesianToCartographic(cartesian, scratchPoint);
|
|
11835
11776
|
target[0][0] = Math.min(target[0][0], scratchPoint[0]);
|
|
11836
11777
|
target[0][1] = Math.min(target[0][1], scratchPoint[1]);
|
|
11837
11778
|
target[0][2] = Math.min(target[0][2], scratchPoint[2]);
|
|
@@ -11839,13 +11780,13 @@ function addToCartographicBounds(target, cartesian) {
|
|
|
11839
11780
|
target[1][1] = Math.max(target[1][1], scratchPoint[1]);
|
|
11840
11781
|
target[1][2] = Math.max(target[1][2], scratchPoint[2]);
|
|
11841
11782
|
}
|
|
11842
|
-
var import_core5, import_culling2,
|
|
11783
|
+
var import_core5, import_culling2, import_geospatial2, scratchPoint, scratchScale, identityTransform;
|
|
11843
11784
|
var init_bounding_volume = __esm({
|
|
11844
11785
|
"../tiles-3d/src/tileset-3d/helpers/bounding-volume.ts"() {
|
|
11845
11786
|
"use strict";
|
|
11846
11787
|
import_core5 = require("@math.gl/core");
|
|
11847
11788
|
import_culling2 = require("@math.gl/geometry/culling");
|
|
11848
|
-
|
|
11789
|
+
import_geospatial2 = require("@math.gl/geospatial");
|
|
11849
11790
|
init_loader_utils();
|
|
11850
11791
|
scratchPoint = new import_core5.Vector3();
|
|
11851
11792
|
scratchScale = new import_core5.Vector3();
|
|
@@ -11890,9 +11831,9 @@ function getProjectedRadius(tile, frameState) {
|
|
|
11890
11831
|
const mbsR = mbs[3];
|
|
11891
11832
|
const mbsCenterCartesian = [...tile.boundingVolume.center];
|
|
11892
11833
|
const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
|
|
11893
|
-
|
|
11834
|
+
import_geospatial3.Ellipsoid.WGS84.cartographicToCartesian(cameraPositionCartographic, cameraPositionCartesian);
|
|
11894
11835
|
toEye.copy(cameraPositionCartesian).subtract(mbsCenterCartesian).normalize();
|
|
11895
|
-
(0,
|
|
11836
|
+
(0, import_geospatial4.eastNorthUpToFixedFrame)(import_geospatial3.Ellipsoid.WGS84, mbsCenterCartesian, enuToCartesianMatrix);
|
|
11896
11837
|
cartesianToEnuMatrix.copy(enuToCartesianMatrix).invert();
|
|
11897
11838
|
cameraPositionEnu.copy(cameraPositionCartesian).transform(cartesianToEnuMatrix);
|
|
11898
11839
|
const projection = Math.sqrt(
|
|
@@ -11904,7 +11845,7 @@ function getProjectedRadius(tile, frameState) {
|
|
|
11904
11845
|
const extraVectorCartesian = extraVertexCartesian.subtract(mbsCenterCartesian).normalize();
|
|
11905
11846
|
const radiusVector = toEye.cross(extraVectorCartesian).normalize().scale(mbsR);
|
|
11906
11847
|
const sphereMbsBorderVertexCartesian = radiusVector.add(mbsCenterCartesian);
|
|
11907
|
-
const sphereMbsBorderVertexCartographic =
|
|
11848
|
+
const sphereMbsBorderVertexCartographic = import_geospatial3.Ellipsoid.WGS84.cartesianToCartographic(
|
|
11908
11849
|
sphereMbsBorderVertexCartesian
|
|
11909
11850
|
);
|
|
11910
11851
|
const projectedOrigin = viewport.project([mbsLon, mbsLat, mbsZ]);
|
|
@@ -11914,13 +11855,13 @@ function getProjectedRadius(tile, frameState) {
|
|
|
11914
11855
|
const projectedRadius = projectedOriginVector.copy(projectedOrigin).subtract(projectedMbsBorderVertex).magnitude();
|
|
11915
11856
|
return projectedRadius;
|
|
11916
11857
|
}
|
|
11917
|
-
var import_core6,
|
|
11858
|
+
var import_core6, import_geospatial3, import_geospatial4, cameraPositionCartesian, toEye, cameraPositionEnu, extraVertexEnu, projectedOriginVector, enuToCartesianMatrix, cartesianToEnuMatrix;
|
|
11918
11859
|
var init_i3s_lod = __esm({
|
|
11919
11860
|
"../tiles-3d/src/tileset-3d/helpers/i3s-lod.ts"() {
|
|
11920
11861
|
"use strict";
|
|
11921
11862
|
import_core6 = require("@math.gl/core");
|
|
11922
|
-
|
|
11923
|
-
|
|
11863
|
+
import_geospatial3 = require("@math.gl/geospatial");
|
|
11864
|
+
import_geospatial4 = require("@math.gl/geospatial");
|
|
11924
11865
|
cameraPositionCartesian = new import_core6.Vector3();
|
|
11925
11866
|
toEye = new import_core6.Vector3();
|
|
11926
11867
|
cameraPositionEnu = new import_core6.Vector3();
|
|
@@ -13380,7 +13321,7 @@ var init_tile_3d = __esm({
|
|
|
13380
13321
|
|
|
13381
13322
|
// ../tiles-3d/src/tileset-3d/helpers/zoom.ts
|
|
13382
13323
|
function getZoomFromFullExtent(fullExtent, cartorgraphicCenter, cartesianCenter) {
|
|
13383
|
-
|
|
13324
|
+
import_geospatial5.Ellipsoid.WGS84.cartographicToCartesian(
|
|
13384
13325
|
[fullExtent.xmax, fullExtent.ymax, fullExtent.zmax],
|
|
13385
13326
|
scratchVector2
|
|
13386
13327
|
);
|
|
@@ -13397,13 +13338,13 @@ function getZoomFromExtent(extent, cartorgraphicCenter, cartesianCenter) {
|
|
|
13397
13338
|
cartesianCenter
|
|
13398
13339
|
);
|
|
13399
13340
|
}
|
|
13400
|
-
var import_core8, import_culling4,
|
|
13341
|
+
var import_core8, import_culling4, import_geospatial5, WGS84_RADIUS_Z, scratchVector2;
|
|
13401
13342
|
var init_zoom = __esm({
|
|
13402
13343
|
"../tiles-3d/src/tileset-3d/helpers/zoom.ts"() {
|
|
13403
13344
|
"use strict";
|
|
13404
13345
|
import_core8 = require("@math.gl/core");
|
|
13405
13346
|
import_culling4 = require("@math.gl/geometry/culling");
|
|
13406
|
-
|
|
13347
|
+
import_geospatial5 = require("@math.gl/geospatial");
|
|
13407
13348
|
WGS84_RADIUS_Z = 6356752314245179e-9;
|
|
13408
13349
|
scratchVector2 = new import_core8.Vector3();
|
|
13409
13350
|
}
|
|
@@ -13699,12 +13640,12 @@ function transformHeight(height, geoidUndulation, source, target) {
|
|
|
13699
13640
|
}
|
|
13700
13641
|
throw new Error(`Unsupported height conversion from ${source} to ${target}`);
|
|
13701
13642
|
}
|
|
13702
|
-
var import_core9,
|
|
13643
|
+
var import_core9, import_geospatial6, import_bulk, SpatialCoordinateTransformer;
|
|
13703
13644
|
var init_spatial_coordinate_transformer = __esm({
|
|
13704
13645
|
"../tiles-3d/src/spatial/spatial-coordinate-transformer.ts"() {
|
|
13705
13646
|
"use strict";
|
|
13706
13647
|
import_core9 = require("@math.gl/core");
|
|
13707
|
-
|
|
13648
|
+
import_geospatial6 = require("@math.gl/geospatial");
|
|
13708
13649
|
import_bulk = require("@math.gl/geospatial/projection/bulk");
|
|
13709
13650
|
init_spatial_resource_registry();
|
|
13710
13651
|
init_normalize_crs_identifier();
|
|
@@ -13882,7 +13823,7 @@ var init_spatial_coordinate_transformer = __esm({
|
|
|
13882
13823
|
/** Convert one source coordinate to conventional WGS84 longitude, latitude, and height. */
|
|
13883
13824
|
toGeographic(coordinate) {
|
|
13884
13825
|
if (this.sourceIsGeocentric) {
|
|
13885
|
-
return Array.from(
|
|
13826
|
+
return Array.from(import_geospatial6.Ellipsoid.WGS84.cartesianToCartographic(new import_core9.Vector3(coordinate)));
|
|
13886
13827
|
}
|
|
13887
13828
|
if (this.sourceIsGeographic) {
|
|
13888
13829
|
return coordinate.slice(0, 3);
|
|
@@ -13892,7 +13833,7 @@ var init_spatial_coordinate_transformer = __esm({
|
|
|
13892
13833
|
/** Convert one conventional WGS84 geographic coordinate to the selected output CRS. */
|
|
13893
13834
|
fromGeographic(coordinate) {
|
|
13894
13835
|
if (this.outputIsGeocentric) {
|
|
13895
|
-
return Array.from(
|
|
13836
|
+
return Array.from(import_geospatial6.Ellipsoid.WGS84.cartographicToCartesian(new import_core9.Vector3(coordinate)));
|
|
13896
13837
|
}
|
|
13897
13838
|
if (this.outputIsGeographic) {
|
|
13898
13839
|
return coordinate.slice(0, 3);
|
|
@@ -14158,7 +14099,7 @@ function getGeographicBoundingSphere(geographicSamples) {
|
|
|
14158
14099
|
throw new Error("I3S spatial transformation requires at least one bound sample");
|
|
14159
14100
|
}
|
|
14160
14101
|
const cartesianSamples = geographicSamples.map(
|
|
14161
|
-
(position) =>
|
|
14102
|
+
(position) => import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(new import_core10.Vector3(position))
|
|
14162
14103
|
);
|
|
14163
14104
|
const cartesianCenter = new import_core10.Vector3();
|
|
14164
14105
|
for (const sample of cartesianSamples) {
|
|
@@ -14169,7 +14110,7 @@ function getGeographicBoundingSphere(geographicSamples) {
|
|
|
14169
14110
|
for (const sample of cartesianSamples) {
|
|
14170
14111
|
radius = Math.max(radius, new import_core10.Vector3(sample).subtract(cartesianCenter).magnitude());
|
|
14171
14112
|
}
|
|
14172
|
-
const geographicCenter =
|
|
14113
|
+
const geographicCenter = import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(cartesianCenter);
|
|
14173
14114
|
return [geographicCenter[0], geographicCenter[1], geographicCenter[2], radius];
|
|
14174
14115
|
}
|
|
14175
14116
|
function getSourceBoundSamples(bounds, sourceFrame, sourceToGeographicTransformer, sourceVerticalUnitScale) {
|
|
@@ -14186,7 +14127,7 @@ function getSourceBoundSamples(bounds, sourceFrame, sourceToGeographicTransforme
|
|
|
14186
14127
|
];
|
|
14187
14128
|
if (sourceFrame === "geographic") {
|
|
14188
14129
|
const geographicCenter = sourceToGeographicTransformer.transformPosition(center2);
|
|
14189
|
-
const cartesianCenter =
|
|
14130
|
+
const cartesianCenter = import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(
|
|
14190
14131
|
new import_core10.Vector3(geographicCenter)
|
|
14191
14132
|
);
|
|
14192
14133
|
const cartesianAxes = bounds.normalReferenceFrame === "vertex-reference-frame" ? axes.map((axis) => localEnuVectorToEcef(axis, geographicCenter)) : axes;
|
|
@@ -14195,7 +14136,7 @@ function getSourceBoundSamples(bounds, sourceFrame, sourceToGeographicTransforme
|
|
|
14195
14136
|
for (let axisIndex = 0; axisIndex < 3; axisIndex++) {
|
|
14196
14137
|
corner.add(new import_core10.Vector3(cartesianAxes[axisIndex]).scale(signs[axisIndex]));
|
|
14197
14138
|
}
|
|
14198
|
-
return Array.from(
|
|
14139
|
+
return Array.from(import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(corner));
|
|
14199
14140
|
});
|
|
14200
14141
|
}
|
|
14201
14142
|
return getBoxSigns().map((signs) => {
|
|
@@ -14215,10 +14156,10 @@ function getSourceBoundSamples(bounds, sourceFrame, sourceToGeographicTransforme
|
|
|
14215
14156
|
const radius = mbs[3];
|
|
14216
14157
|
if (sourceFrame === "geographic") {
|
|
14217
14158
|
const geographicCenter = sourceToGeographicTransformer.transformPosition(center);
|
|
14218
|
-
const cartesianCenter =
|
|
14159
|
+
const cartesianCenter = import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(new import_core10.Vector3(geographicCenter));
|
|
14219
14160
|
return getAxisDirections().map(
|
|
14220
14161
|
(direction) => Array.from(
|
|
14221
|
-
|
|
14162
|
+
import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(
|
|
14222
14163
|
new import_core10.Vector3(cartesianCenter).add(new import_core10.Vector3(direction).scale(radius))
|
|
14223
14164
|
)
|
|
14224
14165
|
)
|
|
@@ -14318,12 +14259,12 @@ function getGeographicRegion(positions) {
|
|
|
14318
14259
|
function normalizeLongitude(longitude) {
|
|
14319
14260
|
return ((longitude + 180) % 360 + 360) % 360 - 180;
|
|
14320
14261
|
}
|
|
14321
|
-
var import_core10,
|
|
14262
|
+
var import_core10, import_geospatial7, I3SSpatialTransformer;
|
|
14322
14263
|
var init_i3s_spatial_transformer = __esm({
|
|
14323
14264
|
"../tiles-3d/src/spatial/i3s-spatial-transformer.ts"() {
|
|
14324
14265
|
"use strict";
|
|
14325
14266
|
import_core10 = require("@math.gl/core");
|
|
14326
|
-
|
|
14267
|
+
import_geospatial7 = require("@math.gl/geospatial");
|
|
14327
14268
|
init_spatial_coordinate_transformer();
|
|
14328
14269
|
init_spatial_types();
|
|
14329
14270
|
init_i3s_elevation();
|
|
@@ -14660,14 +14601,14 @@ var init_i3s_spatial_transformer = __esm({
|
|
|
14660
14601
|
/** Rebuild an I3S bound as a WGS84 ECEF box for generic `Tileset3D` traversal. */
|
|
14661
14602
|
transformBoundingVolumeToGeocentric(bounds) {
|
|
14662
14603
|
const cartesianSamples = this.getGeographicBoundSamples(bounds).map(
|
|
14663
|
-
(position) => Array.from(
|
|
14604
|
+
(position) => Array.from(import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(new import_core10.Vector3(position)))
|
|
14664
14605
|
);
|
|
14665
14606
|
return { box: getAxisAlignedBox(cartesianSamples) };
|
|
14666
14607
|
}
|
|
14667
14608
|
/** Rebuild an I3S bound as WGS84 ECEF after asynchronous elevation placement. */
|
|
14668
14609
|
async transformBoundingVolumeToGeocentricAsync(bounds) {
|
|
14669
14610
|
const cartesianSamples = (await this.getGeographicBoundSamplesAsync(bounds)).map(
|
|
14670
|
-
(position) => Array.from(
|
|
14611
|
+
(position) => Array.from(import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(new import_core10.Vector3(position)))
|
|
14671
14612
|
);
|
|
14672
14613
|
return { box: getAxisAlignedBox(cartesianSamples) };
|
|
14673
14614
|
}
|
|
@@ -14698,7 +14639,7 @@ var init_i3s_spatial_transformer = __esm({
|
|
|
14698
14639
|
async transformBoundsAsync(bounds) {
|
|
14699
14640
|
const geographicSamples = await this.getGeographicBoundSamplesAsync(bounds);
|
|
14700
14641
|
const cartesianSamples = geographicSamples.map(
|
|
14701
|
-
(position) => Array.from(
|
|
14642
|
+
(position) => Array.from(import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(new import_core10.Vector3(position)))
|
|
14702
14643
|
);
|
|
14703
14644
|
const targetSamples = geographicSamples.map(
|
|
14704
14645
|
(position) => this.geographicToTargetTransformer.transformPosition(position)
|
|
@@ -14857,13 +14798,13 @@ var init_i3s_spatial_transformer = __esm({
|
|
|
14857
14798
|
if (this.targetCoordinateFrame === "geographic") {
|
|
14858
14799
|
return ecefVectorToLocalEnu(ecefNormal, geographic).normalize();
|
|
14859
14800
|
}
|
|
14860
|
-
const cartesian =
|
|
14801
|
+
const cartesian = import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(new import_core10.Vector3(geographic));
|
|
14861
14802
|
const jacobianColumns = [];
|
|
14862
14803
|
for (const direction of getPositiveAxisDirections()) {
|
|
14863
|
-
const positiveGeographic =
|
|
14804
|
+
const positiveGeographic = import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(
|
|
14864
14805
|
new import_core10.Vector3(cartesian).add(direction)
|
|
14865
14806
|
);
|
|
14866
|
-
const negativeGeographic =
|
|
14807
|
+
const negativeGeographic = import_geospatial7.Ellipsoid.WGS84.cartesianToCartographic(
|
|
14867
14808
|
new import_core10.Vector3(cartesian).subtract(direction)
|
|
14868
14809
|
);
|
|
14869
14810
|
const positiveTarget = this.geographicToTargetTransformer.transformPosition(positiveGeographic);
|
|
@@ -14914,12 +14855,12 @@ function normalizeI3SRequest(input) {
|
|
|
14914
14855
|
coreApi: input.coreApi
|
|
14915
14856
|
};
|
|
14916
14857
|
}
|
|
14917
|
-
var
|
|
14858
|
+
var import_geospatial8, import_core11, EMPTY_CONTENT_FORMATS, I3SSource;
|
|
14918
14859
|
var init_i3s_source = __esm({
|
|
14919
14860
|
"../tiles-3d/src/tileset-3d/format-i3s/i3s-source.ts"() {
|
|
14920
14861
|
"use strict";
|
|
14921
14862
|
init_loader_utils();
|
|
14922
|
-
|
|
14863
|
+
import_geospatial8 = require("@math.gl/geospatial");
|
|
14923
14864
|
import_core11 = require("@math.gl/core");
|
|
14924
14865
|
init_tile_3d();
|
|
14925
14866
|
init_i3s_tileset_traverser();
|
|
@@ -15230,7 +15171,7 @@ var init_i3s_source = __esm({
|
|
|
15230
15171
|
zmin + (zmax - zmin) / 2
|
|
15231
15172
|
);
|
|
15232
15173
|
const cartesianCenter = new import_core11.Vector3();
|
|
15233
|
-
|
|
15174
|
+
import_geospatial8.Ellipsoid.WGS84.cartographicToCartesian(cartographicCenter, cartesianCenter);
|
|
15234
15175
|
return {
|
|
15235
15176
|
cartographicCenter,
|
|
15236
15177
|
cartesianCenter,
|
|
@@ -15242,7 +15183,7 @@ var init_i3s_source = __esm({
|
|
|
15242
15183
|
const [xmin, ymin, xmax, ymax] = extent;
|
|
15243
15184
|
const cartographicCenter = new import_core11.Vector3(xmin + (xmax - xmin) / 2, ymin + (ymax - ymin) / 2, 0);
|
|
15244
15185
|
const cartesianCenter = new import_core11.Vector3();
|
|
15245
|
-
|
|
15186
|
+
import_geospatial8.Ellipsoid.WGS84.cartographicToCartesian(cartographicCenter, cartesianCenter);
|
|
15246
15187
|
return {
|
|
15247
15188
|
cartographicCenter,
|
|
15248
15189
|
cartesianCenter,
|
|
@@ -15934,8 +15875,8 @@ function parsePositions(attribute, options) {
|
|
|
15934
15875
|
const enuMatrix = new import_core12.Matrix4();
|
|
15935
15876
|
const cartographicOrigin = new import_core12.Vector3(mbs[0], mbs[1], mbs[2]);
|
|
15936
15877
|
const cartesianOrigin = new import_core12.Vector3();
|
|
15937
|
-
|
|
15938
|
-
(0,
|
|
15878
|
+
import_geospatial9.Ellipsoid.WGS84.cartographicToCartesian(cartographicOrigin, cartesianOrigin);
|
|
15879
|
+
(0, import_geospatial10.eastNorthUpToFixedFrame)(import_geospatial9.Ellipsoid.WGS84, cartesianOrigin, enuMatrix);
|
|
15939
15880
|
attribute.value = offsetsToCartesians(value, metadata, cartographicOrigin);
|
|
15940
15881
|
return enuMatrix;
|
|
15941
15882
|
}
|
|
@@ -15954,7 +15895,7 @@ function offsetsToSourcePositions(vertices, metadata = {}, sourceOrigin) {
|
|
|
15954
15895
|
function offsetsToCartesians(vertices, metadata = {}, cartographicOrigin) {
|
|
15955
15896
|
const positions = offsetsToSourcePositions(vertices, metadata, cartographicOrigin);
|
|
15956
15897
|
for (let i = 0; i < positions.length; i += 3) {
|
|
15957
|
-
|
|
15898
|
+
import_geospatial9.Ellipsoid.WGS84.cartographicToCartesian(positions.subarray(i, i + 3), scratchVector3);
|
|
15958
15899
|
positions[i] = scratchVector3.x;
|
|
15959
15900
|
positions[i + 1] = scratchVector3.y;
|
|
15960
15901
|
positions[i + 2] = scratchVector3.z;
|
|
@@ -16139,14 +16080,14 @@ function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
|
|
|
16139
16080
|
var _a2, _b;
|
|
16140
16081
|
return (_b = (_a2 = featureIndex == null ? void 0 : featureIndex.metadata) == null ? void 0 : _a2["i3s-feature-ids"]) == null ? void 0 : _b.intArray;
|
|
16141
16082
|
}
|
|
16142
|
-
var import_core12,
|
|
16083
|
+
var import_core12, import_geospatial9, import_geospatial10, scratchVector3, I3S_ATTRIBUTE_TYPE;
|
|
16143
16084
|
var init_parse_i3s_tile_content = __esm({
|
|
16144
16085
|
"../tiles-3d/src/i3s/lib/parsers/parse-i3s-tile-content.ts"() {
|
|
16145
16086
|
"use strict";
|
|
16146
16087
|
init_schema();
|
|
16147
16088
|
import_core12 = require("@math.gl/core");
|
|
16148
|
-
|
|
16149
|
-
|
|
16089
|
+
import_geospatial9 = require("@math.gl/geospatial");
|
|
16090
|
+
import_geospatial10 = require("@math.gl/geospatial");
|
|
16150
16091
|
init_loader_utils();
|
|
16151
16092
|
init_src();
|
|
16152
16093
|
init_src3();
|
|
@@ -16784,14 +16725,14 @@ function normalizeTileNonUrlData(tile) {
|
|
|
16784
16725
|
if (tile.mbs) {
|
|
16785
16726
|
mbs = tile.mbs;
|
|
16786
16727
|
boundingVolume.sphere = [
|
|
16787
|
-
...
|
|
16728
|
+
...import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(tile.mbs.slice(0, 3)),
|
|
16788
16729
|
// cartesian center of sphere
|
|
16789
16730
|
tile.mbs[3]
|
|
16790
16731
|
// radius of sphere
|
|
16791
16732
|
];
|
|
16792
16733
|
} else if (tile.obb) {
|
|
16793
16734
|
boundingVolume.box = [
|
|
16794
|
-
...
|
|
16735
|
+
...import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(tile.obb.center),
|
|
16795
16736
|
// cartesian center of box
|
|
16796
16737
|
...tile.obb.halfSize,
|
|
16797
16738
|
// halfSize
|
|
@@ -16861,12 +16802,12 @@ async function normalizeTilesetData(tileset, options, context) {
|
|
|
16861
16802
|
lodMetricValue: root.lodMetricValue
|
|
16862
16803
|
};
|
|
16863
16804
|
}
|
|
16864
|
-
var import_culling5,
|
|
16805
|
+
var import_culling5, import_geospatial11;
|
|
16865
16806
|
var init_parse_i3s = __esm({
|
|
16866
16807
|
"../tiles-3d/src/i3s/lib/parsers/parse-i3s.ts"() {
|
|
16867
16808
|
"use strict";
|
|
16868
16809
|
import_culling5 = require("@math.gl/geometry/culling");
|
|
16869
|
-
|
|
16810
|
+
import_geospatial11 = require("@math.gl/geospatial");
|
|
16870
16811
|
init_i3s_nodepages_tiles();
|
|
16871
16812
|
init_url_utils();
|
|
16872
16813
|
init_i3s_loader_with_parser();
|
|
@@ -20025,7 +19966,7 @@ function normalizePointPositions(positions, center, requestedCoordinateSystem) {
|
|
|
20025
19966
|
const cartesianPositions = new Float32Array(positions.length);
|
|
20026
19967
|
const cartesian = new import_core13.Vector3();
|
|
20027
19968
|
for (let index = 0; index < positions.length; index += 3) {
|
|
20028
|
-
|
|
19969
|
+
import_geospatial12.Ellipsoid.WGS84.cartographicToCartesian(
|
|
20029
19970
|
new import_core13.Vector3([positions[index], positions[index + 1], positions[index + 2]]),
|
|
20030
19971
|
cartesian
|
|
20031
19972
|
);
|
|
@@ -20104,7 +20045,7 @@ function getTransformedPointCloudBounds(boundingVolume, coordinateFrame) {
|
|
|
20104
20045
|
coordinateFrame
|
|
20105
20046
|
};
|
|
20106
20047
|
}
|
|
20107
|
-
var import_core13,
|
|
20048
|
+
var import_core13, import_geospatial12, I3SPointCloudSource, EARTH_EQUATORIAL_RADIUS;
|
|
20108
20049
|
var init_i3s_point_cloud_source = __esm({
|
|
20109
20050
|
"../tiles-3d/src/i3s/i3s-point-cloud-source.ts"() {
|
|
20110
20051
|
"use strict";
|
|
@@ -20112,7 +20053,7 @@ var init_i3s_point_cloud_source = __esm({
|
|
|
20112
20053
|
init_schema_utils();
|
|
20113
20054
|
init_schema();
|
|
20114
20055
|
import_core13 = require("@math.gl/core");
|
|
20115
|
-
|
|
20056
|
+
import_geospatial12 = require("@math.gl/geospatial");
|
|
20116
20057
|
init_src4();
|
|
20117
20058
|
init_loader_utils();
|
|
20118
20059
|
init_parse_slpk();
|
|
@@ -20902,21 +20843,13 @@ var init_mvt_format = __esm({
|
|
|
20902
20843
|
}
|
|
20903
20844
|
});
|
|
20904
20845
|
|
|
20905
|
-
// ../tables/src/arrow/transport.ts
|
|
20906
|
-
var init_transport = __esm({
|
|
20907
|
-
"../tables/src/arrow/transport.ts"() {
|
|
20908
|
-
"use strict";
|
|
20909
|
-
init_arrow_transport();
|
|
20910
|
-
}
|
|
20911
|
-
});
|
|
20912
|
-
|
|
20913
20846
|
// ../tiles/src/mvt/lib/mvt-worker-transport.ts
|
|
20914
20847
|
function serializeMVTWorkerResult(result, options) {
|
|
20915
|
-
if (
|
|
20848
|
+
if (isArrowTable(result)) {
|
|
20916
20849
|
const bufferCopyMode = getWorkerTransferBufferCopyMode(options);
|
|
20917
20850
|
return {
|
|
20918
20851
|
...result,
|
|
20919
|
-
data: dehydrateArrowTable(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
20852
|
+
data: (0, import_arrow2.dehydrateArrowTable)(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
20920
20853
|
};
|
|
20921
20854
|
}
|
|
20922
20855
|
return result;
|
|
@@ -20925,12 +20858,12 @@ function deserializeMVTWorkerResult(result) {
|
|
|
20925
20858
|
if (isSerializedArrowTable(result)) {
|
|
20926
20859
|
return {
|
|
20927
20860
|
...result,
|
|
20928
|
-
data: hydrateArrowTable(result.data)
|
|
20861
|
+
data: (0, import_arrow2.hydrateArrowTable)(result.data)
|
|
20929
20862
|
};
|
|
20930
20863
|
}
|
|
20931
20864
|
return result;
|
|
20932
20865
|
}
|
|
20933
|
-
function
|
|
20866
|
+
function isArrowTable(value) {
|
|
20934
20867
|
const table = value;
|
|
20935
20868
|
return Boolean(
|
|
20936
20869
|
table && typeof table === "object" && table.shape === "arrow-table" && table.data && "batches" in table.data
|
|
@@ -20946,10 +20879,11 @@ function getWorkerTransferBufferCopyMode(options) {
|
|
|
20946
20879
|
var _a2;
|
|
20947
20880
|
return ((_a2 = options == null ? void 0 : options.core) == null ? void 0 : _a2.workerTransferBufferCopy) ?? (options == null ? void 0 : options.workerTransferBufferCopy);
|
|
20948
20881
|
}
|
|
20882
|
+
var import_arrow2;
|
|
20949
20883
|
var init_mvt_worker_transport = __esm({
|
|
20950
20884
|
"../tiles/src/mvt/lib/mvt-worker-transport.ts"() {
|
|
20951
20885
|
"use strict";
|
|
20952
|
-
|
|
20886
|
+
import_arrow2 = require("@math.gl/arrow");
|
|
20953
20887
|
}
|
|
20954
20888
|
});
|
|
20955
20889
|
|