@loaders.gl/arrow 4.0.2 → 4.0.4
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 +6 -3
- package/dist/arrow-loader.d.ts.map +1 -1
- package/dist/arrow-loader.js +9 -1
- package/dist/arrow-loader.js.map +1 -1
- package/dist/arrow-worker.js +37 -537
- package/dist/arrow-writer.d.ts +2 -2
- package/dist/arrow-writer.d.ts.map +1 -1
- package/dist/arrow-writer.js.map +1 -1
- package/dist/dist.dev.js +1615 -246
- package/dist/geoarrow/convert-geoarrow-to-binary-geometry.d.ts +31 -1
- package/dist/geoarrow/convert-geoarrow-to-binary-geometry.d.ts.map +1 -1
- package/dist/geoarrow/convert-geoarrow-to-binary-geometry.js +133 -23
- package/dist/geoarrow/convert-geoarrow-to-binary-geometry.js.map +1 -1
- package/dist/geoarrow/convert-geoarrow-to-geojson.d.ts +2 -1
- package/dist/geoarrow/convert-geoarrow-to-geojson.d.ts.map +1 -1
- package/dist/geoarrow/convert-geoarrow-to-geojson.js +4 -0
- package/dist/geoarrow/convert-geoarrow-to-geojson.js.map +1 -1
- package/dist/geoarrow-loader.d.ts +19 -0
- package/dist/geoarrow-loader.d.ts.map +1 -0
- package/dist/geoarrow-loader.js +24 -0
- package/dist/geoarrow-loader.js.map +1 -0
- package/dist/geoarrow-writer.d.ts +9 -0
- package/dist/geoarrow-writer.d.ts.map +1 -0
- package/dist/geoarrow-writer.js +19 -0
- package/dist/geoarrow-writer.js.map +1 -0
- package/dist/index.cjs +508 -284
- package/dist/index.d.ts +9 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -13
- package/dist/index.js.map +1 -1
- package/dist/lib/arrow-table-batch.d.ts.map +1 -1
- package/dist/lib/arrow-table-batch.js.map +1 -1
- package/dist/lib/encode-arrow.d.ts.map +1 -1
- package/dist/lib/encode-arrow.js.map +1 -1
- package/dist/lib/encode-geoarrow.d.ts +15 -0
- package/dist/lib/encode-geoarrow.d.ts.map +1 -0
- package/dist/lib/encode-geoarrow.js +22 -0
- package/dist/lib/encode-geoarrow.js.map +1 -0
- package/dist/{lib → parsers}/parse-arrow-in-batches.d.ts +1 -1
- package/dist/parsers/parse-arrow-in-batches.d.ts.map +1 -0
- package/dist/parsers/parse-arrow-in-batches.js.map +1 -0
- package/dist/parsers/parse-arrow-sync.d.ts +6 -0
- package/dist/parsers/parse-arrow-sync.d.ts.map +1 -0
- package/dist/parsers/parse-arrow-sync.js +26 -0
- package/dist/parsers/parse-arrow-sync.js.map +1 -0
- package/dist/parsers/parse-geoarrow-in-batches.d.ts +6 -0
- package/dist/parsers/parse-geoarrow-in-batches.d.ts.map +1 -0
- package/dist/parsers/parse-geoarrow-in-batches.js +5 -0
- package/dist/parsers/parse-geoarrow-in-batches.js.map +1 -0
- package/dist/parsers/parse-geoarrow-sync.d.ts +6 -0
- package/dist/parsers/parse-geoarrow-sync.d.ts.map +1 -0
- package/dist/parsers/parse-geoarrow-sync.js +14 -0
- package/dist/parsers/parse-geoarrow-sync.js.map +1 -0
- package/dist/schema/convert-arrow-schema.d.ts.map +1 -1
- package/dist/schema/convert-arrow-schema.js +32 -5
- package/dist/schema/convert-arrow-schema.js.map +1 -1
- package/dist/tables/convert-arrow-to-columnar-table.d.ts +8 -0
- package/dist/tables/convert-arrow-to-columnar-table.d.ts.map +1 -0
- package/dist/tables/convert-arrow-to-columnar-table.js +14 -0
- package/dist/tables/convert-arrow-to-columnar-table.js.map +1 -0
- package/dist/tables/convert-arrow-to-geojson-table.d.ts +16 -0
- package/dist/tables/convert-arrow-to-geojson-table.d.ts.map +1 -0
- package/dist/tables/convert-arrow-to-geojson-table.js +33 -0
- package/dist/tables/convert-arrow-to-geojson-table.js.map +1 -0
- package/dist/tables/convert-columnar-to-row-table.d.ts +7 -0
- package/dist/tables/convert-columnar-to-row-table.d.ts.map +1 -0
- package/dist/tables/convert-columnar-to-row-table.js +18 -0
- package/dist/tables/convert-columnar-to-row-table.js.map +1 -0
- package/dist/triangulate-on-worker.d.ts +36 -0
- package/dist/triangulate-on-worker.d.ts.map +1 -0
- package/dist/triangulate-on-worker.js +14 -0
- package/dist/triangulate-on-worker.js.map +1 -0
- package/dist/triangulation-worker.js +880 -0
- package/dist/workers/arrow-worker.js +1 -1
- package/dist/workers/arrow-worker.js.map +1 -1
- package/dist/workers/triangulation-worker-node.d.ts +2 -0
- package/dist/workers/triangulation-worker-node.d.ts.map +1 -0
- package/dist/workers/triangulation-worker-node.js +2 -0
- package/dist/workers/triangulation-worker-node.js.map +1 -0
- package/dist/workers/triangulation-worker.d.ts +2 -0
- package/dist/workers/triangulation-worker.d.ts.map +1 -0
- package/dist/workers/triangulation-worker.js +24 -0
- package/dist/workers/triangulation-worker.js.map +1 -0
- package/package.json +9 -7
- package/src/arrow-loader.ts +25 -3
- package/src/arrow-writer.ts +2 -2
- package/src/geoarrow/convert-geoarrow-to-binary-geometry.ts +221 -30
- package/src/geoarrow/convert-geoarrow-to-geojson.ts +6 -2
- package/src/geoarrow-loader.ts +55 -0
- package/src/geoarrow-writer.ts +41 -0
- package/src/index.ts +30 -36
- package/src/lib/arrow-table-batch.ts +3 -0
- package/src/lib/encode-arrow.ts +3 -0
- package/src/lib/encode-geoarrow.ts +45 -0
- package/src/{lib → parsers}/parse-arrow-in-batches.ts +4 -2
- package/src/parsers/parse-arrow-sync.ts +38 -0
- package/src/parsers/parse-geoarrow-in-batches.ts +15 -0
- package/src/parsers/parse-geoarrow-sync.ts +22 -0
- package/src/schema/convert-arrow-schema.ts +32 -7
- package/src/tables/convert-arrow-to-columnar-table.ts +29 -0
- package/src/tables/convert-arrow-to-geojson-table.ts +54 -0
- package/src/tables/convert-columnar-to-row-table.ts +29 -0
- package/src/triangulate-on-worker.ts +47 -0
- package/src/workers/arrow-worker.ts +1 -1
- package/src/workers/triangulation-worker-node.ts +4 -0
- package/src/workers/triangulation-worker.ts +39 -0
- package/dist/lib/parse-arrow-in-batches.d.ts.map +0 -1
- package/dist/lib/parse-arrow-in-batches.js.map +0 -1
- package/dist/lib/parse-arrow-sync.d.ts +0 -5
- package/dist/lib/parse-arrow-sync.d.ts.map +0 -1
- package/dist/lib/parse-arrow-sync.js +0 -21
- package/dist/lib/parse-arrow-sync.js.map +0 -1
- package/dist/tables/convert-arrow-to-table.d.ts +0 -21
- package/dist/tables/convert-arrow-to-table.d.ts.map +0 -1
- package/dist/tables/convert-arrow-to-table.js +0 -37
- package/dist/tables/convert-arrow-to-table.js.map +0 -1
- package/src/lib/parse-arrow-sync.ts +0 -35
- package/src/tables/convert-arrow-to-table.ts +0 -68
- /package/dist/{lib → parsers}/parse-arrow-in-batches.js +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { serializeArrowSchema, parseGeometryFromArrow } from '@loaders.gl/arrow';
|
|
2
|
+
import { getGeometryColumnsFromSchema } from '@loaders.gl/gis';
|
|
3
|
+
export function convertApacheArrowToArrowTable(arrowTable) {
|
|
4
|
+
return {
|
|
5
|
+
shape: 'arrow-table',
|
|
6
|
+
data: arrowTable
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function convertArrowToGeoJSONTable(table) {
|
|
10
|
+
const arrowTable = table.data;
|
|
11
|
+
const schema = serializeArrowSchema(arrowTable.schema);
|
|
12
|
+
const geometryColumns = getGeometryColumnsFromSchema(schema);
|
|
13
|
+
const encoding = geometryColumns.geometry.encoding;
|
|
14
|
+
const features = [];
|
|
15
|
+
for (let row = 0; row < arrowTable.numRows; row++) {
|
|
16
|
+
var _arrowTable$getChild;
|
|
17
|
+
const arrowGeometry = (_arrowTable$getChild = arrowTable.getChild('geometry')) === null || _arrowTable$getChild === void 0 ? void 0 : _arrowTable$getChild.get(row);
|
|
18
|
+
const arrowGeometryObject = {
|
|
19
|
+
encoding,
|
|
20
|
+
data: arrowGeometry
|
|
21
|
+
};
|
|
22
|
+
const feature = parseGeometryFromArrow(arrowGeometryObject);
|
|
23
|
+
if (feature) {
|
|
24
|
+
features.push(feature);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
shape: 'geojson-table',
|
|
29
|
+
type: 'FeatureCollection',
|
|
30
|
+
features
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=convert-arrow-to-geojson-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-arrow-to-geojson-table.js","names":["serializeArrowSchema","parseGeometryFromArrow","getGeometryColumnsFromSchema","convertApacheArrowToArrowTable","arrowTable","shape","data","convertArrowToGeoJSONTable","table","schema","geometryColumns","encoding","geometry","features","row","numRows","_arrowTable$getChild","arrowGeometry","getChild","get","arrowGeometryObject","feature","push","type"],"sources":["../../src/tables/convert-arrow-to-geojson-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Feature, GeoJSONTable} from '@loaders.gl/schema';\nimport type * as arrow from 'apache-arrow';\nimport type {ArrowTable} from '../lib/arrow-table';\nimport {serializeArrowSchema, parseGeometryFromArrow} from '@loaders.gl/arrow';\nimport {getGeometryColumnsFromSchema} from '@loaders.gl/gis';\n\n/**\n * Wrap an apache arrow table in a loaders.gl table wrapper.\n * From this additional conversions are available.\n * @param arrowTable\n * @returns\n */\nexport function convertApacheArrowToArrowTable(arrowTable: arrow.Table): ArrowTable {\n return {\n shape: 'arrow-table',\n data: arrowTable\n };\n}\n\n/**\n * Convert an Apache Arrow table to a GeoJSONTable\n * @note Currently does not convert schema\n */\nexport function convertArrowToGeoJSONTable(table: ArrowTable): GeoJSONTable {\n const arrowTable = table.data;\n const schema = serializeArrowSchema(arrowTable.schema);\n const geometryColumns = getGeometryColumnsFromSchema(schema);\n\n // get encoding from geometryColumns['geometry']\n const encoding = geometryColumns.geometry.encoding;\n\n const features: Feature[] = [];\n\n for (let row = 0; row < arrowTable.numRows; row++) {\n // get first geometry from arrow geometry column\n const arrowGeometry = arrowTable.getChild('geometry')?.get(row);\n const arrowGeometryObject = {encoding, data: arrowGeometry};\n\n // parse arrow geometry to geojson feature\n const feature = parseGeometryFromArrow(arrowGeometryObject);\n if (feature) {\n features.push(feature);\n }\n }\n\n return {\n shape: 'geojson-table',\n type: 'FeatureCollection',\n features\n };\n}\n"],"mappings":"AAMA,SAAQA,oBAAoB,EAAEC,sBAAsB,QAAO,mBAAmB;AAC9E,SAAQC,4BAA4B,QAAO,iBAAiB;AAQ5D,OAAO,SAASC,8BAA8BA,CAACC,UAAuB,EAAc;EAClF,OAAO;IACLC,KAAK,EAAE,aAAa;IACpBC,IAAI,EAAEF;EACR,CAAC;AACH;AAMA,OAAO,SAASG,0BAA0BA,CAACC,KAAiB,EAAgB;EAC1E,MAAMJ,UAAU,GAAGI,KAAK,CAACF,IAAI;EAC7B,MAAMG,MAAM,GAAGT,oBAAoB,CAACI,UAAU,CAACK,MAAM,CAAC;EACtD,MAAMC,eAAe,GAAGR,4BAA4B,CAACO,MAAM,CAAC;EAG5D,MAAME,QAAQ,GAAGD,eAAe,CAACE,QAAQ,CAACD,QAAQ;EAElD,MAAME,QAAmB,GAAG,EAAE;EAE9B,KAAK,IAAIC,GAAG,GAAG,CAAC,EAAEA,GAAG,GAAGV,UAAU,CAACW,OAAO,EAAED,GAAG,EAAE,EAAE;IAAA,IAAAE,oBAAA;IAEjD,MAAMC,aAAa,IAAAD,oBAAA,GAAGZ,UAAU,CAACc,QAAQ,CAAC,UAAU,CAAC,cAAAF,oBAAA,uBAA/BA,oBAAA,CAAiCG,GAAG,CAACL,GAAG,CAAC;IAC/D,MAAMM,mBAAmB,GAAG;MAACT,QAAQ;MAAEL,IAAI,EAAEW;IAAa,CAAC;IAG3D,MAAMI,OAAO,GAAGpB,sBAAsB,CAACmB,mBAAmB,CAAC;IAC3D,IAAIC,OAAO,EAAE;MACXR,QAAQ,CAACS,IAAI,CAACD,OAAO,CAAC;IACxB;EACF;EAEA,OAAO;IACLhB,KAAK,EAAE,eAAe;IACtBkB,IAAI,EAAE,mBAAmB;IACzBV;EACF,CAAC;AACH"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ColumnarTable, ObjectRowTable } from '@loaders.gl/schema';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @note - should be part of schema module
|
|
5
|
+
*/
|
|
6
|
+
export declare function convertColumnarToRowFormatTable(columnarTable: ColumnarTable): ObjectRowTable;
|
|
7
|
+
//# sourceMappingURL=convert-columnar-to-row-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-columnar-to-row-table.d.ts","sourceRoot":"","sources":["../../src/tables/convert-columnar-to-row-table.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEtE;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,aAAa,GAAG,cAAc,CAmB5F"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function convertColumnarToRowFormatTable(columnarTable) {
|
|
2
|
+
const tableKeys = Object.keys(columnarTable);
|
|
3
|
+
const tableRowsCount = columnarTable[tableKeys[0]].length;
|
|
4
|
+
const rowFormatTable = [];
|
|
5
|
+
for (let index = 0; index < tableRowsCount; index++) {
|
|
6
|
+
const tableItem = {};
|
|
7
|
+
for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) {
|
|
8
|
+
const fieldName = tableKeys[keyIndex];
|
|
9
|
+
tableItem[fieldName] = columnarTable[fieldName][index];
|
|
10
|
+
}
|
|
11
|
+
rowFormatTable.push(tableItem);
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
shape: 'object-row-table',
|
|
15
|
+
data: rowFormatTable
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=convert-columnar-to-row-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-columnar-to-row-table.js","names":["convertColumnarToRowFormatTable","columnarTable","tableKeys","Object","keys","tableRowsCount","length","rowFormatTable","index","tableItem","keyIndex","fieldName","push","shape","data"],"sources":["../../src/tables/convert-columnar-to-row-table.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {ColumnarTable, ObjectRowTable} from '@loaders.gl/schema';\n\n/**\n *\n * @note - should be part of schema module\n */\nexport function convertColumnarToRowFormatTable(columnarTable: ColumnarTable): ObjectRowTable {\n const tableKeys = Object.keys(columnarTable);\n const tableRowsCount = columnarTable[tableKeys[0]].length;\n\n const rowFormatTable: {}[] = [];\n\n for (let index = 0; index < tableRowsCount; index++) {\n const tableItem = {};\n for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) {\n const fieldName = tableKeys[keyIndex];\n tableItem[fieldName] = columnarTable[fieldName][index];\n }\n rowFormatTable.push(tableItem);\n }\n\n return {\n shape: 'object-row-table',\n data: rowFormatTable\n };\n}\n"],"mappings":"AASA,OAAO,SAASA,+BAA+BA,CAACC,aAA4B,EAAkB;EAC5F,MAAMC,SAAS,GAAGC,MAAM,CAACC,IAAI,CAACH,aAAa,CAAC;EAC5C,MAAMI,cAAc,GAAGJ,aAAa,CAACC,SAAS,CAAC,CAAC,CAAC,CAAC,CAACI,MAAM;EAEzD,MAAMC,cAAoB,GAAG,EAAE;EAE/B,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGH,cAAc,EAAEG,KAAK,EAAE,EAAE;IACnD,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,KAAK,IAAIC,QAAQ,GAAG,CAAC,EAAEA,QAAQ,GAAGR,SAAS,CAACI,MAAM,EAAEI,QAAQ,EAAE,EAAE;MAC9D,MAAMC,SAAS,GAAGT,SAAS,CAACQ,QAAQ,CAAC;MACrCD,SAAS,CAACE,SAAS,CAAC,GAAGV,aAAa,CAACU,SAAS,CAAC,CAACH,KAAK,CAAC;IACxD;IACAD,cAAc,CAACK,IAAI,CAACH,SAAS,CAAC;EAChC;EAEA,OAAO;IACLI,KAAK,EAAE,kBAAkB;IACzBC,IAAI,EAAEP;EACR,CAAC;AACH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { WorkerOptions } from '@loaders.gl/worker-utils';
|
|
2
|
+
export type TriangulationWorkerInput = TriangulateInput | {
|
|
3
|
+
operation: 'test';
|
|
4
|
+
data: any;
|
|
5
|
+
};
|
|
6
|
+
export type TriangulationWorkerOutput = TriangulateResult | {
|
|
7
|
+
operation: 'test';
|
|
8
|
+
data: any;
|
|
9
|
+
};
|
|
10
|
+
/** Input data for operation: 'triangulate' */
|
|
11
|
+
export type TriangulateInput = {
|
|
12
|
+
operation: 'triangulate';
|
|
13
|
+
polygonIndices: Uint16Array;
|
|
14
|
+
primitivePolygonIndices: Int32Array;
|
|
15
|
+
flatCoordinateArray: Float64Array;
|
|
16
|
+
nDim: number;
|
|
17
|
+
};
|
|
18
|
+
/** Result type for operation: 'triangulate' */
|
|
19
|
+
export type TriangulateResult = TriangulateInput & {
|
|
20
|
+
triangleIndices: Uint32Array;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Worker for tessellating geometries. Normally called through triangulateOnWorker
|
|
24
|
+
*/
|
|
25
|
+
export declare const TriangulationWorker: {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
module: string;
|
|
29
|
+
version: any;
|
|
30
|
+
options: {};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Provide type safety
|
|
34
|
+
*/
|
|
35
|
+
export declare function triangulateOnWorker(data: TriangulationWorkerInput, options?: WorkerOptions): Promise<TriangulationWorkerOutput>;
|
|
36
|
+
//# sourceMappingURL=triangulate-on-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangulate-on-worker.d.ts","sourceRoot":"","sources":["../src/triangulate-on-worker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAO5D,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAC,CAAC;AACzF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,GAAG;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAC,CAAC;AAE3F,8CAA8C;AAC9C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,aAAa,CAAC;IACzB,cAAc,EAAE,WAAW,CAAC;IAC5B,uBAAuB,EAAE,UAAU,CAAC;IACpC,mBAAmB,EAAE,YAAY,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD,eAAe,EAAE,WAAW,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;CAM/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,wBAAwB,EAC9B,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAEpC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { processOnWorker } from '@loaders.gl/worker-utils';
|
|
2
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
3
|
+
export const TriangulationWorker = {
|
|
4
|
+
id: 'triangulation',
|
|
5
|
+
name: 'Triangulate',
|
|
6
|
+
module: 'arrow',
|
|
7
|
+
version: VERSION,
|
|
8
|
+
options: {}
|
|
9
|
+
};
|
|
10
|
+
export function triangulateOnWorker(data) {
|
|
11
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12
|
+
return processOnWorker(TriangulationWorker, data, options);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=triangulate-on-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangulate-on-worker.js","names":["processOnWorker","VERSION","__VERSION__","TriangulationWorker","id","name","module","version","options","triangulateOnWorker","data","arguments","length","undefined"],"sources":["../src/triangulate-on-worker.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {WorkerOptions} from '@loaders.gl/worker-utils';\nimport {processOnWorker} from '@loaders.gl/worker-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type TriangulationWorkerInput = TriangulateInput | {operation: 'test'; data: any};\nexport type TriangulationWorkerOutput = TriangulateResult | {operation: 'test'; data: any};\n\n/** Input data for operation: 'triangulate' */\nexport type TriangulateInput = {\n operation: 'triangulate';\n polygonIndices: Uint16Array;\n primitivePolygonIndices: Int32Array;\n flatCoordinateArray: Float64Array;\n nDim: number;\n};\n\n/** Result type for operation: 'triangulate' */\nexport type TriangulateResult = TriangulateInput & {\n triangleIndices: Uint32Array;\n};\n\n/**\n * Worker for tessellating geometries. Normally called through triangulateOnWorker\n */\nexport const TriangulationWorker = {\n id: 'triangulation',\n name: 'Triangulate',\n module: 'arrow',\n version: VERSION,\n options: {}\n};\n\n/**\n * Provide type safety\n */\nexport function triangulateOnWorker(\n data: TriangulationWorkerInput,\n options: WorkerOptions = {}\n): Promise<TriangulationWorkerOutput> {\n return processOnWorker(TriangulationWorker, data, options);\n}\n"],"mappings":"AAIA,SAAQA,eAAe,QAAO,0BAA0B;AAIxD,MAAMC,OAAO,GAAG,OAAOC,WAAW,KAAK,WAAW,GAAGA,WAAW,GAAG,QAAQ;AAsB3E,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,EAAE,EAAE,eAAe;EACnBC,IAAI,EAAE,aAAa;EACnBC,MAAM,EAAE,OAAO;EACfC,OAAO,EAAEN,OAAO;EAChBO,OAAO,EAAE,CAAC;AACZ,CAAC;AAKD,OAAO,SAASC,mBAAmBA,CACjCC,IAA8B,EAEM;EAAA,IADpCF,OAAsB,GAAAG,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE3B,OAAOX,eAAe,CAACG,mBAAmB,EAAEO,IAAI,EAAEF,OAAO,CAAC;AAC5D"}
|