@loaders.gl/arrow 4.2.0-alpha.5 → 4.2.0-beta.1
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/arrow-loader.d.ts +48 -4
- package/dist/arrow-loader.d.ts.map +1 -1
- package/dist/arrow-loader.js +3 -1
- package/dist/arrow-worker.js +6 -2
- package/dist/arrow-writer.d.ts +13 -2
- package/dist/arrow-writer.d.ts.map +1 -1
- package/dist/arrow-writer.js +1 -1
- package/dist/dist.dev.js +107 -73
- package/dist/dist.min.js +5 -5
- package/dist/geoarrow-loader.d.ts +44 -9
- package/dist/geoarrow-loader.d.ts.map +1 -1
- package/dist/geoarrow-loader.js +1 -6
- package/dist/geoarrow-writer.d.ts +13 -2
- package/dist/geoarrow-writer.d.ts.map +1 -1
- package/dist/geoarrow-writer.js +1 -1
- package/dist/index.cjs +7 -9
- package/dist/index.cjs.map +2 -2
- package/dist/lib/arrow-table-batch.js +1 -0
- package/dist/triangulate-on-worker.js +1 -1
- package/dist/triangulation-worker.js +6 -1
- package/package.json +7 -6
- package/src/arrow-loader.ts +17 -8
- package/src/arrow-writer.ts +2 -2
- package/src/geoarrow/convert-geoarrow-to-geojson-geometry.ts +2 -2
- package/src/geoarrow-loader.ts +11 -19
- package/src/geoarrow-writer.ts +2 -6
package/dist/arrow-loader.d.ts
CHANGED
|
@@ -1,14 +1,58 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ArrayRowTable,
|
|
1
|
+
import type { LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { ArrayRowTable, ColumnarTable, ObjectRowTable } from '@loaders.gl/schema';
|
|
3
3
|
import type { ArrowTable } from "./lib/arrow-table.js";
|
|
4
|
+
import { parseArrowInBatches } from "./parsers/parse-arrow-in-batches.js";
|
|
5
|
+
/** ArrowLoader options */
|
|
4
6
|
export type ArrowLoaderOptions = LoaderOptions & {
|
|
7
|
+
/** ArrowLoader options */
|
|
5
8
|
arrow?: {
|
|
9
|
+
/** Shape of returned data */
|
|
6
10
|
shape: 'arrow-table' | 'columnar-table' | 'array-row-table' | 'object-row-table';
|
|
11
|
+
/** Debounce time between batches (prevent excessive numbers of small batches) */
|
|
7
12
|
batchDebounceMs?: number;
|
|
13
|
+
/** Override the URL to the worker bundle (by default loads from unpkg.com) */
|
|
14
|
+
workerUrl?: string;
|
|
8
15
|
};
|
|
9
16
|
};
|
|
10
17
|
/** ArrowJS table loader */
|
|
11
|
-
export declare const ArrowWorkerLoader:
|
|
18
|
+
export declare const ArrowWorkerLoader: {
|
|
19
|
+
readonly dataType: ArrowTable;
|
|
20
|
+
readonly batchType: never;
|
|
21
|
+
readonly name: "Apache Arrow";
|
|
22
|
+
readonly id: "arrow";
|
|
23
|
+
readonly module: "arrow";
|
|
24
|
+
readonly version: any;
|
|
25
|
+
readonly category: "table";
|
|
26
|
+
readonly extensions: ["arrow", "feather"];
|
|
27
|
+
readonly mimeTypes: ["application/vnd.apache.arrow.file", "application/vnd.apache.arrow.stream", "application/octet-stream"];
|
|
28
|
+
readonly binary: true;
|
|
29
|
+
readonly tests: ["ARROW"];
|
|
30
|
+
readonly options: {
|
|
31
|
+
readonly arrow: {
|
|
32
|
+
readonly shape: "columnar-table";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
12
36
|
/** ArrowJS table loader */
|
|
13
|
-
export declare const ArrowLoader:
|
|
37
|
+
export declare const ArrowLoader: {
|
|
38
|
+
readonly parse: (arraybuffer: ArrayBuffer, options?: ArrowLoaderOptions) => Promise<ArrowTable | ColumnarTable | ObjectRowTable | ArrayRowTable>;
|
|
39
|
+
readonly parseSync: (arraybuffer: ArrayBuffer, options?: ArrowLoaderOptions) => ArrowTable | ColumnarTable | ObjectRowTable | ArrayRowTable;
|
|
40
|
+
readonly parseInBatches: typeof parseArrowInBatches;
|
|
41
|
+
readonly dataType: ArrowTable;
|
|
42
|
+
readonly batchType: never;
|
|
43
|
+
readonly name: "Apache Arrow";
|
|
44
|
+
readonly id: "arrow";
|
|
45
|
+
readonly module: "arrow";
|
|
46
|
+
readonly version: any;
|
|
47
|
+
readonly category: "table";
|
|
48
|
+
readonly extensions: ["arrow", "feather"];
|
|
49
|
+
readonly mimeTypes: ["application/vnd.apache.arrow.file", "application/vnd.apache.arrow.stream", "application/octet-stream"];
|
|
50
|
+
readonly binary: true;
|
|
51
|
+
readonly tests: ["ARROW"];
|
|
52
|
+
readonly options: {
|
|
53
|
+
readonly arrow: {
|
|
54
|
+
readonly shape: "columnar-table";
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
14
58
|
//# sourceMappingURL=arrow-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-loader.d.ts","sourceRoot":"","sources":["../src/arrow-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"arrow-loader.d.ts","sourceRoot":"","sources":["../src/arrow-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA2B,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACb,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,UAAU,EAAC,6BAA0B;AAElD,OAAO,EAAC,mBAAmB,EAAC,4CAAyC;AAMrE,0BAA0B;AAC1B,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,0BAA0B;IAC1B,KAAK,CAAC,EAAE;QACN,6BAA6B;QAC7B,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;QACjF,iFAAiF;QACjF,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,8EAA8E;QAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,2BAA2B;AAC3B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;CAuBoC,CAAC;AAEnE,2BAA2B;AAC3B,eAAO,MAAM,WAAW;kCAEK,WAAW,YAAY,kBAAkB;sCAE3C,WAAW,YAAY,kBAAkB;;;;;;;;;;;;;;;;;;CAOnE,CAAC"}
|
package/dist/arrow-loader.js
CHANGED
|
@@ -5,9 +5,11 @@ import { parseArrowSync } from "./parsers/parse-arrow-sync.js";
|
|
|
5
5
|
import { parseArrowInBatches } from "./parsers/parse-arrow-in-batches.js";
|
|
6
6
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
7
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
-
const VERSION = typeof "4.2.0-alpha.
|
|
8
|
+
const VERSION = typeof "4.2.0-alpha.6" !== 'undefined' ? "4.2.0-alpha.6" : 'latest';
|
|
9
9
|
/** ArrowJS table loader */
|
|
10
10
|
export const ArrowWorkerLoader = {
|
|
11
|
+
dataType: null,
|
|
12
|
+
batchType: null,
|
|
11
13
|
name: 'Apache Arrow',
|
|
12
14
|
id: 'arrow',
|
|
13
15
|
module: 'arrow',
|
package/dist/arrow-worker.js
CHANGED
|
@@ -65,7 +65,9 @@
|
|
|
65
65
|
}
|
|
66
66
|
getParentPort().then((parentPort2) => {
|
|
67
67
|
if (parentPort2) {
|
|
68
|
-
parentPort2.on("message",
|
|
68
|
+
parentPort2.on("message", (message) => {
|
|
69
|
+
handleMessage(message);
|
|
70
|
+
});
|
|
69
71
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
70
72
|
} else {
|
|
71
73
|
globalThis.onmessage = handleMessage;
|
|
@@ -12497,8 +12499,10 @@ return true;`);
|
|
|
12497
12499
|
}
|
|
12498
12500
|
|
|
12499
12501
|
// src/arrow-loader.ts
|
|
12500
|
-
var VERSION = true ? "4.2.0-alpha.
|
|
12502
|
+
var VERSION = true ? "4.2.0-alpha.6" : "latest";
|
|
12501
12503
|
var ArrowWorkerLoader = {
|
|
12504
|
+
dataType: null,
|
|
12505
|
+
batchType: null,
|
|
12502
12506
|
name: "Apache Arrow",
|
|
12503
12507
|
id: "arrow",
|
|
12504
12508
|
module: "arrow",
|
package/dist/arrow-writer.d.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WriterOptions } from '@loaders.gl/loader-utils';
|
|
2
2
|
import { ColumnarTable } from "./lib/encode-arrow.js";
|
|
3
3
|
type ArrowWriterOptions = WriterOptions & {
|
|
4
4
|
arrow?: {};
|
|
5
5
|
};
|
|
6
6
|
/** Apache Arrow writer */
|
|
7
|
-
export declare const ArrowWriter:
|
|
7
|
+
export declare const ArrowWriter: {
|
|
8
|
+
readonly name: "Apache Arrow";
|
|
9
|
+
readonly id: "arrow";
|
|
10
|
+
readonly module: "arrow";
|
|
11
|
+
readonly version: any;
|
|
12
|
+
readonly extensions: ["arrow", "feather"];
|
|
13
|
+
readonly mimeTypes: ["application/vnd.apache.arrow.file", "application/vnd.apache.arrow.stream", "application/octet-stream"];
|
|
14
|
+
readonly binary: true;
|
|
15
|
+
readonly options: {};
|
|
16
|
+
readonly encode: (data: ColumnarTable, options?: ArrowWriterOptions | undefined) => Promise<ArrayBuffer>;
|
|
17
|
+
readonly encodeSync: (data: ColumnarTable, options?: ArrowWriterOptions | undefined) => ArrayBuffer;
|
|
18
|
+
};
|
|
8
19
|
export {};
|
|
9
20
|
//# sourceMappingURL=arrow-writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-writer.d.ts","sourceRoot":"","sources":["../src/arrow-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"arrow-writer.d.ts","sourceRoot":"","sources":["../src/arrow-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAC,aAAa,EAAC,8BAA2B;AAOjD,KAAK,kBAAkB,GAAG,aAAa,GAAG;IACxC,KAAK,CAAC,EAAE,EAAE,CAAC;CACZ,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,WAAW;;;;;;;;;wFAa8B,QAAQ,WAAW,CAAC;;CAMM,CAAC"}
|
package/dist/arrow-writer.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { encodeArrowSync } from "./lib/encode-arrow.js";
|
|
3
3
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
4
4
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
5
|
-
const VERSION = typeof "4.2.0-alpha.
|
|
5
|
+
const VERSION = typeof "4.2.0-alpha.6" !== 'undefined' ? "4.2.0-alpha.6" : 'latest';
|
|
6
6
|
/** Apache Arrow writer */
|
|
7
7
|
export const ArrowWriter = {
|
|
8
8
|
name: 'Apache Arrow',
|
package/dist/dist.dev.js
CHANGED
|
@@ -12,6 +12,7 @@ var __exports__ = (() => {
|
|
|
12
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
13
|
var __getProtoOf = Object.getPrototypeOf;
|
|
14
14
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
16
|
var __commonJS = (cb, mod) => function __require() {
|
|
16
17
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
18
|
};
|
|
@@ -37,6 +38,10 @@ var __exports__ = (() => {
|
|
|
37
38
|
mod
|
|
38
39
|
));
|
|
39
40
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
|
+
var __publicField = (obj, key, value) => {
|
|
42
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
43
|
+
return value;
|
|
44
|
+
};
|
|
40
45
|
|
|
41
46
|
// external-global-plugin:@loaders.gl/core
|
|
42
47
|
var require_core = __commonJS({
|
|
@@ -80,11 +85,14 @@ var __exports__ = (() => {
|
|
|
80
85
|
// ../schema/src/lib/table/batches/base-table-batch-aggregator.ts
|
|
81
86
|
var DEFAULT_ROW_COUNT = 100;
|
|
82
87
|
var BaseTableBatchAggregator = class {
|
|
88
|
+
schema;
|
|
89
|
+
options;
|
|
90
|
+
shape;
|
|
91
|
+
length = 0;
|
|
92
|
+
rows = null;
|
|
93
|
+
cursor = 0;
|
|
94
|
+
_headers = [];
|
|
83
95
|
constructor(schema, options) {
|
|
84
|
-
this.length = 0;
|
|
85
|
-
this.rows = null;
|
|
86
|
-
this.cursor = 0;
|
|
87
|
-
this._headers = [];
|
|
88
96
|
this.options = options;
|
|
89
97
|
this.schema = schema;
|
|
90
98
|
if (!Array.isArray(schema)) {
|
|
@@ -180,12 +188,14 @@ var __exports__ = (() => {
|
|
|
180
188
|
// ../schema/src/lib/table/batches/row-table-batch-aggregator.ts
|
|
181
189
|
var DEFAULT_ROW_COUNT2 = 100;
|
|
182
190
|
var RowTableBatchAggregator = class {
|
|
191
|
+
schema;
|
|
192
|
+
options;
|
|
193
|
+
length = 0;
|
|
194
|
+
objectRows = null;
|
|
195
|
+
arrayRows = null;
|
|
196
|
+
cursor = 0;
|
|
197
|
+
_headers = null;
|
|
183
198
|
constructor(schema, options) {
|
|
184
|
-
this.length = 0;
|
|
185
|
-
this.objectRows = null;
|
|
186
|
-
this.arrayRows = null;
|
|
187
|
-
this.cursor = 0;
|
|
188
|
-
this._headers = null;
|
|
189
199
|
this.options = options;
|
|
190
200
|
this.schema = schema;
|
|
191
201
|
if (schema) {
|
|
@@ -255,10 +265,11 @@ var __exports__ = (() => {
|
|
|
255
265
|
// ../schema/src/lib/table/batches/columnar-table-batch-aggregator.ts
|
|
256
266
|
var DEFAULT_ROW_COUNT3 = 100;
|
|
257
267
|
var ColumnarTableBatchAggregator = class {
|
|
268
|
+
schema;
|
|
269
|
+
length = 0;
|
|
270
|
+
allocated = 0;
|
|
271
|
+
columns = {};
|
|
258
272
|
constructor(schema, options) {
|
|
259
|
-
this.length = 0;
|
|
260
|
-
this.allocated = 0;
|
|
261
|
-
this.columns = {};
|
|
262
273
|
this.schema = schema;
|
|
263
274
|
this._reallocateColumns();
|
|
264
275
|
}
|
|
@@ -338,16 +349,18 @@ var __exports__ = (() => {
|
|
|
338
349
|
_limitMB: 0
|
|
339
350
|
};
|
|
340
351
|
var ERR_MESSAGE = "TableBatchBuilder";
|
|
341
|
-
var
|
|
352
|
+
var _TableBatchBuilder = class {
|
|
353
|
+
schema;
|
|
354
|
+
options;
|
|
355
|
+
aggregator = null;
|
|
356
|
+
batchCount = 0;
|
|
357
|
+
bytesUsed = 0;
|
|
358
|
+
isChunkComplete = false;
|
|
359
|
+
lastBatchEmittedMs = Date.now();
|
|
360
|
+
totalLength = 0;
|
|
361
|
+
totalBytes = 0;
|
|
362
|
+
rowBytes = 0;
|
|
342
363
|
constructor(schema, options) {
|
|
343
|
-
this.aggregator = null;
|
|
344
|
-
this.batchCount = 0;
|
|
345
|
-
this.bytesUsed = 0;
|
|
346
|
-
this.isChunkComplete = false;
|
|
347
|
-
this.lastBatchEmittedMs = Date.now();
|
|
348
|
-
this.totalLength = 0;
|
|
349
|
-
this.totalBytes = 0;
|
|
350
|
-
this.rowBytes = 0;
|
|
351
364
|
this.schema = schema;
|
|
352
365
|
this.options = { ...DEFAULT_OPTIONS, ...options };
|
|
353
366
|
}
|
|
@@ -454,15 +467,17 @@ var __exports__ = (() => {
|
|
|
454
467
|
case "columnar-table":
|
|
455
468
|
return ColumnarTableBatchAggregator;
|
|
456
469
|
case "arrow-table":
|
|
457
|
-
if (!
|
|
470
|
+
if (!_TableBatchBuilder.ArrowBatch) {
|
|
458
471
|
throw new Error(ERR_MESSAGE);
|
|
459
472
|
}
|
|
460
|
-
return
|
|
473
|
+
return _TableBatchBuilder.ArrowBatch;
|
|
461
474
|
default:
|
|
462
475
|
return BaseTableBatchAggregator;
|
|
463
476
|
}
|
|
464
477
|
}
|
|
465
478
|
};
|
|
479
|
+
var TableBatchBuilder = _TableBatchBuilder;
|
|
480
|
+
__publicField(TableBatchBuilder, "ArrowBatch");
|
|
466
481
|
|
|
467
482
|
// ../schema/src/lib/table/simple-table/table-accessors.ts
|
|
468
483
|
function getTableLength(table) {
|
|
@@ -12685,6 +12700,7 @@ return true;`);
|
|
|
12685
12700
|
|
|
12686
12701
|
// src/lib/arrow-table-batch.ts
|
|
12687
12702
|
var ArrowTableBatchAggregator = class extends ColumnarTableBatchAggregator {
|
|
12703
|
+
arrowSchema;
|
|
12688
12704
|
constructor(schema, options) {
|
|
12689
12705
|
super(schema, options);
|
|
12690
12706
|
this.arrowSchema = null;
|
|
@@ -13106,6 +13122,8 @@ return true;`);
|
|
|
13106
13122
|
// src/arrow-loader.ts
|
|
13107
13123
|
var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
13108
13124
|
var ArrowWorkerLoader = {
|
|
13125
|
+
dataType: null,
|
|
13126
|
+
batchType: null,
|
|
13109
13127
|
name: "Apache Arrow",
|
|
13110
13128
|
id: "arrow",
|
|
13111
13129
|
module: "arrow",
|
|
@@ -13922,12 +13940,7 @@ return true;`);
|
|
|
13922
13940
|
}
|
|
13923
13941
|
};
|
|
13924
13942
|
var GeoArrowLoader = {
|
|
13925
|
-
...
|
|
13926
|
-
options: {
|
|
13927
|
-
arrow: {
|
|
13928
|
-
shape: "arrow-table"
|
|
13929
|
-
}
|
|
13930
|
-
},
|
|
13943
|
+
...GeoArrowWorkerLoader,
|
|
13931
13944
|
parse: async (arraybuffer, options) => parseGeoArrowSync(arraybuffer, options?.arrow),
|
|
13932
13945
|
parseSync: (arraybuffer, options) => parseGeoArrowSync(arraybuffer, options?.arrow),
|
|
13933
13946
|
parseInBatches: parseGeoArrowInBatches
|
|
@@ -14494,6 +14507,8 @@ return true;`);
|
|
|
14494
14507
|
|
|
14495
14508
|
// ../wkt/src/wkt-loader.ts
|
|
14496
14509
|
var WKTWorkerLoader = {
|
|
14510
|
+
dataType: null,
|
|
14511
|
+
batchType: null,
|
|
14497
14512
|
name: "WKT (Well-Known Text)",
|
|
14498
14513
|
id: "wkt",
|
|
14499
14514
|
module: "wkt",
|
|
@@ -14515,7 +14530,7 @@ return true;`);
|
|
|
14515
14530
|
var WKTLoader = {
|
|
14516
14531
|
...WKTWorkerLoader,
|
|
14517
14532
|
parse: async (arrayBuffer, options) => parseWKT(new TextDecoder().decode(arrayBuffer), options),
|
|
14518
|
-
parseTextSync: parseWKT
|
|
14533
|
+
parseTextSync: (string, options) => parseWKT(string, options)
|
|
14519
14534
|
};
|
|
14520
14535
|
|
|
14521
14536
|
// ../wkt/src/lib/parse-wkb-header.ts
|
|
@@ -14688,7 +14703,7 @@ return true;`);
|
|
|
14688
14703
|
geometry: {
|
|
14689
14704
|
type: "LineString",
|
|
14690
14705
|
positions: { value: positions, size: dimension },
|
|
14691
|
-
pathIndices: { value: new
|
|
14706
|
+
pathIndices: { value: new Uint32Array(pathIndices), size: 1 }
|
|
14692
14707
|
},
|
|
14693
14708
|
offset
|
|
14694
14709
|
};
|
|
@@ -14716,10 +14731,10 @@ return true;`);
|
|
|
14716
14731
|
type: "Polygon",
|
|
14717
14732
|
positions: { value: concatenatedPositions, size: dimension },
|
|
14718
14733
|
polygonIndices: {
|
|
14719
|
-
value: new
|
|
14734
|
+
value: new Uint32Array(polygonIndices),
|
|
14720
14735
|
size: 1
|
|
14721
14736
|
},
|
|
14722
|
-
primitivePolygonIndices: { value: new
|
|
14737
|
+
primitivePolygonIndices: { value: new Uint32Array(primitivePolygonIndices), size: 1 }
|
|
14723
14738
|
},
|
|
14724
14739
|
offset
|
|
14725
14740
|
};
|
|
@@ -14791,7 +14806,7 @@ return true;`);
|
|
|
14791
14806
|
return {
|
|
14792
14807
|
type: "LineString",
|
|
14793
14808
|
positions: { value: concatenatedPositions, size: dimension },
|
|
14794
|
-
pathIndices: { value: new
|
|
14809
|
+
pathIndices: { value: new Uint32Array(pathIndices), size: 1 }
|
|
14795
14810
|
};
|
|
14796
14811
|
}
|
|
14797
14812
|
function concatenateBinaryPolygonGeometries(binaryPolygonGeometries, dimension) {
|
|
@@ -14814,8 +14829,8 @@ return true;`);
|
|
|
14814
14829
|
return {
|
|
14815
14830
|
type: "Polygon",
|
|
14816
14831
|
positions: { value: concatenatedPositions, size: dimension },
|
|
14817
|
-
polygonIndices: { value: new
|
|
14818
|
-
primitivePolygonIndices: { value: new
|
|
14832
|
+
polygonIndices: { value: new Uint32Array(polygonIndices), size: 1 },
|
|
14833
|
+
primitivePolygonIndices: { value: new Uint32Array(primitivePolygonIndices), size: 1 }
|
|
14819
14834
|
};
|
|
14820
14835
|
}
|
|
14821
14836
|
function concatTypedArrays(arrays) {
|
|
@@ -14837,6 +14852,8 @@ return true;`);
|
|
|
14837
14852
|
|
|
14838
14853
|
// ../wkt/src/wkb-loader.ts
|
|
14839
14854
|
var WKBWorkerLoader = {
|
|
14855
|
+
dataType: null,
|
|
14856
|
+
batchType: null,
|
|
14840
14857
|
name: "WKB",
|
|
14841
14858
|
id: "wkb",
|
|
14842
14859
|
module: "wkt",
|
|
@@ -15097,12 +15114,16 @@ return true;`);
|
|
|
15097
15114
|
|
|
15098
15115
|
// ../worker-utils/src/lib/worker-farm/worker-job.ts
|
|
15099
15116
|
var WorkerJob = class {
|
|
15117
|
+
name;
|
|
15118
|
+
workerThread;
|
|
15119
|
+
isRunning = true;
|
|
15120
|
+
/** Promise that resolves when Job is done */
|
|
15121
|
+
result;
|
|
15122
|
+
_resolve = () => {
|
|
15123
|
+
};
|
|
15124
|
+
_reject = () => {
|
|
15125
|
+
};
|
|
15100
15126
|
constructor(jobName, workerThread) {
|
|
15101
|
-
this.isRunning = true;
|
|
15102
|
-
this._resolve = () => {
|
|
15103
|
-
};
|
|
15104
|
-
this._reject = () => {
|
|
15105
|
-
};
|
|
15106
15127
|
this.name = jobName;
|
|
15107
15128
|
this.workerThread = workerThread;
|
|
15108
15129
|
this.result = new Promise((resolve, reject) => {
|
|
@@ -15239,9 +15260,19 @@ return true;`);
|
|
|
15239
15260
|
var NOOP = () => {
|
|
15240
15261
|
};
|
|
15241
15262
|
var WorkerThread = class {
|
|
15263
|
+
name;
|
|
15264
|
+
source;
|
|
15265
|
+
url;
|
|
15266
|
+
terminated = false;
|
|
15267
|
+
worker;
|
|
15268
|
+
onMessage;
|
|
15269
|
+
onError;
|
|
15270
|
+
_loadableURL = "";
|
|
15271
|
+
/** Checks if workers are supported on this platform */
|
|
15272
|
+
static isSupported() {
|
|
15273
|
+
return typeof Worker !== "undefined" && isBrowser || typeof NodeWorker !== "undefined" && !isBrowser;
|
|
15274
|
+
}
|
|
15242
15275
|
constructor(props) {
|
|
15243
|
-
this.terminated = false;
|
|
15244
|
-
this._loadableURL = "";
|
|
15245
15276
|
const { name, source, url } = props;
|
|
15246
15277
|
assert(source || url);
|
|
15247
15278
|
this.name = name;
|
|
@@ -15251,10 +15282,6 @@ return true;`);
|
|
|
15251
15282
|
this.onError = (error) => console.log(error);
|
|
15252
15283
|
this.worker = isBrowser ? this._createBrowserWorker() : this._createNodeWorker();
|
|
15253
15284
|
}
|
|
15254
|
-
/** Checks if workers are supported on this platform */
|
|
15255
|
-
static isSupported() {
|
|
15256
|
-
return typeof Worker !== "undefined" && isBrowser || typeof NodeWorker !== "undefined" && !isBrowser;
|
|
15257
|
-
}
|
|
15258
15285
|
/**
|
|
15259
15286
|
* Terminate this worker thread
|
|
15260
15287
|
* @note Can free up significant memory
|
|
@@ -15342,30 +15369,33 @@ return true;`);
|
|
|
15342
15369
|
|
|
15343
15370
|
// ../worker-utils/src/lib/worker-farm/worker-pool.ts
|
|
15344
15371
|
var WorkerPool = class {
|
|
15372
|
+
name = "unnamed";
|
|
15373
|
+
source;
|
|
15374
|
+
// | Function;
|
|
15375
|
+
url;
|
|
15376
|
+
maxConcurrency = 1;
|
|
15377
|
+
maxMobileConcurrency = 1;
|
|
15378
|
+
onDebug = () => {
|
|
15379
|
+
};
|
|
15380
|
+
reuseWorkers = true;
|
|
15381
|
+
props = {};
|
|
15382
|
+
jobQueue = [];
|
|
15383
|
+
idleQueue = [];
|
|
15384
|
+
count = 0;
|
|
15385
|
+
isDestroyed = false;
|
|
15386
|
+
/** Checks if workers are supported on this platform */
|
|
15387
|
+
static isSupported() {
|
|
15388
|
+
return WorkerThread.isSupported();
|
|
15389
|
+
}
|
|
15345
15390
|
/**
|
|
15346
15391
|
* @param processor - worker function
|
|
15347
15392
|
* @param maxConcurrency - max count of workers
|
|
15348
15393
|
*/
|
|
15349
15394
|
constructor(props) {
|
|
15350
|
-
this.name = "unnamed";
|
|
15351
|
-
this.maxConcurrency = 1;
|
|
15352
|
-
this.maxMobileConcurrency = 1;
|
|
15353
|
-
this.onDebug = () => {
|
|
15354
|
-
};
|
|
15355
|
-
this.reuseWorkers = true;
|
|
15356
|
-
this.props = {};
|
|
15357
|
-
this.jobQueue = [];
|
|
15358
|
-
this.idleQueue = [];
|
|
15359
|
-
this.count = 0;
|
|
15360
|
-
this.isDestroyed = false;
|
|
15361
15395
|
this.source = props.source;
|
|
15362
15396
|
this.url = props.url;
|
|
15363
15397
|
this.setProps(props);
|
|
15364
15398
|
}
|
|
15365
|
-
/** Checks if workers are supported on this platform */
|
|
15366
|
-
static isSupported() {
|
|
15367
|
-
return WorkerThread.isSupported();
|
|
15368
|
-
}
|
|
15369
15399
|
/**
|
|
15370
15400
|
* Terminates all workers in the pool
|
|
15371
15401
|
* @note Can free up significant memory
|
|
@@ -15488,23 +15518,24 @@ return true;`);
|
|
|
15488
15518
|
onDebug: () => {
|
|
15489
15519
|
}
|
|
15490
15520
|
};
|
|
15491
|
-
var
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
this.workerPools = /* @__PURE__ */ new Map();
|
|
15495
|
-
this.props = { ...DEFAULT_PROPS };
|
|
15496
|
-
this.setProps(props);
|
|
15497
|
-
this.workerPools = /* @__PURE__ */ new Map();
|
|
15498
|
-
}
|
|
15521
|
+
var _WorkerFarm = class {
|
|
15522
|
+
props;
|
|
15523
|
+
workerPools = /* @__PURE__ */ new Map();
|
|
15499
15524
|
/** Checks if workers are supported on this platform */
|
|
15500
15525
|
static isSupported() {
|
|
15501
15526
|
return WorkerThread.isSupported();
|
|
15502
15527
|
}
|
|
15503
15528
|
/** Get the singleton instance of the global worker farm */
|
|
15504
15529
|
static getWorkerFarm(props = {}) {
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
return
|
|
15530
|
+
_WorkerFarm._workerFarm = _WorkerFarm._workerFarm || new _WorkerFarm({});
|
|
15531
|
+
_WorkerFarm._workerFarm.setProps(props);
|
|
15532
|
+
return _WorkerFarm._workerFarm;
|
|
15533
|
+
}
|
|
15534
|
+
/** get global instance with WorkerFarm.getWorkerFarm() */
|
|
15535
|
+
constructor(props) {
|
|
15536
|
+
this.props = { ...DEFAULT_PROPS };
|
|
15537
|
+
this.setProps(props);
|
|
15538
|
+
this.workerPools = /* @__PURE__ */ new Map();
|
|
15508
15539
|
}
|
|
15509
15540
|
/**
|
|
15510
15541
|
* Terminate all workers in the farm
|
|
@@ -15558,6 +15589,9 @@ return true;`);
|
|
|
15558
15589
|
};
|
|
15559
15590
|
}
|
|
15560
15591
|
};
|
|
15592
|
+
var WorkerFarm = _WorkerFarm;
|
|
15593
|
+
// singleton
|
|
15594
|
+
__publicField(WorkerFarm, "_workerFarm");
|
|
15561
15595
|
|
|
15562
15596
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
15563
15597
|
function getWorkerName(worker) {
|