@loaders.gl/i3s 3.4.6 → 4.0.0-alpha.10
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/arcgis-webscene-loader.js +1 -1
- package/dist/dist.min.js +8452 -8866
- package/dist/es5/arcgis-webscene-loader.js +1 -1
- package/dist/es5/arcgis-webscene-loader.js.map +1 -1
- package/dist/es5/i3s-attribute-loader.js +18 -20
- package/dist/es5/i3s-attribute-loader.js.map +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js +1 -1
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/es5/i3s-content-loader.js +2 -3
- package/dist/es5/i3s-content-loader.js.map +1 -1
- package/dist/es5/i3s-loader.js +1 -1
- package/dist/es5/i3s-loader.js.map +1 -1
- package/dist/es5/i3s-node-page-loader.js +4 -22
- package/dist/es5/i3s-node-page-loader.js.map +1 -1
- package/dist/es5/i3s-slpk-loader.js +1 -1
- package/dist/es5/i3s-slpk-loader.js.map +1 -1
- package/dist/es5/index.js +8 -1
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-attribute.js +7 -26
- package/dist/es5/lib/parsers/parse-i3s-attribute.js.map +1 -1
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js +2 -2
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/es5/lib/parsers/parse-slpk/parse-slpk.js +2 -2
- package/dist/es5/lib/parsers/parse-slpk/parse-slpk.js.map +1 -1
- package/dist/es5/lib/parsers/parse-slpk/slpk-archieve.js +140 -23
- package/dist/es5/lib/parsers/parse-slpk/slpk-archieve.js.map +1 -1
- package/dist/es5/lib/utils/{customizeColors.js → customize-/321/201olors.js} +65 -40
- package/dist/es5/lib/utils/customize-/321/201olors.js.map +1 -0
- package/dist/es5/types.js.map +1 -1
- package/dist/es5/workers/{i3s-content-nodejs-worker.js → i3s-content-worker-node.js} +2 -2
- package/dist/es5/workers/i3s-content-worker-node.js.map +1 -0
- package/dist/esm/arcgis-webscene-loader.js +1 -1
- package/dist/esm/arcgis-webscene-loader.js.map +1 -1
- package/dist/esm/i3s-attribute-loader.js +2 -6
- package/dist/esm/i3s-attribute-loader.js.map +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js +1 -1
- package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -1
- package/dist/esm/i3s-content-loader.js +2 -3
- package/dist/esm/i3s-content-loader.js.map +1 -1
- package/dist/esm/i3s-loader.js +1 -1
- package/dist/esm/i3s-loader.js.map +1 -1
- package/dist/esm/i3s-node-page-loader.js +3 -7
- package/dist/esm/i3s-node-page-loader.js.map +1 -1
- package/dist/esm/i3s-slpk-loader.js +1 -1
- package/dist/esm/i3s-slpk-loader.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/parsers/parse-arcgis-webscene.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-attribute.js +1 -1
- package/dist/esm/lib/parsers/parse-i3s-attribute.js.map +1 -1
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js +1 -1
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
- package/dist/esm/lib/parsers/parse-slpk/parse-slpk.js +2 -2
- package/dist/esm/lib/parsers/parse-slpk/parse-slpk.js.map +1 -1
- package/dist/esm/lib/parsers/parse-slpk/slpk-archieve.js +59 -9
- package/dist/esm/lib/parsers/parse-slpk/slpk-archieve.js.map +1 -1
- package/dist/esm/lib/utils/{customizeColors.js → customize-/321/201olors.js} +9 -3
- package/dist/esm/lib/utils/customize-/321/201olors.js.map +1 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/workers/{i3s-content-nodejs-worker.js → i3s-content-worker-node.js} +2 -2
- package/dist/esm/workers/i3s-content-worker-node.js.map +1 -0
- package/dist/i3s-attribute-loader.d.ts +3 -2
- package/dist/i3s-attribute-loader.d.ts.map +1 -1
- package/dist/i3s-attribute-loader.js +2 -5
- package/dist/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s-content-loader.d.ts.map +1 -1
- package/dist/i3s-content-loader.js +2 -3
- package/dist/i3s-content-worker-node.js +197 -0
- package/dist/{i3s-content-nodejs-worker.js.map → i3s-content-worker-node.js.map} +3 -3
- package/dist/i3s-content-worker.js +93 -527
- package/dist/i3s-node-page-loader.d.ts +3 -2
- package/dist/i3s-node-page-loader.d.ts.map +1 -1
- package/dist/i3s-node-page-loader.js +2 -6
- package/dist/i3s-slpk-loader.d.ts +6 -3
- package/dist/i3s-slpk-loader.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/lib/parsers/parse-arcgis-webscene.js +1 -0
- package/dist/lib/parsers/parse-i3s-attribute.d.ts +6 -4
- package/dist/lib/parsers/parse-i3s-attribute.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-attribute.js +11 -10
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +7 -2
- package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts.map +1 -1
- package/dist/lib/parsers/parse-slpk/parse-slpk.js +1 -1
- package/dist/lib/parsers/parse-slpk/slpk-archieve.d.ts +6 -0
- package/dist/lib/parsers/parse-slpk/slpk-archieve.d.ts.map +1 -1
- package/dist/lib/parsers/parse-slpk/slpk-archieve.js +72 -9
- package/dist/lib/utils/{customizeColors.d.ts → customize-/321/201olors.d.ts} +1 -1
- package/dist/lib/utils/customize-/321/201olors.d.ts.map +1 -0
- package/dist/lib/utils/{customizeColors.js → customize-/321/201olors.js} +18 -3
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/workers/i3s-content-worker-node.d.ts +2 -0
- package/dist/workers/i3s-content-worker-node.d.ts.map +1 -0
- package/dist/workers/{i3s-content-nodejs-worker.js → i3s-content-worker-node.js} +2 -1
- package/package.json +13 -13
- package/src/arcgis-webscene-loader.ts +1 -1
- package/src/i3s-attribute-loader.ts +7 -7
- package/src/i3s-building-scene-layer-loader.ts +1 -1
- package/src/i3s-content-loader.ts +2 -3
- package/src/i3s-node-page-loader.ts +6 -10
- package/src/i3s-slpk-loader.ts +5 -3
- package/src/index.ts +13 -7
- package/src/lib/parsers/parse-arcgis-webscene.ts +1 -0
- package/src/lib/parsers/parse-i3s-attribute.ts +21 -14
- package/src/lib/parsers/parse-i3s-tile-content.ts +6 -1
- package/src/lib/parsers/parse-slpk/parse-slpk.ts +4 -1
- package/src/lib/parsers/parse-slpk/slpk-archieve.ts +73 -9
- package/src/lib/utils/{customizeColors.ts → customize-/321/201olors.ts} +18 -3
- package/src/types.ts +1 -0
- package/src/workers/{i3s-content-nodejs-worker.ts → i3s-content-worker-node.ts} +2 -1
- package/dist/es5/lib/utils/customizeColors.js.map +0 -1
- package/dist/es5/workers/i3s-content-nodejs-worker.js.map +0 -1
- package/dist/esm/lib/utils/customizeColors.js.map +0 -1
- package/dist/esm/workers/i3s-content-nodejs-worker.js.map +0 -1
- package/dist/i3s-content-nodejs-worker.js +0 -198
- package/dist/lib/utils/customizeColors.d.ts.map +0 -1
- package/dist/workers/i3s-content-nodejs-worker.d.ts +0 -2
- package/dist/workers/i3s-content-nodejs-worker.d.ts.map +0 -1
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
56
56
|
|
|
57
57
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
58
|
-
var VERSION = true ? "
|
|
58
|
+
var VERSION = true ? "4.0.0-alpha.10" : DEFAULT_VERSION;
|
|
59
59
|
if (false) {
|
|
60
60
|
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
61
61
|
}
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
returnWorkerToQueue(worker) {
|
|
362
|
-
const shouldDestroyWorker = this.isDestroyed || !this.reuseWorkers || this.count > this._getMaxConcurrency();
|
|
362
|
+
const shouldDestroyWorker = !isBrowser2 || this.isDestroyed || !this.reuseWorkers || this.count > this._getMaxConcurrency();
|
|
363
363
|
if (shouldDestroyWorker) {
|
|
364
364
|
worker.destroy();
|
|
365
365
|
this.count--;
|
|
@@ -520,10 +520,10 @@
|
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
523
|
-
var NPM_TAG = "
|
|
523
|
+
var NPM_TAG = "beta";
|
|
524
524
|
function getWorkerURL(worker, options = {}) {
|
|
525
525
|
const workerOptions = options[worker.id] || {};
|
|
526
|
-
const workerFile = `${worker.id}-worker.js`;
|
|
526
|
+
const workerFile = isBrowser2 ? `${worker.id}-worker.js` : `${worker.id}-worker-node.js`;
|
|
527
527
|
let url = workerOptions.workerUrl;
|
|
528
528
|
if (!url && worker.id === "compression") {
|
|
529
529
|
url = options.workerUrl;
|
|
@@ -555,7 +555,7 @@
|
|
|
555
555
|
|
|
556
556
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
557
557
|
var node = __toModule(require_require_utils());
|
|
558
|
-
var LATEST = "
|
|
558
|
+
var LATEST = "beta";
|
|
559
559
|
var VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
560
560
|
var loadLibraryPromises = {};
|
|
561
561
|
async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
|
|
@@ -1203,7 +1203,7 @@
|
|
|
1203
1203
|
return await makeResponse(url);
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
|
-
//
|
|
1206
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-electron.js
|
|
1207
1207
|
function isElectron(mockUserAgent) {
|
|
1208
1208
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
1209
1209
|
return true;
|
|
@@ -1219,13 +1219,13 @@
|
|
|
1219
1219
|
return false;
|
|
1220
1220
|
}
|
|
1221
1221
|
|
|
1222
|
-
//
|
|
1222
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/is-browser.js
|
|
1223
1223
|
function isBrowser3() {
|
|
1224
1224
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
1225
1225
|
return !isNode || isElectron();
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
|
-
//
|
|
1228
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/lib/globals.js
|
|
1229
1229
|
var self_3 = globalThis.self || globalThis.window || globalThis.global;
|
|
1230
1230
|
var window_3 = globalThis.window || globalThis.self || globalThis.global;
|
|
1231
1231
|
var document_3 = globalThis.document || {};
|
|
@@ -1233,11 +1233,11 @@
|
|
|
1233
1233
|
var console_ = globalThis.console;
|
|
1234
1234
|
var navigator_ = globalThis.navigator || {};
|
|
1235
1235
|
|
|
1236
|
-
//
|
|
1237
|
-
var VERSION3 = true ? "
|
|
1236
|
+
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
1237
|
+
var VERSION3 = true ? "4.0.0-alpha.10" : "untranspiled source";
|
|
1238
1238
|
var isBrowser4 = isBrowser3();
|
|
1239
1239
|
|
|
1240
|
-
//
|
|
1240
|
+
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
1241
1241
|
function getStorage(type) {
|
|
1242
1242
|
try {
|
|
1243
1243
|
const storage = window[type];
|
|
@@ -1281,7 +1281,7 @@
|
|
|
1281
1281
|
}
|
|
1282
1282
|
};
|
|
1283
1283
|
|
|
1284
|
-
//
|
|
1284
|
+
// ../../node_modules/@probe.gl/log/dist/utils/formatters.js
|
|
1285
1285
|
function formatTime(ms) {
|
|
1286
1286
|
let formatted;
|
|
1287
1287
|
if (ms < 10) {
|
|
@@ -1312,7 +1312,7 @@
|
|
|
1312
1312
|
return ["".concat(message, " %c+"), style];
|
|
1313
1313
|
}
|
|
1314
1314
|
|
|
1315
|
-
//
|
|
1315
|
+
// ../../node_modules/@probe.gl/log/dist/utils/color.js
|
|
1316
1316
|
var COLOR;
|
|
1317
1317
|
(function(COLOR2) {
|
|
1318
1318
|
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
@@ -1354,7 +1354,7 @@
|
|
|
1354
1354
|
return string;
|
|
1355
1355
|
}
|
|
1356
1356
|
|
|
1357
|
-
//
|
|
1357
|
+
// ../../node_modules/@probe.gl/log/dist/utils/autobind.js
|
|
1358
1358
|
function autobind(obj) {
|
|
1359
1359
|
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
1360
1360
|
const proto = Object.getPrototypeOf(obj);
|
|
@@ -1370,14 +1370,14 @@
|
|
|
1370
1370
|
}
|
|
1371
1371
|
}
|
|
1372
1372
|
|
|
1373
|
-
//
|
|
1373
|
+
// ../../node_modules/@probe.gl/log/dist/utils/assert.js
|
|
1374
1374
|
function assert3(condition, message) {
|
|
1375
1375
|
if (!condition) {
|
|
1376
1376
|
throw new Error(message || "Assertion failed");
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
1379
|
|
|
1380
|
-
//
|
|
1380
|
+
// ../../node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
|
|
1381
1381
|
function getHiResTimestamp() {
|
|
1382
1382
|
let timestamp;
|
|
1383
1383
|
if (isBrowser3() && window_3.performance) {
|
|
@@ -1393,7 +1393,7 @@
|
|
|
1393
1393
|
return timestamp;
|
|
1394
1394
|
}
|
|
1395
1395
|
|
|
1396
|
-
//
|
|
1396
|
+
// ../../node_modules/@probe.gl/log/dist/log.js
|
|
1397
1397
|
var originalConsole = {
|
|
1398
1398
|
debug: isBrowser3() ? console.debug || console.log : console.log,
|
|
1399
1399
|
log: console.log,
|
|
@@ -1726,7 +1726,7 @@
|
|
|
1726
1726
|
return "empty";
|
|
1727
1727
|
}
|
|
1728
1728
|
|
|
1729
|
-
//
|
|
1729
|
+
// ../../node_modules/@probe.gl/log/dist/index.js
|
|
1730
1730
|
var dist_default = new Log({
|
|
1731
1731
|
id: "@probe.gl/log"
|
|
1732
1732
|
});
|
|
@@ -2376,12 +2376,17 @@
|
|
|
2376
2376
|
|
|
2377
2377
|
// ../core/src/lib/api/load.ts
|
|
2378
2378
|
async function load(url, loaders, options, context) {
|
|
2379
|
+
let resolvedLoaders;
|
|
2380
|
+
let resolvedOptions;
|
|
2379
2381
|
if (!Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
2382
|
+
resolvedLoaders = [];
|
|
2383
|
+
resolvedOptions = loaders;
|
|
2380
2384
|
context = void 0;
|
|
2381
|
-
|
|
2382
|
-
|
|
2385
|
+
} else {
|
|
2386
|
+
resolvedLoaders = loaders;
|
|
2387
|
+
resolvedOptions = options;
|
|
2383
2388
|
}
|
|
2384
|
-
const fetch2 = getFetchFunction(
|
|
2389
|
+
const fetch2 = getFetchFunction(resolvedOptions);
|
|
2385
2390
|
let data = url;
|
|
2386
2391
|
if (typeof url === "string") {
|
|
2387
2392
|
data = await fetch2(url);
|
|
@@ -2389,7 +2394,7 @@
|
|
|
2389
2394
|
if (isBlob(url)) {
|
|
2390
2395
|
data = await fetch2(url);
|
|
2391
2396
|
}
|
|
2392
|
-
return await parse(data,
|
|
2397
|
+
return Array.isArray(resolvedLoaders) ? await parse(data, resolvedLoaders, resolvedOptions) : await parse(data, resolvedLoaders, resolvedOptions);
|
|
2393
2398
|
}
|
|
2394
2399
|
|
|
2395
2400
|
// ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
|
|
@@ -4577,7 +4582,7 @@
|
|
|
4577
4582
|
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
4578
4583
|
|
|
4579
4584
|
// ../images/src/lib/utils/version.ts
|
|
4580
|
-
var VERSION4 = true ? "
|
|
4585
|
+
var VERSION4 = true ? "4.0.0-alpha.10" : "latest";
|
|
4581
4586
|
|
|
4582
4587
|
// ../images/src/lib/category-api/image-type.ts
|
|
4583
4588
|
var { _parseImageNode } = globalThis;
|
|
@@ -4974,7 +4979,7 @@
|
|
|
4974
4979
|
};
|
|
4975
4980
|
|
|
4976
4981
|
// ../draco/src/lib/utils/version.ts
|
|
4977
|
-
var VERSION5 = true ? "
|
|
4982
|
+
var VERSION5 = true ? "4.0.0-alpha.10" : "latest";
|
|
4978
4983
|
|
|
4979
4984
|
// ../draco/src/draco-loader.ts
|
|
4980
4985
|
var DEFAULT_DRACO_OPTIONS = {
|
|
@@ -4987,9 +4992,8 @@
|
|
|
4987
4992
|
};
|
|
4988
4993
|
var DracoLoader = {
|
|
4989
4994
|
name: "Draco",
|
|
4990
|
-
id:
|
|
4995
|
+
id: "draco",
|
|
4991
4996
|
module: "draco",
|
|
4992
|
-
shapes: ["mesh"],
|
|
4993
4997
|
version: VERSION5,
|
|
4994
4998
|
worker: true,
|
|
4995
4999
|
extensions: ["drc"],
|
|
@@ -4999,7 +5003,32 @@
|
|
|
4999
5003
|
options: DEFAULT_DRACO_OPTIONS
|
|
5000
5004
|
};
|
|
5001
5005
|
|
|
5002
|
-
// ../schema/src/
|
|
5006
|
+
// ../schema/src/lib/table/simple-table/data-type.ts
|
|
5007
|
+
function getDataTypeFromTypedArray(array) {
|
|
5008
|
+
switch (array.constructor) {
|
|
5009
|
+
case Int8Array:
|
|
5010
|
+
return "int8";
|
|
5011
|
+
case Uint8Array:
|
|
5012
|
+
case Uint8ClampedArray:
|
|
5013
|
+
return "uint8";
|
|
5014
|
+
case Int16Array:
|
|
5015
|
+
return "int16";
|
|
5016
|
+
case Uint16Array:
|
|
5017
|
+
return "uint16";
|
|
5018
|
+
case Int32Array:
|
|
5019
|
+
return "int32";
|
|
5020
|
+
case Uint32Array:
|
|
5021
|
+
return "uint32";
|
|
5022
|
+
case Float32Array:
|
|
5023
|
+
return "float32";
|
|
5024
|
+
case Float64Array:
|
|
5025
|
+
return "float64";
|
|
5026
|
+
default:
|
|
5027
|
+
return "null";
|
|
5028
|
+
}
|
|
5029
|
+
}
|
|
5030
|
+
|
|
5031
|
+
// ../schema/src/lib/mesh/mesh-utils.ts
|
|
5003
5032
|
function getMeshBoundingBox(attributes) {
|
|
5004
5033
|
let minX = Infinity;
|
|
5005
5034
|
let minY = Infinity;
|
|
@@ -5026,500 +5055,34 @@
|
|
|
5026
5055
|
];
|
|
5027
5056
|
}
|
|
5028
5057
|
|
|
5029
|
-
// ../schema/src/lib/
|
|
5030
|
-
function
|
|
5031
|
-
|
|
5032
|
-
throw new Error(message || "loader assertion failed.");
|
|
5033
|
-
}
|
|
5034
|
-
}
|
|
5035
|
-
|
|
5036
|
-
// ../schema/src/lib/schema/impl/schema.ts
|
|
5037
|
-
var Schema = class {
|
|
5038
|
-
constructor(fields, metadata) {
|
|
5039
|
-
assert5(Array.isArray(fields));
|
|
5040
|
-
checkNames(fields);
|
|
5041
|
-
this.fields = fields;
|
|
5042
|
-
this.metadata = metadata || new Map();
|
|
5043
|
-
}
|
|
5044
|
-
compareTo(other) {
|
|
5045
|
-
if (this.metadata !== other.metadata) {
|
|
5046
|
-
return false;
|
|
5047
|
-
}
|
|
5048
|
-
if (this.fields.length !== other.fields.length) {
|
|
5049
|
-
return false;
|
|
5050
|
-
}
|
|
5051
|
-
for (let i2 = 0; i2 < this.fields.length; ++i2) {
|
|
5052
|
-
if (!this.fields[i2].compareTo(other.fields[i2])) {
|
|
5053
|
-
return false;
|
|
5054
|
-
}
|
|
5055
|
-
}
|
|
5056
|
-
return true;
|
|
5057
|
-
}
|
|
5058
|
-
select(...columnNames) {
|
|
5059
|
-
const nameMap = Object.create(null);
|
|
5060
|
-
for (const name of columnNames) {
|
|
5061
|
-
nameMap[name] = true;
|
|
5062
|
-
}
|
|
5063
|
-
const selectedFields = this.fields.filter((field) => nameMap[field.name]);
|
|
5064
|
-
return new Schema(selectedFields, this.metadata);
|
|
5065
|
-
}
|
|
5066
|
-
selectAt(...columnIndices) {
|
|
5067
|
-
const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean);
|
|
5068
|
-
return new Schema(selectedFields, this.metadata);
|
|
5069
|
-
}
|
|
5070
|
-
assign(schemaOrFields) {
|
|
5071
|
-
let fields;
|
|
5072
|
-
let metadata = this.metadata;
|
|
5073
|
-
if (schemaOrFields instanceof Schema) {
|
|
5074
|
-
const otherSchema = schemaOrFields;
|
|
5075
|
-
fields = otherSchema.fields;
|
|
5076
|
-
metadata = mergeMaps(mergeMaps(new Map(), this.metadata), otherSchema.metadata);
|
|
5077
|
-
} else {
|
|
5078
|
-
fields = schemaOrFields;
|
|
5079
|
-
}
|
|
5080
|
-
const fieldMap = Object.create(null);
|
|
5081
|
-
for (const field of this.fields) {
|
|
5082
|
-
fieldMap[field.name] = field;
|
|
5083
|
-
}
|
|
5084
|
-
for (const field of fields) {
|
|
5085
|
-
fieldMap[field.name] = field;
|
|
5086
|
-
}
|
|
5087
|
-
const mergedFields = Object.values(fieldMap);
|
|
5088
|
-
return new Schema(mergedFields, metadata);
|
|
5089
|
-
}
|
|
5090
|
-
};
|
|
5091
|
-
function checkNames(fields) {
|
|
5092
|
-
const usedNames = {};
|
|
5093
|
-
for (const field of fields) {
|
|
5094
|
-
if (usedNames[field.name]) {
|
|
5095
|
-
console.warn("Schema: duplicated field name", field.name, field);
|
|
5096
|
-
}
|
|
5097
|
-
usedNames[field.name] = true;
|
|
5098
|
-
}
|
|
5099
|
-
}
|
|
5100
|
-
function mergeMaps(m1, m2) {
|
|
5101
|
-
return new Map([...m1 || new Map(), ...m2 || new Map()]);
|
|
5102
|
-
}
|
|
5103
|
-
|
|
5104
|
-
// ../schema/src/lib/schema/impl/field.ts
|
|
5105
|
-
var Field = class {
|
|
5106
|
-
constructor(name, type, nullable = false, metadata = new Map()) {
|
|
5107
|
-
this.name = name;
|
|
5108
|
-
this.type = type;
|
|
5109
|
-
this.nullable = nullable;
|
|
5110
|
-
this.metadata = metadata;
|
|
5111
|
-
}
|
|
5112
|
-
get typeId() {
|
|
5113
|
-
return this.type && this.type.typeId;
|
|
5114
|
-
}
|
|
5115
|
-
clone() {
|
|
5116
|
-
return new Field(this.name, this.type, this.nullable, this.metadata);
|
|
5117
|
-
}
|
|
5118
|
-
compareTo(other) {
|
|
5119
|
-
return this.name === other.name && this.type === other.type && this.nullable === other.nullable && this.metadata === other.metadata;
|
|
5120
|
-
}
|
|
5121
|
-
toString() {
|
|
5122
|
-
return `${this.type}${this.nullable ? ", nullable" : ""}${this.metadata ? `, metadata: ${this.metadata}` : ""}`;
|
|
5123
|
-
}
|
|
5124
|
-
};
|
|
5125
|
-
|
|
5126
|
-
// ../schema/src/lib/schema/impl/enum.ts
|
|
5127
|
-
var Type;
|
|
5128
|
-
(function(Type2) {
|
|
5129
|
-
Type2[Type2["NONE"] = 0] = "NONE";
|
|
5130
|
-
Type2[Type2["Null"] = 1] = "Null";
|
|
5131
|
-
Type2[Type2["Int"] = 2] = "Int";
|
|
5132
|
-
Type2[Type2["Float"] = 3] = "Float";
|
|
5133
|
-
Type2[Type2["Binary"] = 4] = "Binary";
|
|
5134
|
-
Type2[Type2["Utf8"] = 5] = "Utf8";
|
|
5135
|
-
Type2[Type2["Bool"] = 6] = "Bool";
|
|
5136
|
-
Type2[Type2["Decimal"] = 7] = "Decimal";
|
|
5137
|
-
Type2[Type2["Date"] = 8] = "Date";
|
|
5138
|
-
Type2[Type2["Time"] = 9] = "Time";
|
|
5139
|
-
Type2[Type2["Timestamp"] = 10] = "Timestamp";
|
|
5140
|
-
Type2[Type2["Interval"] = 11] = "Interval";
|
|
5141
|
-
Type2[Type2["List"] = 12] = "List";
|
|
5142
|
-
Type2[Type2["Struct"] = 13] = "Struct";
|
|
5143
|
-
Type2[Type2["Union"] = 14] = "Union";
|
|
5144
|
-
Type2[Type2["FixedSizeBinary"] = 15] = "FixedSizeBinary";
|
|
5145
|
-
Type2[Type2["FixedSizeList"] = 16] = "FixedSizeList";
|
|
5146
|
-
Type2[Type2["Map"] = 17] = "Map";
|
|
5147
|
-
Type2[Type2["Dictionary"] = -1] = "Dictionary";
|
|
5148
|
-
Type2[Type2["Int8"] = -2] = "Int8";
|
|
5149
|
-
Type2[Type2["Int16"] = -3] = "Int16";
|
|
5150
|
-
Type2[Type2["Int32"] = -4] = "Int32";
|
|
5151
|
-
Type2[Type2["Int64"] = -5] = "Int64";
|
|
5152
|
-
Type2[Type2["Uint8"] = -6] = "Uint8";
|
|
5153
|
-
Type2[Type2["Uint16"] = -7] = "Uint16";
|
|
5154
|
-
Type2[Type2["Uint32"] = -8] = "Uint32";
|
|
5155
|
-
Type2[Type2["Uint64"] = -9] = "Uint64";
|
|
5156
|
-
Type2[Type2["Float16"] = -10] = "Float16";
|
|
5157
|
-
Type2[Type2["Float32"] = -11] = "Float32";
|
|
5158
|
-
Type2[Type2["Float64"] = -12] = "Float64";
|
|
5159
|
-
Type2[Type2["DateDay"] = -13] = "DateDay";
|
|
5160
|
-
Type2[Type2["DateMillisecond"] = -14] = "DateMillisecond";
|
|
5161
|
-
Type2[Type2["TimestampSecond"] = -15] = "TimestampSecond";
|
|
5162
|
-
Type2[Type2["TimestampMillisecond"] = -16] = "TimestampMillisecond";
|
|
5163
|
-
Type2[Type2["TimestampMicrosecond"] = -17] = "TimestampMicrosecond";
|
|
5164
|
-
Type2[Type2["TimestampNanosecond"] = -18] = "TimestampNanosecond";
|
|
5165
|
-
Type2[Type2["TimeSecond"] = -19] = "TimeSecond";
|
|
5166
|
-
Type2[Type2["TimeMillisecond"] = -20] = "TimeMillisecond";
|
|
5167
|
-
Type2[Type2["TimeMicrosecond"] = -21] = "TimeMicrosecond";
|
|
5168
|
-
Type2[Type2["TimeNanosecond"] = -22] = "TimeNanosecond";
|
|
5169
|
-
Type2[Type2["DenseUnion"] = -23] = "DenseUnion";
|
|
5170
|
-
Type2[Type2["SparseUnion"] = -24] = "SparseUnion";
|
|
5171
|
-
Type2[Type2["IntervalDayTime"] = -25] = "IntervalDayTime";
|
|
5172
|
-
Type2[Type2["IntervalYearMonth"] = -26] = "IntervalYearMonth";
|
|
5173
|
-
})(Type || (Type = {}));
|
|
5174
|
-
|
|
5175
|
-
// ../schema/src/lib/schema/impl/type.ts
|
|
5176
|
-
var DataType = class {
|
|
5177
|
-
static isNull(x) {
|
|
5178
|
-
return x && x.typeId === Type.Null;
|
|
5179
|
-
}
|
|
5180
|
-
static isInt(x) {
|
|
5181
|
-
return x && x.typeId === Type.Int;
|
|
5182
|
-
}
|
|
5183
|
-
static isFloat(x) {
|
|
5184
|
-
return x && x.typeId === Type.Float;
|
|
5185
|
-
}
|
|
5186
|
-
static isBinary(x) {
|
|
5187
|
-
return x && x.typeId === Type.Binary;
|
|
5188
|
-
}
|
|
5189
|
-
static isUtf8(x) {
|
|
5190
|
-
return x && x.typeId === Type.Utf8;
|
|
5191
|
-
}
|
|
5192
|
-
static isBool(x) {
|
|
5193
|
-
return x && x.typeId === Type.Bool;
|
|
5194
|
-
}
|
|
5195
|
-
static isDecimal(x) {
|
|
5196
|
-
return x && x.typeId === Type.Decimal;
|
|
5197
|
-
}
|
|
5198
|
-
static isDate(x) {
|
|
5199
|
-
return x && x.typeId === Type.Date;
|
|
5200
|
-
}
|
|
5201
|
-
static isTime(x) {
|
|
5202
|
-
return x && x.typeId === Type.Time;
|
|
5203
|
-
}
|
|
5204
|
-
static isTimestamp(x) {
|
|
5205
|
-
return x && x.typeId === Type.Timestamp;
|
|
5206
|
-
}
|
|
5207
|
-
static isInterval(x) {
|
|
5208
|
-
return x && x.typeId === Type.Interval;
|
|
5209
|
-
}
|
|
5210
|
-
static isList(x) {
|
|
5211
|
-
return x && x.typeId === Type.List;
|
|
5212
|
-
}
|
|
5213
|
-
static isStruct(x) {
|
|
5214
|
-
return x && x.typeId === Type.Struct;
|
|
5215
|
-
}
|
|
5216
|
-
static isUnion(x) {
|
|
5217
|
-
return x && x.typeId === Type.Union;
|
|
5218
|
-
}
|
|
5219
|
-
static isFixedSizeBinary(x) {
|
|
5220
|
-
return x && x.typeId === Type.FixedSizeBinary;
|
|
5221
|
-
}
|
|
5222
|
-
static isFixedSizeList(x) {
|
|
5223
|
-
return x && x.typeId === Type.FixedSizeList;
|
|
5224
|
-
}
|
|
5225
|
-
static isMap(x) {
|
|
5226
|
-
return x && x.typeId === Type.Map;
|
|
5227
|
-
}
|
|
5228
|
-
static isDictionary(x) {
|
|
5229
|
-
return x && x.typeId === Type.Dictionary;
|
|
5230
|
-
}
|
|
5231
|
-
get typeId() {
|
|
5232
|
-
return Type.NONE;
|
|
5233
|
-
}
|
|
5234
|
-
compareTo(other) {
|
|
5235
|
-
return this === other;
|
|
5236
|
-
}
|
|
5237
|
-
};
|
|
5238
|
-
var Null = class extends DataType {
|
|
5239
|
-
get typeId() {
|
|
5240
|
-
return Type.Null;
|
|
5241
|
-
}
|
|
5242
|
-
get [Symbol.toStringTag]() {
|
|
5243
|
-
return "Null";
|
|
5244
|
-
}
|
|
5245
|
-
toString() {
|
|
5246
|
-
return "Null";
|
|
5247
|
-
}
|
|
5248
|
-
};
|
|
5249
|
-
var Bool = class extends DataType {
|
|
5250
|
-
get typeId() {
|
|
5251
|
-
return Type.Bool;
|
|
5252
|
-
}
|
|
5253
|
-
get [Symbol.toStringTag]() {
|
|
5254
|
-
return "Bool";
|
|
5255
|
-
}
|
|
5256
|
-
toString() {
|
|
5257
|
-
return "Bool";
|
|
5258
|
-
}
|
|
5259
|
-
};
|
|
5260
|
-
var Int = class extends DataType {
|
|
5261
|
-
constructor(isSigned, bitWidth) {
|
|
5262
|
-
super();
|
|
5263
|
-
this.isSigned = isSigned;
|
|
5264
|
-
this.bitWidth = bitWidth;
|
|
5265
|
-
}
|
|
5266
|
-
get typeId() {
|
|
5267
|
-
return Type.Int;
|
|
5268
|
-
}
|
|
5269
|
-
get [Symbol.toStringTag]() {
|
|
5270
|
-
return "Int";
|
|
5271
|
-
}
|
|
5272
|
-
toString() {
|
|
5273
|
-
return `${this.isSigned ? "I" : "Ui"}nt${this.bitWidth}`;
|
|
5274
|
-
}
|
|
5275
|
-
};
|
|
5276
|
-
var Int8 = class extends Int {
|
|
5277
|
-
constructor() {
|
|
5278
|
-
super(true, 8);
|
|
5279
|
-
}
|
|
5280
|
-
};
|
|
5281
|
-
var Int16 = class extends Int {
|
|
5282
|
-
constructor() {
|
|
5283
|
-
super(true, 16);
|
|
5284
|
-
}
|
|
5285
|
-
};
|
|
5286
|
-
var Int32 = class extends Int {
|
|
5287
|
-
constructor() {
|
|
5288
|
-
super(true, 32);
|
|
5289
|
-
}
|
|
5290
|
-
};
|
|
5291
|
-
var Uint8 = class extends Int {
|
|
5292
|
-
constructor() {
|
|
5293
|
-
super(false, 8);
|
|
5294
|
-
}
|
|
5295
|
-
};
|
|
5296
|
-
var Uint16 = class extends Int {
|
|
5297
|
-
constructor() {
|
|
5298
|
-
super(false, 16);
|
|
5299
|
-
}
|
|
5300
|
-
};
|
|
5301
|
-
var Uint32 = class extends Int {
|
|
5302
|
-
constructor() {
|
|
5303
|
-
super(false, 32);
|
|
5304
|
-
}
|
|
5305
|
-
};
|
|
5306
|
-
var Precision = {
|
|
5307
|
-
HALF: 16,
|
|
5308
|
-
SINGLE: 32,
|
|
5309
|
-
DOUBLE: 64
|
|
5310
|
-
};
|
|
5311
|
-
var Float = class extends DataType {
|
|
5312
|
-
constructor(precision) {
|
|
5313
|
-
super();
|
|
5314
|
-
this.precision = precision;
|
|
5315
|
-
}
|
|
5316
|
-
get typeId() {
|
|
5317
|
-
return Type.Float;
|
|
5318
|
-
}
|
|
5319
|
-
get [Symbol.toStringTag]() {
|
|
5320
|
-
return "Float";
|
|
5321
|
-
}
|
|
5322
|
-
toString() {
|
|
5323
|
-
return `Float${this.precision}`;
|
|
5324
|
-
}
|
|
5325
|
-
};
|
|
5326
|
-
var Float32 = class extends Float {
|
|
5327
|
-
constructor() {
|
|
5328
|
-
super(Precision.SINGLE);
|
|
5329
|
-
}
|
|
5330
|
-
};
|
|
5331
|
-
var Float64 = class extends Float {
|
|
5332
|
-
constructor() {
|
|
5333
|
-
super(Precision.DOUBLE);
|
|
5334
|
-
}
|
|
5335
|
-
};
|
|
5336
|
-
var Binary = class extends DataType {
|
|
5337
|
-
constructor() {
|
|
5338
|
-
super();
|
|
5339
|
-
}
|
|
5340
|
-
get typeId() {
|
|
5341
|
-
return Type.Binary;
|
|
5342
|
-
}
|
|
5343
|
-
toString() {
|
|
5344
|
-
return "Binary";
|
|
5345
|
-
}
|
|
5346
|
-
get [Symbol.toStringTag]() {
|
|
5347
|
-
return "Binary";
|
|
5348
|
-
}
|
|
5349
|
-
};
|
|
5350
|
-
var Utf8 = class extends DataType {
|
|
5351
|
-
get typeId() {
|
|
5352
|
-
return Type.Utf8;
|
|
5353
|
-
}
|
|
5354
|
-
get [Symbol.toStringTag]() {
|
|
5355
|
-
return "Utf8";
|
|
5356
|
-
}
|
|
5357
|
-
toString() {
|
|
5358
|
-
return "Utf8";
|
|
5359
|
-
}
|
|
5360
|
-
};
|
|
5361
|
-
var DateUnit = {
|
|
5362
|
-
DAY: 0,
|
|
5363
|
-
MILLISECOND: 1
|
|
5364
|
-
};
|
|
5365
|
-
var Date2 = class extends DataType {
|
|
5366
|
-
constructor(unit) {
|
|
5367
|
-
super();
|
|
5368
|
-
this.unit = unit;
|
|
5369
|
-
}
|
|
5370
|
-
get typeId() {
|
|
5371
|
-
return Type.Date;
|
|
5372
|
-
}
|
|
5373
|
-
get [Symbol.toStringTag]() {
|
|
5374
|
-
return "Date";
|
|
5375
|
-
}
|
|
5376
|
-
toString() {
|
|
5377
|
-
return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`;
|
|
5378
|
-
}
|
|
5379
|
-
};
|
|
5380
|
-
var TimeUnit = {
|
|
5381
|
-
SECOND: 1,
|
|
5382
|
-
MILLISECOND: 1e3,
|
|
5383
|
-
MICROSECOND: 1e6,
|
|
5384
|
-
NANOSECOND: 1e9
|
|
5385
|
-
};
|
|
5386
|
-
var Time = class extends DataType {
|
|
5387
|
-
constructor(unit, bitWidth) {
|
|
5388
|
-
super();
|
|
5389
|
-
this.unit = unit;
|
|
5390
|
-
this.bitWidth = bitWidth;
|
|
5391
|
-
}
|
|
5392
|
-
get typeId() {
|
|
5393
|
-
return Type.Time;
|
|
5394
|
-
}
|
|
5395
|
-
toString() {
|
|
5396
|
-
return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`;
|
|
5397
|
-
}
|
|
5398
|
-
get [Symbol.toStringTag]() {
|
|
5399
|
-
return "Time";
|
|
5400
|
-
}
|
|
5401
|
-
};
|
|
5402
|
-
var Timestamp = class extends DataType {
|
|
5403
|
-
constructor(unit, timezone = null) {
|
|
5404
|
-
super();
|
|
5405
|
-
this.unit = unit;
|
|
5406
|
-
this.timezone = timezone;
|
|
5407
|
-
}
|
|
5408
|
-
get typeId() {
|
|
5409
|
-
return Type.Timestamp;
|
|
5410
|
-
}
|
|
5411
|
-
get [Symbol.toStringTag]() {
|
|
5412
|
-
return "Timestamp";
|
|
5413
|
-
}
|
|
5414
|
-
toString() {
|
|
5415
|
-
return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ""}>`;
|
|
5416
|
-
}
|
|
5417
|
-
};
|
|
5418
|
-
var IntervalUnit = {
|
|
5419
|
-
DAY_TIME: 0,
|
|
5420
|
-
YEAR_MONTH: 1
|
|
5421
|
-
};
|
|
5422
|
-
var Interval = class extends DataType {
|
|
5423
|
-
constructor(unit) {
|
|
5424
|
-
super();
|
|
5425
|
-
this.unit = unit;
|
|
5426
|
-
}
|
|
5427
|
-
get typeId() {
|
|
5428
|
-
return Type.Interval;
|
|
5429
|
-
}
|
|
5430
|
-
get [Symbol.toStringTag]() {
|
|
5431
|
-
return "Interval";
|
|
5432
|
-
}
|
|
5433
|
-
toString() {
|
|
5434
|
-
return `Interval<${IntervalUnit[this.unit]}>`;
|
|
5435
|
-
}
|
|
5436
|
-
};
|
|
5437
|
-
var FixedSizeList = class extends DataType {
|
|
5438
|
-
constructor(listSize, child) {
|
|
5439
|
-
super();
|
|
5440
|
-
this.listSize = listSize;
|
|
5441
|
-
this.children = [child];
|
|
5442
|
-
}
|
|
5443
|
-
get typeId() {
|
|
5444
|
-
return Type.FixedSizeList;
|
|
5445
|
-
}
|
|
5446
|
-
get valueType() {
|
|
5447
|
-
return this.children[0].type;
|
|
5448
|
-
}
|
|
5449
|
-
get valueField() {
|
|
5450
|
-
return this.children[0];
|
|
5451
|
-
}
|
|
5452
|
-
get [Symbol.toStringTag]() {
|
|
5453
|
-
return "FixedSizeList";
|
|
5454
|
-
}
|
|
5455
|
-
toString() {
|
|
5456
|
-
return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
|
|
5457
|
-
}
|
|
5458
|
-
};
|
|
5459
|
-
var Struct = class extends DataType {
|
|
5460
|
-
constructor(children) {
|
|
5461
|
-
super();
|
|
5462
|
-
this.children = children;
|
|
5463
|
-
}
|
|
5464
|
-
get typeId() {
|
|
5465
|
-
return Type.Struct;
|
|
5466
|
-
}
|
|
5467
|
-
toString() {
|
|
5468
|
-
return `Struct<{${this.children.map((f2) => `${f2.name}:${f2.type}`).join(", ")}}>`;
|
|
5469
|
-
}
|
|
5470
|
-
get [Symbol.toStringTag]() {
|
|
5471
|
-
return "Struct";
|
|
5472
|
-
}
|
|
5473
|
-
};
|
|
5474
|
-
|
|
5475
|
-
// ../schema/src/lib/arrow/arrow-like-type-utils.ts
|
|
5476
|
-
function getArrowTypeFromTypedArray(array) {
|
|
5477
|
-
switch (array.constructor) {
|
|
5478
|
-
case Int8Array:
|
|
5479
|
-
return new Int8();
|
|
5480
|
-
case Uint8Array:
|
|
5481
|
-
return new Uint8();
|
|
5482
|
-
case Int16Array:
|
|
5483
|
-
return new Int16();
|
|
5484
|
-
case Uint16Array:
|
|
5485
|
-
return new Uint16();
|
|
5486
|
-
case Int32Array:
|
|
5487
|
-
return new Int32();
|
|
5488
|
-
case Uint32Array:
|
|
5489
|
-
return new Uint32();
|
|
5490
|
-
case Float32Array:
|
|
5491
|
-
return new Float32();
|
|
5492
|
-
case Float64Array:
|
|
5493
|
-
return new Float64();
|
|
5494
|
-
default:
|
|
5495
|
-
throw new Error("array type not supported");
|
|
5496
|
-
}
|
|
5497
|
-
}
|
|
5498
|
-
|
|
5499
|
-
// ../schema/src/category/mesh/deduce-mesh-schema.ts
|
|
5500
|
-
function deduceMeshField(attributeName, attribute, optionalMetadata) {
|
|
5501
|
-
const type = getArrowTypeFromTypedArray(attribute.value);
|
|
5058
|
+
// ../schema/src/lib/mesh/deduce-mesh-schema.ts
|
|
5059
|
+
function deduceMeshField(name, attribute, optionalMetadata) {
|
|
5060
|
+
const type = getDataTypeFromTypedArray(attribute.value);
|
|
5502
5061
|
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
5503
|
-
|
|
5504
|
-
|
|
5062
|
+
return {
|
|
5063
|
+
name,
|
|
5064
|
+
type: { type: "fixed-size-list", listSize: attribute.size, children: [{ name: "value", type }] },
|
|
5065
|
+
nullable: false,
|
|
5066
|
+
metadata
|
|
5067
|
+
};
|
|
5505
5068
|
}
|
|
5506
5069
|
function makeMeshAttributeMetadata(attribute) {
|
|
5507
|
-
const result =
|
|
5070
|
+
const result = {};
|
|
5508
5071
|
if ("byteOffset" in attribute) {
|
|
5509
|
-
result.
|
|
5072
|
+
result.byteOffset = attribute.byteOffset.toString(10);
|
|
5510
5073
|
}
|
|
5511
5074
|
if ("byteStride" in attribute) {
|
|
5512
|
-
result.
|
|
5075
|
+
result.byteStride = attribute.byteStride.toString(10);
|
|
5513
5076
|
}
|
|
5514
5077
|
if ("normalized" in attribute) {
|
|
5515
|
-
result.
|
|
5078
|
+
result.normalized = attribute.normalized.toString();
|
|
5516
5079
|
}
|
|
5517
5080
|
return result;
|
|
5518
5081
|
}
|
|
5519
5082
|
|
|
5520
5083
|
// ../draco/src/lib/utils/get-draco-schema.ts
|
|
5521
5084
|
function getDracoSchema(attributes, loaderData, indices) {
|
|
5522
|
-
const
|
|
5085
|
+
const metadata = makeMetadata(loaderData.metadata);
|
|
5523
5086
|
const fields = [];
|
|
5524
5087
|
const namedLoaderDataAttributes = transformAttributesLoaderData(loaderData.attributes);
|
|
5525
5088
|
for (const attributeName in attributes) {
|
|
@@ -5531,7 +5094,7 @@
|
|
|
5531
5094
|
const indicesField = getArrowFieldFromAttribute("indices", indices);
|
|
5532
5095
|
fields.push(indicesField);
|
|
5533
5096
|
}
|
|
5534
|
-
return
|
|
5097
|
+
return { fields, metadata };
|
|
5535
5098
|
}
|
|
5536
5099
|
function transformAttributesLoaderData(loaderData) {
|
|
5537
5100
|
const result = {};
|
|
@@ -5547,11 +5110,12 @@
|
|
|
5547
5110
|
return field;
|
|
5548
5111
|
}
|
|
5549
5112
|
function makeMetadata(metadata) {
|
|
5550
|
-
|
|
5113
|
+
Object.entries(metadata);
|
|
5114
|
+
const serializedMetadata = {};
|
|
5551
5115
|
for (const key in metadata) {
|
|
5552
|
-
|
|
5116
|
+
serializedMetadata[`${key}.string`] = JSON.stringify(metadata[key]);
|
|
5553
5117
|
}
|
|
5554
|
-
return
|
|
5118
|
+
return serializedMetadata;
|
|
5555
5119
|
}
|
|
5556
5120
|
|
|
5557
5121
|
// ../draco/src/lib/draco-parser.ts
|
|
@@ -5960,10 +5524,10 @@
|
|
|
5960
5524
|
}
|
|
5961
5525
|
|
|
5962
5526
|
// ../textures/src/lib/utils/version.ts
|
|
5963
|
-
var VERSION6 = true ? "
|
|
5527
|
+
var VERSION6 = true ? "4.0.0-alpha.10" : "beta";
|
|
5964
5528
|
|
|
5965
5529
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
5966
|
-
var VERSION7 = true ? "
|
|
5530
|
+
var VERSION7 = true ? "4.0.0-alpha.10" : "beta";
|
|
5967
5531
|
var BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.wasm`;
|
|
5968
5532
|
var BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION7}/dist/libs/basis_encoder.js`;
|
|
5969
5533
|
var loadBasisTranscoderPromise;
|
|
@@ -6553,7 +6117,7 @@
|
|
|
6553
6117
|
// ../textures/src/basis-loader.ts
|
|
6554
6118
|
var BasisWorkerLoader = {
|
|
6555
6119
|
name: "Basis",
|
|
6556
|
-
id:
|
|
6120
|
+
id: "basis",
|
|
6557
6121
|
module: "textures",
|
|
6558
6122
|
version: VERSION6,
|
|
6559
6123
|
worker: true,
|
|
@@ -7604,7 +7168,7 @@
|
|
|
7604
7168
|
})(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
|
|
7605
7169
|
|
|
7606
7170
|
// src/lib/parsers/parse-i3s-attribute.ts
|
|
7607
|
-
|
|
7171
|
+
function parseI3STileAttribute(arrayBuffer, options) {
|
|
7608
7172
|
const { attributeName, attributeType } = options;
|
|
7609
7173
|
if (!attributeName) {
|
|
7610
7174
|
return {};
|
|
@@ -7661,22 +7225,18 @@
|
|
|
7661
7225
|
}
|
|
7662
7226
|
|
|
7663
7227
|
// src/i3s-attribute-loader.ts
|
|
7664
|
-
var VERSION8 = true ? "
|
|
7228
|
+
var VERSION8 = true ? "4.0.0-alpha.10" : "latest";
|
|
7665
7229
|
var I3SAttributeLoader = {
|
|
7666
7230
|
name: "I3S Attribute",
|
|
7667
7231
|
id: "i3s-attribute",
|
|
7668
7232
|
module: "i3s",
|
|
7669
7233
|
version: VERSION8,
|
|
7670
7234
|
mimeTypes: ["application/binary"],
|
|
7671
|
-
parse:
|
|
7235
|
+
parse: async (arrayBuffer, options) => parseI3STileAttribute(arrayBuffer, options),
|
|
7672
7236
|
extensions: ["bin"],
|
|
7673
7237
|
options: {},
|
|
7674
7238
|
binary: true
|
|
7675
7239
|
};
|
|
7676
|
-
async function parse3(data, options) {
|
|
7677
|
-
data = parseI3STileAttribute(data, options);
|
|
7678
|
-
return data;
|
|
7679
|
-
}
|
|
7680
7240
|
function getAttributeValueType(attribute) {
|
|
7681
7241
|
if (attribute.hasOwnProperty("objectIds")) {
|
|
7682
7242
|
return "Oid32";
|
|
@@ -7686,7 +7246,7 @@
|
|
|
7686
7246
|
return "";
|
|
7687
7247
|
}
|
|
7688
7248
|
|
|
7689
|
-
// src/lib/utils/
|
|
7249
|
+
// src/lib/utils/customize-сolors.ts
|
|
7690
7250
|
async function customizeColors(colors, featureIds, tileOptions, tilesetOptions, options) {
|
|
7691
7251
|
if (!options?.i3s?.colorsByAttribute) {
|
|
7692
7252
|
return colors;
|
|
@@ -7716,7 +7276,13 @@
|
|
|
7716
7276
|
if (!color) {
|
|
7717
7277
|
continue;
|
|
7718
7278
|
}
|
|
7719
|
-
|
|
7279
|
+
if (options.i3s.colorsByAttribute.mode === "multiply") {
|
|
7280
|
+
color.forEach((colorItem, index) => {
|
|
7281
|
+
colors.value[i2 * 4 + index] = colors.value[i2 * 4 + index] * colorItem / 255;
|
|
7282
|
+
});
|
|
7283
|
+
} else {
|
|
7284
|
+
colors.value.set(color, i2 * 4);
|
|
7285
|
+
}
|
|
7720
7286
|
}
|
|
7721
7287
|
return colors;
|
|
7722
7288
|
}
|
|
@@ -8122,21 +7688,21 @@
|
|
|
8122
7688
|
}
|
|
8123
7689
|
|
|
8124
7690
|
// src/i3s-content-loader.ts
|
|
8125
|
-
var VERSION9 = true ? "
|
|
7691
|
+
var VERSION9 = true ? "4.0.0-alpha.10" : "beta";
|
|
8126
7692
|
var I3SContentLoader = {
|
|
8127
7693
|
name: "I3S Content (Indexed Scene Layers)",
|
|
8128
|
-
id:
|
|
7694
|
+
id: "i3s-content",
|
|
8129
7695
|
module: "i3s",
|
|
8130
7696
|
worker: true,
|
|
8131
7697
|
version: VERSION9,
|
|
8132
7698
|
mimeTypes: ["application/octet-stream"],
|
|
8133
|
-
parse:
|
|
7699
|
+
parse: parse3,
|
|
8134
7700
|
extensions: ["bin"],
|
|
8135
7701
|
options: {
|
|
8136
7702
|
"i3s-content": {}
|
|
8137
7703
|
}
|
|
8138
7704
|
};
|
|
8139
|
-
async function
|
|
7705
|
+
async function parse3(data, options, context) {
|
|
8140
7706
|
const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
|
|
8141
7707
|
const tileOptions = _tileOptions || tile;
|
|
8142
7708
|
const tilesetOptions = _tilesetOptions || tileset;
|