@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,41 @@
|
|
|
1
|
+
// import type {} from '@loaders.gl/loader-utils';
|
|
2
|
+
|
|
3
|
+
import type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';
|
|
4
|
+
import {GeoJSONTable, BinaryGeometry} from '@loaders.gl/schema';
|
|
5
|
+
import {encodeGeoArrowSync} from './lib/encode-geoarrow';
|
|
6
|
+
|
|
7
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
8
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
9
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
10
|
+
|
|
11
|
+
type ArrowWriterOptions = WriterOptions & {
|
|
12
|
+
arrow?: {};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Apache Arrow writer */
|
|
16
|
+
export const GeoArrowWriter: WriterWithEncoder<
|
|
17
|
+
GeoJSONTable | BinaryGeometry,
|
|
18
|
+
never,
|
|
19
|
+
ArrowWriterOptions
|
|
20
|
+
> = {
|
|
21
|
+
name: 'Apache Arrow',
|
|
22
|
+
id: 'arrow',
|
|
23
|
+
module: 'arrow',
|
|
24
|
+
version: VERSION,
|
|
25
|
+
extensions: ['arrow', 'feather'],
|
|
26
|
+
mimeTypes: [
|
|
27
|
+
'application/vnd.apache.arrow.file',
|
|
28
|
+
'application/vnd.apache.arrow.stream',
|
|
29
|
+
'application/octet-stream'
|
|
30
|
+
],
|
|
31
|
+
binary: true,
|
|
32
|
+
options: {},
|
|
33
|
+
encode: async function encodeArrow(data, options?): Promise<ArrayBuffer> {
|
|
34
|
+
// @ts-expect-error
|
|
35
|
+
return encodeGeoArrowSync(data);
|
|
36
|
+
},
|
|
37
|
+
encodeSync(data, options?) {
|
|
38
|
+
// @ts-expect-error
|
|
39
|
+
return encodeGeoArrowSync(data);
|
|
40
|
+
}
|
|
41
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
// loaders.gl, MIT license
|
|
2
2
|
// Copyright (c) vis.gl contributors
|
|
3
3
|
|
|
4
|
-
import type {LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
5
4
|
import type {ArrowLoaderOptions} from './arrow-loader';
|
|
6
|
-
import type {ArrowTableBatch, ColumnarTable, ObjectRowTable} from '@loaders.gl/schema';
|
|
7
|
-
import type {ArrowTable} from './lib/arrow-table';
|
|
8
|
-
|
|
9
5
|
import {TableBatchBuilder} from '@loaders.gl/schema';
|
|
10
|
-
import {ArrowLoader as ArrowWorkerLoader} from './arrow-loader';
|
|
11
|
-
import parseSync from './lib/parse-arrow-sync';
|
|
12
|
-
import {parseArrowInBatches} from './lib/parse-arrow-in-batches';
|
|
13
|
-
|
|
14
6
|
import {ArrowTableBatchAggregator} from './lib/arrow-table-batch';
|
|
15
7
|
|
|
16
8
|
// Make the ArrowBatch type available
|
|
@@ -22,6 +14,21 @@ export {getArrowType} from './schema/arrow-type-utils';
|
|
|
22
14
|
|
|
23
15
|
// SCHEMA
|
|
24
16
|
|
|
17
|
+
// Types
|
|
18
|
+
export type {ArrowTable, ArrowTableBatch} from './lib/arrow-table';
|
|
19
|
+
export {VECTOR_TYPES} from './types';
|
|
20
|
+
|
|
21
|
+
// Arrow loader / Writer
|
|
22
|
+
|
|
23
|
+
export type {ArrowLoaderOptions};
|
|
24
|
+
export {ArrowLoader, ArrowWorkerLoader} from './arrow-loader';
|
|
25
|
+
|
|
26
|
+
export {ArrowWriter} from './arrow-writer';
|
|
27
|
+
|
|
28
|
+
// Geoarrow loader
|
|
29
|
+
export {GeoArrowLoader, GeoArrowWorkerLoader} from './geoarrow-loader';
|
|
30
|
+
|
|
31
|
+
// Schema utils
|
|
25
32
|
export {
|
|
26
33
|
serializeArrowSchema,
|
|
27
34
|
deserializeArrowSchema,
|
|
@@ -33,43 +40,30 @@ export {
|
|
|
33
40
|
deserializeArrowType
|
|
34
41
|
} from './schema/convert-arrow-schema';
|
|
35
42
|
|
|
36
|
-
//
|
|
37
|
-
export type {ArrowTable, ArrowTableBatch} from './lib/arrow-table';
|
|
38
|
-
export {VECTOR_TYPES} from './types';
|
|
39
|
-
|
|
40
|
-
// Arrow writer
|
|
41
|
-
|
|
42
|
-
export {ArrowWriter} from './arrow-writer';
|
|
43
|
-
|
|
44
|
-
// Arrow loader
|
|
45
|
-
|
|
46
|
-
export type {ArrowLoaderOptions};
|
|
47
|
-
export {ArrowWorkerLoader};
|
|
48
|
-
|
|
49
|
-
/** ArrowJS table loader */
|
|
50
|
-
export const ArrowLoader: LoaderWithParser<
|
|
51
|
-
ArrowTable | ColumnarTable | ObjectRowTable,
|
|
52
|
-
ArrowTableBatch,
|
|
53
|
-
ArrowLoaderOptions
|
|
54
|
-
> = {
|
|
55
|
-
...ArrowWorkerLoader,
|
|
56
|
-
parse: async (arraybuffer: ArrayBuffer, options?: ArrowLoaderOptions) =>
|
|
57
|
-
parseSync(arraybuffer, options),
|
|
58
|
-
parseSync,
|
|
59
|
-
parseInBatches: parseArrowInBatches
|
|
60
|
-
};
|
|
43
|
+
// EXPERIMENTAL
|
|
61
44
|
|
|
62
45
|
// Arrow Utils
|
|
63
46
|
export type {GeoArrowEncoding} from '@loaders.gl/gis';
|
|
64
47
|
// getGeometryColumnsFromArrowTable,
|
|
65
48
|
// getGeoArrowEncoding
|
|
66
49
|
|
|
67
|
-
export type {
|
|
50
|
+
export type {
|
|
51
|
+
BinaryDataFromGeoArrow,
|
|
52
|
+
BinaryGeometriesFromArrowOptions
|
|
53
|
+
} from './geoarrow/convert-geoarrow-to-binary-geometry';
|
|
68
54
|
export {
|
|
69
55
|
BINARY_GEOMETRY_TEMPLATE,
|
|
70
|
-
getBinaryGeometriesFromArrow
|
|
56
|
+
getBinaryGeometriesFromArrow,
|
|
57
|
+
getTriangleIndices,
|
|
58
|
+
getMeanCentersFromBinaryGeometries
|
|
71
59
|
} from './geoarrow/convert-geoarrow-to-binary-geometry';
|
|
72
60
|
|
|
61
|
+
export {updateBoundsFromGeoArrowSamples} from './geoarrow/get-arrow-bounds';
|
|
62
|
+
|
|
73
63
|
export {parseGeometryFromArrow} from './geoarrow/convert-geoarrow-to-geojson';
|
|
74
64
|
|
|
75
|
-
export {
|
|
65
|
+
export {convertArrowToGeoJSONTable} from './tables/convert-arrow-to-geojson-table';
|
|
66
|
+
|
|
67
|
+
// EXPERIMENTAL WORKER
|
|
68
|
+
|
|
69
|
+
export {TriangulationWorker, triangulateOnWorker} from './triangulate-on-worker';
|
package/src/lib/encode-arrow.ts
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import * as arrow from 'apache-arrow';
|
|
5
|
+
import {AnyArrayType, VECTOR_TYPES} from '../types';
|
|
6
|
+
|
|
7
|
+
export type ColumnarTable = {
|
|
8
|
+
name: string;
|
|
9
|
+
array: AnyArrayType;
|
|
10
|
+
type: number;
|
|
11
|
+
}[];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Encodes set of arrays into the Apache Arrow columnar format
|
|
15
|
+
* https://arrow.apache.org/docs/format/Columnar.html#ipc-file-format
|
|
16
|
+
* @param data - columns data
|
|
17
|
+
* @param options - the writer options
|
|
18
|
+
* @returns - encoded ArrayBuffer
|
|
19
|
+
*/
|
|
20
|
+
export function encodeGeoArrowSync(data: ColumnarTable): ArrayBuffer {
|
|
21
|
+
const vectors: Record<string, arrow.Vector> = {};
|
|
22
|
+
for (const arrayData of data) {
|
|
23
|
+
const arrayVector = createVector(arrayData.array, arrayData.type);
|
|
24
|
+
vectors[arrayData.name] = arrayVector;
|
|
25
|
+
}
|
|
26
|
+
const table = new arrow.Table(vectors);
|
|
27
|
+
const arrowBuffer = arrow.tableToIPC(table);
|
|
28
|
+
return arrowBuffer;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Create Arrow arrow.Vector from given data and vector type
|
|
33
|
+
* @param array {import('../types').AnyArrayType} - columns data
|
|
34
|
+
* @param type {number} - the writer options
|
|
35
|
+
* @return a vector of one of vector's types defined in the Apache Arrow library
|
|
36
|
+
*/
|
|
37
|
+
function createVector(array, type): arrow.Vector {
|
|
38
|
+
switch (type) {
|
|
39
|
+
case VECTOR_TYPES.DATE:
|
|
40
|
+
return arrow.vectorFromArray(array);
|
|
41
|
+
case VECTOR_TYPES.FLOAT:
|
|
42
|
+
default:
|
|
43
|
+
return arrow.vectorFromArray(array);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {ArrowTableBatch} from '../lib/arrow-table';
|
|
3
5
|
import * as arrow from 'apache-arrow';
|
|
4
6
|
// import {isIterable} from '@loaders.gl/core';
|
|
5
7
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {ArrayRowTable, ColumnarTable, ObjectRowTable} from '@loaders.gl/schema';
|
|
5
|
+
import type {ArrowTable} from '../lib/arrow-table';
|
|
6
|
+
import {convertTable} from '@loaders.gl/schema';
|
|
7
|
+
import * as arrow from 'apache-arrow';
|
|
8
|
+
import {convertArrowToColumnarTable} from '../tables/convert-arrow-to-columnar-table';
|
|
9
|
+
|
|
10
|
+
// Parses arrow to a columnar table
|
|
11
|
+
export function parseArrowSync(
|
|
12
|
+
arrayBuffer,
|
|
13
|
+
options?: {shape?: 'arrow-table' | 'columnar-table' | 'object-row-table' | 'array-row-table'}
|
|
14
|
+
): ArrowTable | ColumnarTable | ObjectRowTable | ArrayRowTable {
|
|
15
|
+
const apacheArrowTable = arrow.tableFromIPC([new Uint8Array(arrayBuffer)]);
|
|
16
|
+
const arrowTable: ArrowTable = {shape: 'arrow-table', data: apacheArrowTable};
|
|
17
|
+
|
|
18
|
+
const shape = options?.shape || 'arrow-table';
|
|
19
|
+
switch (shape) {
|
|
20
|
+
case 'arrow-table':
|
|
21
|
+
return arrowTable;
|
|
22
|
+
|
|
23
|
+
case 'columnar-table':
|
|
24
|
+
return convertArrowToColumnarTable(arrowTable);
|
|
25
|
+
|
|
26
|
+
case 'object-row-table':
|
|
27
|
+
let columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
28
|
+
return convertTable(columnarTable, 'object-row-table');
|
|
29
|
+
|
|
30
|
+
case 'array-row-table':
|
|
31
|
+
columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
32
|
+
return convertTable(columnarTable, 'array-row-table');
|
|
33
|
+
|
|
34
|
+
default:
|
|
35
|
+
// TODO
|
|
36
|
+
throw new Error(shape);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {GeoJSONTableBatch} from '@loaders.gl/schema';
|
|
5
|
+
import type {ArrowTableBatch} from '../lib/arrow-table';
|
|
6
|
+
import {parseArrowInBatches} from './parse-arrow-in-batches';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*/
|
|
10
|
+
export function parseGeoArrowInBatches(
|
|
11
|
+
asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>
|
|
12
|
+
): AsyncIterable<ArrowTableBatch | GeoJSONTableBatch> {
|
|
13
|
+
// | BinaryGeometry
|
|
14
|
+
return parseArrowInBatches(asyncIterator);
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {GeoJSONTable} from '@loaders.gl/schema';
|
|
5
|
+
import type {ArrowTable} from '../lib/arrow-table';
|
|
6
|
+
import {parseArrowSync} from './parse-arrow-sync';
|
|
7
|
+
import {convertArrowToGeoJSONTable} from '../tables/convert-arrow-to-geojson-table';
|
|
8
|
+
|
|
9
|
+
// Parses arrow to a columnar table
|
|
10
|
+
export function parseGeoArrowSync(
|
|
11
|
+
arrayBuffer,
|
|
12
|
+
options?: {shape?: 'arrow-table' | 'geojson-table' | 'binary-geometry'}
|
|
13
|
+
): ArrowTable | GeoJSONTable {
|
|
14
|
+
// | BinaryGeometry
|
|
15
|
+
const table = parseArrowSync(arrayBuffer, {shape: 'arrow-table'}) as ArrowTable;
|
|
16
|
+
switch (options?.shape) {
|
|
17
|
+
case 'geojson-table':
|
|
18
|
+
return convertArrowToGeoJSONTable(table);
|
|
19
|
+
default:
|
|
20
|
+
return table;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -100,7 +100,15 @@ export function serializeArrowType(arrowType: arrow.DataType): DataType {
|
|
|
100
100
|
return 'float64';
|
|
101
101
|
case arrow.Utf8:
|
|
102
102
|
return 'utf8';
|
|
103
|
-
case
|
|
103
|
+
case arrow.Decimal:
|
|
104
|
+
const decimal = arrowType as arrow.Decimal;
|
|
105
|
+
return {
|
|
106
|
+
type: 'decimal',
|
|
107
|
+
bitWidth: decimal.bitWidth,
|
|
108
|
+
precision: decimal.precision,
|
|
109
|
+
scale: decimal.scale
|
|
110
|
+
};
|
|
111
|
+
case arrow.Date_:
|
|
104
112
|
const dateUnit = (arrowType as arrow.Date_).unit;
|
|
105
113
|
return dateUnit === arrow.DateUnit.DAY ? 'date-day' : 'date-millisecond';
|
|
106
114
|
case arrow.DateDay:
|
|
@@ -165,6 +173,13 @@ export function serializeArrowType(arrowType: arrow.DataType): DataType {
|
|
|
165
173
|
return 'interval-daytime';
|
|
166
174
|
case arrow.IntervalYearMonth:
|
|
167
175
|
return 'interval-yearmonth';
|
|
176
|
+
case arrow.Map_:
|
|
177
|
+
const mapType = arrowType as arrow.Map_;
|
|
178
|
+
return {
|
|
179
|
+
type: 'map',
|
|
180
|
+
keysSorted: mapType.keysSorted,
|
|
181
|
+
children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
182
|
+
};
|
|
168
183
|
case arrow.List:
|
|
169
184
|
const listType = arrowType as arrow.List;
|
|
170
185
|
const listField = listType.valueField;
|
|
@@ -173,15 +188,20 @@ export function serializeArrowType(arrowType: arrow.DataType): DataType {
|
|
|
173
188
|
children: [serializeArrowField(listField)]
|
|
174
189
|
};
|
|
175
190
|
case arrow.FixedSizeList:
|
|
191
|
+
const fixedSizeList = arrowType as arrow.FixedSizeList;
|
|
176
192
|
return {
|
|
177
193
|
type: 'fixed-size-list',
|
|
178
|
-
listSize:
|
|
179
|
-
children: [serializeArrowField(
|
|
194
|
+
listSize: fixedSizeList.listSize,
|
|
195
|
+
children: [serializeArrowField(fixedSizeList.children[0])]
|
|
196
|
+
};
|
|
197
|
+
case arrow.Struct:
|
|
198
|
+
const structType = arrowType as arrow.Struct;
|
|
199
|
+
return {
|
|
200
|
+
type: 'struct',
|
|
201
|
+
children: structType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
180
202
|
};
|
|
181
|
-
// case arrow.Struct:
|
|
182
|
-
// return {type: 'struct', children: (arrowType as arrow.Struct).children};
|
|
183
203
|
default:
|
|
184
|
-
throw new Error(
|
|
204
|
+
throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
|
|
185
205
|
}
|
|
186
206
|
}
|
|
187
207
|
|
|
@@ -190,6 +210,11 @@ export function serializeArrowType(arrowType: arrow.DataType): DataType {
|
|
|
190
210
|
export function deserializeArrowType(dataType: DataType): arrow.DataType {
|
|
191
211
|
if (typeof dataType === 'object') {
|
|
192
212
|
switch (dataType.type) {
|
|
213
|
+
case 'decimal':
|
|
214
|
+
return new arrow.Decimal(dataType.precision, dataType.scale, dataType.bitWidth);
|
|
215
|
+
case 'map':
|
|
216
|
+
let children = dataType.children.map((arrowField) => deserializeArrowField(arrowField));
|
|
217
|
+
return new arrow.Map_(children as any, dataType.keysSorted);
|
|
193
218
|
case 'list':
|
|
194
219
|
const field = deserializeArrowField(dataType.children[0]);
|
|
195
220
|
return new arrow.List(field);
|
|
@@ -197,7 +222,7 @@ export function deserializeArrowType(dataType: DataType): arrow.DataType {
|
|
|
197
222
|
const child = deserializeArrowField(dataType.children[0]);
|
|
198
223
|
return new arrow.FixedSizeList(dataType.listSize, child);
|
|
199
224
|
case 'struct':
|
|
200
|
-
|
|
225
|
+
children = dataType.children.map((arrowField) => deserializeArrowField(arrowField));
|
|
201
226
|
return new arrow.Struct(children);
|
|
202
227
|
default:
|
|
203
228
|
throw new Error('array type not supported');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {ColumnarTable} from '@loaders.gl/schema';
|
|
5
|
+
import type {ArrowTable} from '../lib/arrow-table';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Convert an Apache Arrow table to a ColumnarTable
|
|
9
|
+
* @note Currently does not convert schema
|
|
10
|
+
*/
|
|
11
|
+
export function convertArrowToColumnarTable(table: ArrowTable): ColumnarTable {
|
|
12
|
+
// TODO - avoid calling `getColumn` on columns we are not interested in?
|
|
13
|
+
// Add options object?
|
|
14
|
+
|
|
15
|
+
const arrowTable = table.data;
|
|
16
|
+
const columnarTable = {};
|
|
17
|
+
|
|
18
|
+
for (const field of arrowTable.schema.fields) {
|
|
19
|
+
// This (is intended to) coalesce all record batches into a single typed array
|
|
20
|
+
const arrowColumn = arrowTable.getChild(field.name);
|
|
21
|
+
const values = arrowColumn?.toArray();
|
|
22
|
+
columnarTable[field.name] = values;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
shape: 'columnar-table',
|
|
27
|
+
data: columnarTable
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {Feature, GeoJSONTable} from '@loaders.gl/schema';
|
|
5
|
+
import type * as arrow from 'apache-arrow';
|
|
6
|
+
import type {ArrowTable} from '../lib/arrow-table';
|
|
7
|
+
import {serializeArrowSchema, parseGeometryFromArrow} from '@loaders.gl/arrow';
|
|
8
|
+
import {getGeometryColumnsFromSchema} from '@loaders.gl/gis';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wrap an apache arrow table in a loaders.gl table wrapper.
|
|
12
|
+
* From this additional conversions are available.
|
|
13
|
+
* @param arrowTable
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export function convertApacheArrowToArrowTable(arrowTable: arrow.Table): ArrowTable {
|
|
17
|
+
return {
|
|
18
|
+
shape: 'arrow-table',
|
|
19
|
+
data: arrowTable
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Convert an Apache Arrow table to a GeoJSONTable
|
|
25
|
+
* @note Currently does not convert schema
|
|
26
|
+
*/
|
|
27
|
+
export function convertArrowToGeoJSONTable(table: ArrowTable): GeoJSONTable {
|
|
28
|
+
const arrowTable = table.data;
|
|
29
|
+
const schema = serializeArrowSchema(arrowTable.schema);
|
|
30
|
+
const geometryColumns = getGeometryColumnsFromSchema(schema);
|
|
31
|
+
|
|
32
|
+
// get encoding from geometryColumns['geometry']
|
|
33
|
+
const encoding = geometryColumns.geometry.encoding;
|
|
34
|
+
|
|
35
|
+
const features: Feature[] = [];
|
|
36
|
+
|
|
37
|
+
for (let row = 0; row < arrowTable.numRows; row++) {
|
|
38
|
+
// get first geometry from arrow geometry column
|
|
39
|
+
const arrowGeometry = arrowTable.getChild('geometry')?.get(row);
|
|
40
|
+
const arrowGeometryObject = {encoding, data: arrowGeometry};
|
|
41
|
+
|
|
42
|
+
// parse arrow geometry to geojson feature
|
|
43
|
+
const feature = parseGeometryFromArrow(arrowGeometryObject);
|
|
44
|
+
if (feature) {
|
|
45
|
+
features.push(feature);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
shape: 'geojson-table',
|
|
51
|
+
type: 'FeatureCollection',
|
|
52
|
+
features
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {ColumnarTable, ObjectRowTable} from '@loaders.gl/schema';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @note - should be part of schema module
|
|
9
|
+
*/
|
|
10
|
+
export function convertColumnarToRowFormatTable(columnarTable: ColumnarTable): ObjectRowTable {
|
|
11
|
+
const tableKeys = Object.keys(columnarTable);
|
|
12
|
+
const tableRowsCount = columnarTable[tableKeys[0]].length;
|
|
13
|
+
|
|
14
|
+
const rowFormatTable: {}[] = [];
|
|
15
|
+
|
|
16
|
+
for (let index = 0; index < tableRowsCount; index++) {
|
|
17
|
+
const tableItem = {};
|
|
18
|
+
for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) {
|
|
19
|
+
const fieldName = tableKeys[keyIndex];
|
|
20
|
+
tableItem[fieldName] = columnarTable[fieldName][index];
|
|
21
|
+
}
|
|
22
|
+
rowFormatTable.push(tableItem);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
shape: 'object-row-table',
|
|
27
|
+
data: rowFormatTable
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import type {WorkerOptions} from '@loaders.gl/worker-utils';
|
|
5
|
+
import {processOnWorker} from '@loaders.gl/worker-utils';
|
|
6
|
+
|
|
7
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
8
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
9
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
10
|
+
|
|
11
|
+
export type TriangulationWorkerInput = TriangulateInput | {operation: 'test'; data: any};
|
|
12
|
+
export type TriangulationWorkerOutput = TriangulateResult | {operation: 'test'; data: any};
|
|
13
|
+
|
|
14
|
+
/** Input data for operation: 'triangulate' */
|
|
15
|
+
export type TriangulateInput = {
|
|
16
|
+
operation: 'triangulate';
|
|
17
|
+
polygonIndices: Uint16Array;
|
|
18
|
+
primitivePolygonIndices: Int32Array;
|
|
19
|
+
flatCoordinateArray: Float64Array;
|
|
20
|
+
nDim: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Result type for operation: 'triangulate' */
|
|
24
|
+
export type TriangulateResult = TriangulateInput & {
|
|
25
|
+
triangleIndices: Uint32Array;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Worker for tessellating geometries. Normally called through triangulateOnWorker
|
|
30
|
+
*/
|
|
31
|
+
export const TriangulationWorker = {
|
|
32
|
+
id: 'triangulation',
|
|
33
|
+
name: 'Triangulate',
|
|
34
|
+
module: 'arrow',
|
|
35
|
+
version: VERSION,
|
|
36
|
+
options: {}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Provide type safety
|
|
41
|
+
*/
|
|
42
|
+
export function triangulateOnWorker(
|
|
43
|
+
data: TriangulationWorkerInput,
|
|
44
|
+
options: WorkerOptions = {}
|
|
45
|
+
): Promise<TriangulationWorkerOutput> {
|
|
46
|
+
return processOnWorker(TriangulationWorker, data, options);
|
|
47
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// loaders.gl, MIT license
|
|
2
|
+
// Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import {createWorker} from '@loaders.gl/worker-utils';
|
|
5
|
+
import {getTriangleIndices} from '../geoarrow/convert-geoarrow-to-binary-geometry';
|
|
6
|
+
import type {
|
|
7
|
+
TriangulationWorkerInput,
|
|
8
|
+
TriangulateInput,
|
|
9
|
+
TriangulateResult
|
|
10
|
+
} from '../triangulate-on-worker';
|
|
11
|
+
|
|
12
|
+
createWorker(async (data, options = {}) => {
|
|
13
|
+
const input = data as TriangulationWorkerInput;
|
|
14
|
+
const operation = input?.operation;
|
|
15
|
+
switch (operation) {
|
|
16
|
+
case 'test':
|
|
17
|
+
return input;
|
|
18
|
+
case 'triangulate':
|
|
19
|
+
return triangulateBatch(data);
|
|
20
|
+
default:
|
|
21
|
+
throw new Error(
|
|
22
|
+
`TriangulationWorker: Unsupported operation ${operation}. Expected 'triangulate'`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
function triangulateBatch(data: TriangulateInput): TriangulateResult {
|
|
28
|
+
// Parse any WKT/WKB geometries
|
|
29
|
+
// Build binary geometries
|
|
30
|
+
// Call earcut and triangulate
|
|
31
|
+
console.error('TriangulationWorker: tessellating batch', data);
|
|
32
|
+
const triangleIndices = getTriangleIndices(
|
|
33
|
+
data.polygonIndices,
|
|
34
|
+
data.primitivePolygonIndices,
|
|
35
|
+
data.flatCoordinateArray,
|
|
36
|
+
data.nDim
|
|
37
|
+
);
|
|
38
|
+
return {...data, triangleIndices};
|
|
39
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-arrow-in-batches.d.ts","sourceRoot":"","sources":["../../src/lib/parse-arrow-in-batches.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAInD;GACG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,GAChE,aAAa,CAAC,eAAe,CAAC,CAsChC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-arrow-in-batches.js","names":["arrow","parseArrowInBatches","asyncIterator","makeArrowAsyncIterator","readers","RecordBatchReader","readAll","reader","recordBatch","arrowTabledBatch","shape","batchType","data","Table","length"],"sources":["../../src/lib/parse-arrow-in-batches.ts"],"sourcesContent":["// TODO - this import defeats the sophisticated typescript checking in ArrowJS\nimport type {ArrowTableBatch} from './arrow-table';\nimport * as arrow from 'apache-arrow';\n// import {isIterable} from '@loaders.gl/core';\n\n/**\n */\nexport function parseArrowInBatches(\n asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>\n): AsyncIterable<ArrowTableBatch> {\n // Creates the appropriate arrow.RecordBatchReader subclasses from the input\n // This will also close the underlying source in case of early termination or errors\n\n // As an optimization, return a non-async iterator\n /*\n if (isIterable(readers)) {\n function* makeArrowIterator() {\n for (const reader of readers) {\n for (const batch of reader) {\n yield processBatch(batch, reader);\n }\n break; // only processing one stream of batches\n }\n }\n const arrowIterator = makeArrowIterator();\n }\n */\n\n async function* makeArrowAsyncIterator(): AsyncIterator<ArrowTableBatch> {\n // @ts-ignore\n const readers = arrow.RecordBatchReader.readAll(asyncIterator);\n for await (const reader of readers) {\n for await (const recordBatch of reader) {\n const arrowTabledBatch: ArrowTableBatch = {\n shape: 'arrow-table',\n batchType: 'data',\n data: new arrow.Table([recordBatch]),\n length: recordBatch.data.length\n };\n // processBatch(recordBatch);\n yield arrowTabledBatch;\n }\n break; // only processing one stream of batches\n }\n }\n\n return makeArrowAsyncIterator() as any; // as AsyncIterator<ArrowTableBatch>;\n}\n\n// function processBatch(batch: RecordBatch): ArrowTableBatch {\n// const values = {};\n// batch.schema.fields.forEach(({name}, index) => {\n// values[name] = batch.getChildAt(index)?.toArray();\n// });\n// return {\n// };\n// }\n"],"mappings":"AAEA,OAAO,KAAKA,KAAK,MAAM,cAAc;AAKrC,OAAO,SAASC,mBAAmBA,CACjCC,aAAiE,EACjC;EAmBhC,gBAAgBC,sBAAsBA,CAAA,EAAmC;IAEvE,MAAMC,OAAO,GAAGJ,KAAK,CAACK,iBAAiB,CAACC,OAAO,CAACJ,aAAa,CAAC;IAC9D,WAAW,MAAMK,MAAM,IAAIH,OAAO,EAAE;MAClC,WAAW,MAAMI,WAAW,IAAID,MAAM,EAAE;QACtC,MAAME,gBAAiC,GAAG;UACxCC,KAAK,EAAE,aAAa;UACpBC,SAAS,EAAE,MAAM;UACjBC,IAAI,EAAE,IAAIZ,KAAK,CAACa,KAAK,CAAC,CAACL,WAAW,CAAC,CAAC;UACpCM,MAAM,EAAEN,WAAW,CAACI,IAAI,CAACE;QAC3B,CAAC;QAED,MAAML,gBAAgB;MACxB;MACA;IACF;EACF;EAEA,OAAON,sBAAsB,CAAC,CAAC;AACjC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ColumnarTable, ObjectRowTable } from '@loaders.gl/schema';
|
|
2
|
-
import type { ArrowTable } from './arrow-table';
|
|
3
|
-
import type { ArrowLoaderOptions } from '../arrow-loader';
|
|
4
|
-
export default function parseArrowSync(arrayBuffer: any, options?: ArrowLoaderOptions): ArrowTable | ColumnarTable | ObjectRowTable;
|
|
5
|
-
//# sourceMappingURL=parse-arrow-sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-arrow-sync.d.ts","sourceRoot":"","sources":["../../src/lib/parse-arrow-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAG9C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOxD,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,WAAW,KAAA,EACX,OAAO,CAAC,EAAE,kBAAkB,GAC3B,UAAU,GAAG,aAAa,GAAG,cAAc,CAoB7C"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { convertTable } from '@loaders.gl/schema';
|
|
2
|
-
import * as arrow from 'apache-arrow';
|
|
3
|
-
import { convertApacheArrowToArrowTable, convertArrowToColumnarTable } from "../tables/convert-arrow-to-table.js";
|
|
4
|
-
export default function parseArrowSync(arrayBuffer, options) {
|
|
5
|
-
var _options$arrow;
|
|
6
|
-
const apacheArrowTable = arrow.tableFromIPC([new Uint8Array(arrayBuffer)]);
|
|
7
|
-
const arrowTable = convertApacheArrowToArrowTable(apacheArrowTable);
|
|
8
|
-
const shape = (options === null || options === void 0 ? void 0 : (_options$arrow = options.arrow) === null || _options$arrow === void 0 ? void 0 : _options$arrow.shape) || 'arrow-table';
|
|
9
|
-
switch (shape) {
|
|
10
|
-
case 'arrow-table':
|
|
11
|
-
return arrowTable;
|
|
12
|
-
case 'columnar-table':
|
|
13
|
-
return convertArrowToColumnarTable(arrowTable);
|
|
14
|
-
case 'object-row-table':
|
|
15
|
-
const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
16
|
-
return convertTable(columnarTable, 'object-row-table');
|
|
17
|
-
default:
|
|
18
|
-
throw new Error(shape);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=parse-arrow-sync.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-arrow-sync.js","names":["convertTable","arrow","convertApacheArrowToArrowTable","convertArrowToColumnarTable","parseArrowSync","arrayBuffer","options","_options$arrow","apacheArrowTable","tableFromIPC","Uint8Array","arrowTable","shape","columnarTable","Error"],"sources":["../../src/lib/parse-arrow-sync.ts"],"sourcesContent":["import type {ColumnarTable, ObjectRowTable} from '@loaders.gl/schema';\nimport type {ArrowTable} from './arrow-table';\nimport {convertTable} from '@loaders.gl/schema';\nimport * as arrow from 'apache-arrow';\nimport type {ArrowLoaderOptions} from '../arrow-loader';\nimport {\n convertApacheArrowToArrowTable,\n convertArrowToColumnarTable\n} from '../tables/convert-arrow-to-table';\n\n// Parses arrow to a columnar table\nexport default function parseArrowSync(\n arrayBuffer,\n options?: ArrowLoaderOptions\n): ArrowTable | ColumnarTable | ObjectRowTable {\n const apacheArrowTable = arrow.tableFromIPC([new Uint8Array(arrayBuffer)]);\n const arrowTable = convertApacheArrowToArrowTable(apacheArrowTable);\n\n const shape = options?.arrow?.shape || 'arrow-table';\n switch (shape) {\n case 'arrow-table':\n return arrowTable;\n\n case 'columnar-table':\n return convertArrowToColumnarTable(arrowTable);\n\n case 'object-row-table':\n const columnarTable = convertArrowToColumnarTable(arrowTable);\n return convertTable(columnarTable, 'object-row-table');\n\n default:\n // TODO\n throw new Error(shape);\n }\n}\n"],"mappings":"AAEA,SAAQA,YAAY,QAAO,oBAAoB;AAC/C,OAAO,KAAKC,KAAK,MAAM,cAAc;AAAC,SAGpCC,8BAA8B,EAC9BC,2BAA2B;AAI7B,eAAe,SAASC,cAAcA,CACpCC,WAAW,EACXC,OAA4B,EACiB;EAAA,IAAAC,cAAA;EAC7C,MAAMC,gBAAgB,GAAGP,KAAK,CAACQ,YAAY,CAAC,CAAC,IAAIC,UAAU,CAACL,WAAW,CAAC,CAAC,CAAC;EAC1E,MAAMM,UAAU,GAAGT,8BAA8B,CAACM,gBAAgB,CAAC;EAEnE,MAAMI,KAAK,GAAG,CAAAN,OAAO,aAAPA,OAAO,wBAAAC,cAAA,GAAPD,OAAO,CAAEL,KAAK,cAAAM,cAAA,uBAAdA,cAAA,CAAgBK,KAAK,KAAI,aAAa;EACpD,QAAQA,KAAK;IACX,KAAK,aAAa;MAChB,OAAOD,UAAU;IAEnB,KAAK,gBAAgB;MACnB,OAAOR,2BAA2B,CAACQ,UAAU,CAAC;IAEhD,KAAK,kBAAkB;MACrB,MAAME,aAAa,GAAGV,2BAA2B,CAACQ,UAAU,CAAC;MAC7D,OAAOX,YAAY,CAACa,aAAa,EAAE,kBAAkB,CAAC;IAExD;MAEE,MAAM,IAAIC,KAAK,CAACF,KAAK,CAAC;EAC1B;AACF"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ColumnarTable, ObjectRowTable } from '@loaders.gl/schema';
|
|
2
|
-
import type * as arrow from 'apache-arrow';
|
|
3
|
-
import type { ArrowTable } from '../lib/arrow-table';
|
|
4
|
-
/**
|
|
5
|
-
* Wrap an apache arrow table in a loaders.gl table wrapper.
|
|
6
|
-
* From this additional conversions are available.
|
|
7
|
-
* @param arrowTable
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export declare function convertApacheArrowToArrowTable(arrowTable: arrow.Table): ArrowTable;
|
|
11
|
-
/**
|
|
12
|
-
* Convert an Apache Arrow table to a ColumnarTable
|
|
13
|
-
* @note Currently does not convert schema
|
|
14
|
-
*/
|
|
15
|
-
export declare function convertArrowToColumnarTable(table: ArrowTable): ColumnarTable;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @note - should be part of schema module
|
|
19
|
-
*/
|
|
20
|
-
export declare function convertColumnarToRowFormatTable(columnarTable: ColumnarTable): ObjectRowTable;
|
|
21
|
-
//# sourceMappingURL=convert-arrow-to-table.d.ts.map
|