@loaders.gl/schema 4.3.2 → 4.4.0-alpha.2
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/categories/category-gis.d.ts +6 -0
- package/dist/categories/category-gis.d.ts.map +1 -0
- package/dist/categories/category-image.d.ts.map +1 -0
- package/dist/{types → categories}/category-mesh.d.ts +2 -2
- package/dist/categories/category-mesh.d.ts.map +1 -0
- package/dist/{types → categories}/category-table.d.ts +14 -14
- package/dist/categories/category-table.d.ts.map +1 -0
- package/dist/categories/category-texture.d.ts.map +1 -0
- package/dist/{lib/mesh → deprecated}/mesh-utils.d.ts +4 -2
- package/dist/deprecated/mesh-utils.d.ts.map +1 -0
- package/dist/{lib/mesh → deprecated}/mesh-utils.js +2 -0
- package/dist/dist.dev.js +0 -1836
- package/dist/dist.min.js +1 -1
- package/dist/geometry/binary-features.d.ts +30 -0
- package/dist/geometry/binary-features.d.ts.map +1 -0
- package/dist/geometry/binary-geometries.d.ts +33 -0
- package/dist/geometry/binary-geometries.d.ts.map +1 -0
- package/dist/geometry/flat-geometries.d.ts +61 -0
- package/dist/geometry/flat-geometries.d.ts.map +1 -0
- package/dist/index.cjs +2 -1792
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +10 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -23
- package/dist/types/batch.d.ts +3 -1
- package/dist/types/batch.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/{types → categories}/category-gis.ts +7 -18
- package/src/{types → categories}/category-mesh.ts +2 -2
- package/src/{types → categories}/category-table.ts +14 -17
- package/src/{lib/mesh → deprecated}/mesh-utils.ts +4 -2
- package/src/geometry/binary-features.ts +43 -0
- package/src/geometry/binary-geometries.ts +45 -0
- package/src/{types → geometry}/flat-geometries.ts +44 -14
- package/src/index.ts +15 -101
- package/src/types/batch.ts +3 -1
- package/dist/lib/mesh/convert-mesh.d.ts +0 -15
- package/dist/lib/mesh/convert-mesh.d.ts.map +0 -1
- package/dist/lib/mesh/convert-mesh.js +0 -37
- package/dist/lib/mesh/deduce-mesh-schema.d.ts +0 -24
- package/dist/lib/mesh/deduce-mesh-schema.d.ts.map +0 -1
- package/dist/lib/mesh/deduce-mesh-schema.js +0 -62
- package/dist/lib/mesh/mesh-to-arrow-table.d.ts +0 -1
- package/dist/lib/mesh/mesh-to-arrow-table.d.ts.map +0 -1
- package/dist/lib/mesh/mesh-to-arrow-table.js +0 -47
- package/dist/lib/mesh/mesh-utils.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-field.d.ts +0 -19
- package/dist/lib/table/arrow-api/arrow-like-field.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-field.js +0 -36
- package/dist/lib/table/arrow-api/arrow-like-interface.d.ts +0 -43
- package/dist/lib/table/arrow-api/arrow-like-interface.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-schema.d.ts +0 -12
- package/dist/lib/table/arrow-api/arrow-like-schema.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-schema.js +0 -81
- package/dist/lib/table/arrow-api/arrow-like-table.d.ts +0 -24
- package/dist/lib/table/arrow-api/arrow-like-table.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-table.js +0 -63
- package/dist/lib/table/arrow-api/arrow-like-type.d.ts +0 -177
- package/dist/lib/table/arrow-api/arrow-like-type.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/arrow-like-type.js +0 -442
- package/dist/lib/table/arrow-api/enum.d.ts +0 -92
- package/dist/lib/table/arrow-api/enum.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/enum.js +0 -97
- package/dist/lib/table/arrow-api/get-type-info.d.ts +0 -13
- package/dist/lib/table/arrow-api/get-type-info.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/get-type-info.js +0 -27
- package/dist/lib/table/arrow-api/index.d.ts +0 -5
- package/dist/lib/table/arrow-api/index.d.ts.map +0 -1
- package/dist/lib/table/arrow-api/index.js +0 -7
- package/dist/lib/table/batches/base-table-batch-aggregator.d.ts +0 -20
- package/dist/lib/table/batches/base-table-batch-aggregator.d.ts.map +0 -1
- package/dist/lib/table/batches/base-table-batch-aggregator.js +0 -63
- package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts +0 -23
- package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts.map +0 -1
- package/dist/lib/table/batches/columnar-table-batch-aggregator.js +0 -91
- package/dist/lib/table/batches/row-table-batch-aggregator.d.ts +0 -22
- package/dist/lib/table/batches/row-table-batch-aggregator.d.ts.map +0 -1
- package/dist/lib/table/batches/row-table-batch-aggregator.js +0 -85
- package/dist/lib/table/batches/table-batch-aggregator.d.ts +0 -25
- package/dist/lib/table/batches/table-batch-aggregator.d.ts.map +0 -1
- package/dist/lib/table/batches/table-batch-aggregator.js +0 -4
- package/dist/lib/table/batches/table-batch-builder.d.ts +0 -53
- package/dist/lib/table/batches/table-batch-builder.d.ts.map +0 -1
- package/dist/lib/table/batches/table-batch-builder.js +0 -151
- package/dist/lib/table/simple-table/convert-table.d.ts +0 -43
- package/dist/lib/table/simple-table/convert-table.d.ts.map +0 -1
- package/dist/lib/table/simple-table/convert-table.js +0 -118
- package/dist/lib/table/simple-table/data-type.d.ts +0 -17
- package/dist/lib/table/simple-table/data-type.d.ts.map +0 -1
- package/dist/lib/table/simple-table/data-type.js +0 -88
- package/dist/lib/table/simple-table/make-table-from-batches.d.ts +0 -22
- package/dist/lib/table/simple-table/make-table-from-batches.d.ts.map +0 -1
- package/dist/lib/table/simple-table/make-table-from-batches.js +0 -79
- package/dist/lib/table/simple-table/make-table.d.ts +0 -65
- package/dist/lib/table/simple-table/make-table.d.ts.map +0 -1
- package/dist/lib/table/simple-table/make-table.js +0 -94
- package/dist/lib/table/simple-table/row-utils.d.ts +0 -15
- package/dist/lib/table/simple-table/row-utils.d.ts.map +0 -1
- package/dist/lib/table/simple-table/row-utils.js +0 -49
- package/dist/lib/table/simple-table/table-accessors.d.ts +0 -68
- package/dist/lib/table/simple-table/table-accessors.d.ts.map +0 -1
- package/dist/lib/table/simple-table/table-accessors.js +0 -350
- package/dist/lib/table/simple-table/table-column.d.ts +0 -7
- package/dist/lib/table/simple-table/table-column.d.ts.map +0 -1
- package/dist/lib/table/simple-table/table-column.js +0 -39
- package/dist/lib/table/simple-table/table-schema.d.ts +0 -15
- package/dist/lib/table/simple-table/table-schema.d.ts.map +0 -1
- package/dist/lib/table/simple-table/table-schema.js +0 -100
- package/dist/lib/utils/assert.d.ts +0 -2
- package/dist/lib/utils/assert.d.ts.map +0 -1
- package/dist/lib/utils/assert.js +0 -8
- package/dist/lib/utils/async-queue.d.ts +0 -18
- package/dist/lib/utils/async-queue.d.ts.map +0 -1
- package/dist/lib/utils/async-queue.js +0 -90
- package/dist/types/binary-geometries.d.ts +0 -57
- package/dist/types/binary-geometries.d.ts.map +0 -1
- package/dist/types/category-gis.d.ts +0 -18
- package/dist/types/category-gis.d.ts.map +0 -1
- package/dist/types/category-image.d.ts.map +0 -1
- package/dist/types/category-mesh.d.ts.map +0 -1
- package/dist/types/category-table.d.ts.map +0 -1
- package/dist/types/category-texture.d.ts.map +0 -1
- package/dist/types/flat-geometries.d.ts +0 -30
- package/dist/types/flat-geometries.d.ts.map +0 -1
- package/src/lib/mesh/convert-mesh.ts +0 -51
- package/src/lib/mesh/deduce-mesh-schema.ts +0 -76
- package/src/lib/mesh/mesh-to-arrow-table.ts +0 -47
- package/src/lib/table/arrow-api/arrow-like-field.ts +0 -53
- package/src/lib/table/arrow-api/arrow-like-interface.ts +0 -84
- package/src/lib/table/arrow-api/arrow-like-schema.ts +0 -101
- package/src/lib/table/arrow-api/arrow-like-table.ts +0 -86
- package/src/lib/table/arrow-api/arrow-like-type.ts +0 -502
- package/src/lib/table/arrow-api/enum.ts +0 -99
- package/src/lib/table/arrow-api/get-type-info.ts +0 -38
- package/src/lib/table/arrow-api/index.ts +0 -8
- package/src/lib/table/batches/base-table-batch-aggregator.ts +0 -83
- package/src/lib/table/batches/columnar-table-batch-aggregator.ts +0 -112
- package/src/lib/table/batches/row-table-batch-aggregator.ts +0 -109
- package/src/lib/table/batches/table-batch-aggregator.ts +0 -29
- package/src/lib/table/batches/table-batch-builder.ts +0 -190
- package/src/lib/table/simple-table/convert-table.ts +0 -149
- package/src/lib/table/simple-table/data-type.ts +0 -104
- package/src/lib/table/simple-table/make-table-from-batches.ts +0 -98
- package/src/lib/table/simple-table/make-table.ts +0 -111
- package/src/lib/table/simple-table/row-utils.ts +0 -59
- package/src/lib/table/simple-table/table-accessors.ts +0 -417
- package/src/lib/table/simple-table/table-column.ts +0 -49
- package/src/lib/table/simple-table/table-schema.ts +0 -121
- package/src/lib/utils/assert.ts +0 -8
- package/src/lib/utils/async-queue.ts +0 -104
- package/src/types/binary-geometries.ts +0 -67
- /package/dist/{types → categories}/category-gis.js +0 -0
- /package/dist/{types → categories}/category-image.d.ts +0 -0
- /package/dist/{types → categories}/category-image.js +0 -0
- /package/dist/{types → categories}/category-mesh.js +0 -0
- /package/dist/{types → categories}/category-table.js +0 -0
- /package/dist/{types → categories}/category-texture.d.ts +0 -0
- /package/dist/{types → categories}/category-texture.js +0 -0
- /package/dist/{lib/table/arrow-api/arrow-like-interface.js → geometry/binary-features.js} +0 -0
- /package/dist/{types → geometry}/binary-geometries.js +0 -0
- /package/dist/{types → geometry}/flat-geometries.js +0 -0
- /package/src/{types → categories}/category-image.ts +0 -0
- /package/src/{types → categories}/category-texture.ts +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
// GIS
|
|
6
|
+
import type {TypedArray} from '../types/types';
|
|
7
|
+
import type {
|
|
8
|
+
BinaryPointGeometry,
|
|
9
|
+
BinaryLineGeometry,
|
|
10
|
+
BinaryPolygonGeometry
|
|
11
|
+
} from './binary-geometries';
|
|
12
|
+
|
|
13
|
+
export type BinaryAttribute = {
|
|
14
|
+
value: TypedArray;
|
|
15
|
+
size: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Represent a collection of Features, similar to a GeoJSON FeatureCollection
|
|
20
|
+
* But in columnar format, with binary columns when possible
|
|
21
|
+
*/
|
|
22
|
+
export type BinaryFeatureCollection = {
|
|
23
|
+
shape: 'binary-feature-collection';
|
|
24
|
+
points?: BinaryPointFeature;
|
|
25
|
+
lines?: BinaryLineFeature;
|
|
26
|
+
polygons?: BinaryPolygonFeature;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** Binary feature + binary attributes */
|
|
30
|
+
export type BinaryFeature = BinaryPointFeature | BinaryLineFeature | BinaryPolygonFeature;
|
|
31
|
+
|
|
32
|
+
export type BinaryPointFeature = BinaryPointGeometry & BinaryProperties;
|
|
33
|
+
export type BinaryLineFeature = BinaryLineGeometry & BinaryProperties;
|
|
34
|
+
export type BinaryPolygonFeature = BinaryPolygonGeometry & BinaryProperties;
|
|
35
|
+
|
|
36
|
+
/** Common properties for binary geometries */
|
|
37
|
+
export type BinaryProperties = {
|
|
38
|
+
featureIds: BinaryAttribute;
|
|
39
|
+
globalFeatureIds: BinaryAttribute;
|
|
40
|
+
numericProps: Record<string, BinaryAttribute>;
|
|
41
|
+
properties: Record<string, any>[];
|
|
42
|
+
fields?: Record<string, any>[];
|
|
43
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
// GIS
|
|
6
|
+
import type {TypedArray} from '../types/types';
|
|
7
|
+
|
|
8
|
+
// BINARY FORMAT GEOMETRY
|
|
9
|
+
|
|
10
|
+
export type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Similar to an apache arrow FixedSizeList,
|
|
14
|
+
* contains the contiguous array and the number of values in each element */
|
|
15
|
+
export type BinaryFixedSizeList = {
|
|
16
|
+
value: TypedArray;
|
|
17
|
+
size: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Represent a single Geometry, similar to a GeoJSON Geometry
|
|
22
|
+
*/
|
|
23
|
+
export type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;
|
|
24
|
+
|
|
25
|
+
/** Binary point geometry: an array of positions */
|
|
26
|
+
export type BinaryPointGeometry = {
|
|
27
|
+
type: 'Point';
|
|
28
|
+
positions: BinaryFixedSizeList;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** Binary line geometry, array of positions and indices to the start of each line */
|
|
32
|
+
export type BinaryLineGeometry = {
|
|
33
|
+
type: 'LineString';
|
|
34
|
+
positions: BinaryFixedSizeList;
|
|
35
|
+
pathIndices: BinaryFixedSizeList;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** Binary polygon geometry, an array of positions to each primitite polygon and polygon */
|
|
39
|
+
export type BinaryPolygonGeometry = {
|
|
40
|
+
type: 'Polygon';
|
|
41
|
+
positions: BinaryFixedSizeList;
|
|
42
|
+
polygonIndices: BinaryFixedSizeList;
|
|
43
|
+
primitivePolygonIndices: BinaryFixedSizeList;
|
|
44
|
+
triangles?: BinaryFixedSizeList;
|
|
45
|
+
};
|
|
@@ -3,37 +3,67 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
// FLAT GEOJSON FORMAT GEOMETRY
|
|
6
|
-
import type {Feature, Geometry
|
|
6
|
+
import type {Feature, Geometry} from 'geojson';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Generic flat geometry data storage type
|
|
10
|
+
* (an intermediate "Flat GeoJSON"
|
|
11
|
+
* data format, which maps closely to the binary data buffers.
|
|
12
|
+
* It is similar to GeoJSON, but rather than storing the coordinates
|
|
13
|
+
* in multidimensional arrays, we have a 1D `data` with all the
|
|
14
|
+
* coordinates, and then index into this using the `indices`
|
|
15
|
+
* parameter
|
|
16
|
+
*
|
|
17
|
+
* Thus the indices member lets us look up the relevant range
|
|
18
|
+
* from the data array.
|
|
19
|
+
* The Multi* versions of the above types share the same data
|
|
20
|
+
* structure, just with multiple elements in the indices array
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
*
|
|
24
|
+
* geometry: {
|
|
25
|
+
* type: 'Point', data: [1,2], indices: [0]
|
|
26
|
+
* }
|
|
27
|
+
* geometry: {
|
|
28
|
+
* type: 'LineString', data: [1,2,3,4,...], indices: [0]
|
|
29
|
+
* }
|
|
30
|
+
* geometry: {
|
|
31
|
+
* type: 'Polygon', data: [1,2,3,4,...], indices: [[0, 2]]
|
|
32
|
+
* }
|
|
33
|
+
*/
|
|
34
|
+
export type FlatIndexedGeometry = {
|
|
35
|
+
data: number[];
|
|
36
|
+
indices: number[];
|
|
37
|
+
};
|
|
7
38
|
|
|
8
39
|
/** Flat geometry type */
|
|
9
40
|
export type FlatGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
10
41
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
42
|
+
/** GeoJSON geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */
|
|
43
|
+
export type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;
|
|
14
44
|
|
|
15
|
-
/**
|
|
16
|
-
export type
|
|
45
|
+
/** GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices` */
|
|
46
|
+
export type FlatPoint = {
|
|
47
|
+
type: 'Point';
|
|
17
48
|
data: number[];
|
|
18
49
|
indices: number[];
|
|
19
50
|
};
|
|
20
51
|
|
|
21
|
-
/** GeoJSON (Multi)Point geometry with coordinate data flattened into `data` array and indexed by `indices` */
|
|
22
|
-
export type FlatPoint = RemoveCoordinatesField<Point> & FlatIndexedGeometry;
|
|
23
|
-
|
|
24
52
|
/** GeoJSON (Multi)LineString geometry with coordinate data flattened into `data` array and indexed by `indices` */
|
|
25
|
-
export type FlatLineString =
|
|
53
|
+
export type FlatLineString = {
|
|
54
|
+
type: 'LineString';
|
|
55
|
+
data: number[];
|
|
56
|
+
indices: number[];
|
|
57
|
+
};
|
|
26
58
|
|
|
27
59
|
/** GeoJSON (Multi)Polygon geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */
|
|
28
|
-
export type FlatPolygon =
|
|
60
|
+
export type FlatPolygon = {
|
|
61
|
+
type: 'Polygon';
|
|
29
62
|
data: number[];
|
|
30
63
|
indices: number[][];
|
|
31
64
|
areas: number[][];
|
|
32
65
|
};
|
|
33
66
|
|
|
34
|
-
/** GeoJSON geometry with coordinate data flattened into `data` array and indexed by 2D `indices` */
|
|
35
|
-
export type FlatGeometry = FlatPoint | FlatLineString | FlatPolygon;
|
|
36
|
-
|
|
37
67
|
type FlattenGeometry<Type> = {
|
|
38
68
|
[Property in keyof Type]: Type[Property] extends Geometry ? FlatGeometry : Type[Property];
|
|
39
69
|
};
|
package/src/index.ts
CHANGED
|
@@ -18,8 +18,6 @@ export type {
|
|
|
18
18
|
export type {Schema, Field, DataType, SchemaMetadata, FieldMetadata} from './types/schema';
|
|
19
19
|
export type {Batch} from './types/batch';
|
|
20
20
|
|
|
21
|
-
export {getArrayTypeFromDataType} from './lib/table/simple-table/data-type';
|
|
22
|
-
|
|
23
21
|
// TABLE CATEGORY TYPES
|
|
24
22
|
export type {
|
|
25
23
|
Table,
|
|
@@ -30,7 +28,7 @@ export type {
|
|
|
30
28
|
ColumnarTable,
|
|
31
29
|
ArrowTable,
|
|
32
30
|
Tables
|
|
33
|
-
} from './
|
|
31
|
+
} from './categories/category-table';
|
|
34
32
|
export type {
|
|
35
33
|
TableBatch,
|
|
36
34
|
ArrayRowTableBatch,
|
|
@@ -38,41 +36,7 @@ export type {
|
|
|
38
36
|
GeoJSONTableBatch,
|
|
39
37
|
ColumnarTableBatch,
|
|
40
38
|
ArrowTableBatch
|
|
41
|
-
} from './
|
|
42
|
-
|
|
43
|
-
// TABLE CATEGORY UTILS
|
|
44
|
-
export {TableBatchBuilder} from './lib/table/batches/table-batch-builder';
|
|
45
|
-
export type {TableBatchAggregator} from './lib/table/batches/table-batch-aggregator';
|
|
46
|
-
export {RowTableBatchAggregator} from './lib/table/batches/row-table-batch-aggregator';
|
|
47
|
-
export {ColumnarTableBatchAggregator} from './lib/table/batches/columnar-table-batch-aggregator';
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
isTable,
|
|
51
|
-
getTableLength,
|
|
52
|
-
getTableNumCols,
|
|
53
|
-
getTableCell,
|
|
54
|
-
getTableCellAt,
|
|
55
|
-
getTableRowShape,
|
|
56
|
-
getTableColumnIndex,
|
|
57
|
-
getTableColumnName,
|
|
58
|
-
getTableRowAsObject,
|
|
59
|
-
getTableRowAsArray,
|
|
60
|
-
makeRowIterator,
|
|
61
|
-
makeArrayRowIterator,
|
|
62
|
-
makeObjectRowIterator
|
|
63
|
-
} from './lib/table/simple-table/table-accessors';
|
|
64
|
-
|
|
65
|
-
export {ArrowLikeTable} from './lib/table/arrow-api/arrow-like-table';
|
|
66
|
-
|
|
67
|
-
export {makeTableFromData} from './lib/table/simple-table/make-table';
|
|
68
|
-
export {
|
|
69
|
-
makeTableFromBatches,
|
|
70
|
-
makeBatchFromTable
|
|
71
|
-
} from './lib/table/simple-table/make-table-from-batches';
|
|
72
|
-
export {convertTable} from './lib/table/simple-table/convert-table';
|
|
73
|
-
export {deduceTableSchema} from './lib/table/simple-table/table-schema';
|
|
74
|
-
export {convertToObjectRow, convertToArrayRow} from './lib/table/simple-table/row-utils';
|
|
75
|
-
export {getDataTypeFromArray} from './lib/table/simple-table/data-type';
|
|
39
|
+
} from './categories/category-table';
|
|
76
40
|
|
|
77
41
|
// MESH CATEGORY
|
|
78
42
|
export type {
|
|
@@ -82,24 +46,17 @@ export type {
|
|
|
82
46
|
MeshGeometry,
|
|
83
47
|
MeshAttribute,
|
|
84
48
|
MeshAttributes
|
|
85
|
-
} from './
|
|
86
|
-
|
|
87
|
-
export {getMeshSize, getMeshBoundingBox} from './lib/mesh/mesh-utils';
|
|
88
|
-
// Commented out due to https://github.com/visgl/deck.gl/issues/6906 and https://github.com/visgl/loaders.gl/issues/2177
|
|
89
|
-
// export {convertMesh} from './category/mesh/convert-mesh';
|
|
90
|
-
export {
|
|
91
|
-
deduceMeshSchema,
|
|
92
|
-
deduceMeshField,
|
|
93
|
-
makeMeshAttributeMetadata
|
|
94
|
-
} from './lib/mesh/deduce-mesh-schema';
|
|
49
|
+
} from './categories/category-mesh';
|
|
95
50
|
|
|
96
51
|
// TEXTURES
|
|
97
|
-
export type {TextureLevel, GPUTextureFormat} from './
|
|
52
|
+
export type {TextureLevel, GPUTextureFormat} from './categories/category-texture';
|
|
98
53
|
|
|
99
54
|
// IMAGES
|
|
100
|
-
export type {ImageDataType, ImageType, ImageTypeEnum} from './
|
|
55
|
+
export type {ImageDataType, ImageType, ImageTypeEnum} from './categories/category-image';
|
|
56
|
+
|
|
57
|
+
// GIS CATEGORY - GEOARROW
|
|
58
|
+
// export type {GeoArrowMetadata, GeoArrowEncoding} from './geometry/geoarrow-metadata';
|
|
101
59
|
|
|
102
|
-
// TYPES
|
|
103
60
|
// GIS CATEGORY - GEOJSON
|
|
104
61
|
export type {
|
|
105
62
|
GeoJSON,
|
|
@@ -115,9 +72,7 @@ export type {
|
|
|
115
72
|
Polygon,
|
|
116
73
|
MultiPolygon,
|
|
117
74
|
GeometryCollection
|
|
118
|
-
} from './
|
|
119
|
-
|
|
120
|
-
export type {GeojsonGeometryInfo} from './types/category-gis';
|
|
75
|
+
} from './categories/category-gis';
|
|
121
76
|
|
|
122
77
|
// GIS CATEGORY - FLAT GEOJSON
|
|
123
78
|
export type {
|
|
@@ -128,7 +83,7 @@ export type {
|
|
|
128
83
|
FlatPoint,
|
|
129
84
|
FlatLineString,
|
|
130
85
|
FlatPolygon
|
|
131
|
-
} from './
|
|
86
|
+
} from './categories/category-gis';
|
|
132
87
|
|
|
133
88
|
// GIS CATEGORY - BINARY
|
|
134
89
|
export type {
|
|
@@ -138,58 +93,17 @@ export type {
|
|
|
138
93
|
BinaryLineGeometry,
|
|
139
94
|
BinaryPolygonGeometry,
|
|
140
95
|
BinaryAttribute
|
|
141
|
-
} from './
|
|
96
|
+
} from './categories/category-gis';
|
|
142
97
|
export type {
|
|
143
98
|
BinaryFeatureCollection,
|
|
144
99
|
BinaryFeature,
|
|
145
100
|
BinaryPointFeature,
|
|
146
101
|
BinaryLineFeature,
|
|
147
102
|
BinaryPolygonFeature
|
|
148
|
-
} from './
|
|
103
|
+
} from './categories/category-gis';
|
|
149
104
|
|
|
150
|
-
//
|
|
151
|
-
export {
|
|
152
|
-
Schema as ArrowLikeSchema,
|
|
153
|
-
Field as ArrowLikeField,
|
|
154
|
-
DataType as ArrowLikeDataType,
|
|
155
|
-
Null,
|
|
156
|
-
Binary,
|
|
157
|
-
Bool,
|
|
158
|
-
Int,
|
|
159
|
-
Int8,
|
|
160
|
-
Int16,
|
|
161
|
-
Int32,
|
|
162
|
-
Int64,
|
|
163
|
-
Uint8,
|
|
164
|
-
Uint16,
|
|
165
|
-
Uint32,
|
|
166
|
-
Uint64,
|
|
167
|
-
Float,
|
|
168
|
-
Float16,
|
|
169
|
-
Float32,
|
|
170
|
-
Float64,
|
|
171
|
-
Utf8,
|
|
172
|
-
Date,
|
|
173
|
-
DateDay,
|
|
174
|
-
DateMillisecond,
|
|
175
|
-
Time,
|
|
176
|
-
TimeMillisecond,
|
|
177
|
-
TimeSecond,
|
|
178
|
-
Timestamp,
|
|
179
|
-
TimestampSecond,
|
|
180
|
-
TimestampMillisecond,
|
|
181
|
-
TimestampMicrosecond,
|
|
182
|
-
TimestampNanosecond,
|
|
183
|
-
Interval,
|
|
184
|
-
IntervalDayTime,
|
|
185
|
-
IntervalYearMonth,
|
|
186
|
-
FixedSizeList,
|
|
187
|
-
Struct
|
|
188
|
-
} from './lib/table/arrow-api/index';
|
|
105
|
+
// DEPRECATED
|
|
189
106
|
|
|
190
|
-
//
|
|
191
|
-
|
|
192
|
-
// SCHEMA UTILS
|
|
193
|
-
export {getTypeInfo} from './lib/table/arrow-api/get-type-info';
|
|
107
|
+
// MESH CATEGORY
|
|
194
108
|
|
|
195
|
-
export {
|
|
109
|
+
export {getMeshSize, getMeshBoundingBox} from './deprecated/mesh-utils';
|
package/src/types/batch.ts
CHANGED
|
@@ -12,9 +12,11 @@ type ApacheRecordBatch = unknown;
|
|
|
12
12
|
* @see parseInBatches()
|
|
13
13
|
* @see loadInBatches()
|
|
14
14
|
*/
|
|
15
|
-
export type Batch = {
|
|
15
|
+
export type Batch<MetadataT = unknown> = {
|
|
16
16
|
/** A batch can contain metadata, data, or in case of unstructured data (JSON) */
|
|
17
17
|
batchType: 'data' | 'metadata' | 'partial-result' | 'final-result';
|
|
18
|
+
/** Metadata for this batch if batchType === 'metadata' */
|
|
19
|
+
metadata?: MetadataT;
|
|
18
20
|
/** A string identifying the shape of data in this batch (table, etc) */
|
|
19
21
|
shape: string;
|
|
20
22
|
/** Schema of the data in this batch */
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Mesh } from "../../types/category-mesh.js";
|
|
2
|
-
import type { ColumnarTable, ArrowTable } from "../../types/category-table.js";
|
|
3
|
-
type TargetShape = 'mesh' | 'columnar-table' | 'arrow-table';
|
|
4
|
-
/**
|
|
5
|
-
* Convert a mesh to a specific shape
|
|
6
|
-
*/
|
|
7
|
-
export declare function convertMesh(mesh: Mesh, shape: TargetShape, options?: any): Mesh | ColumnarTable | ArrowTable;
|
|
8
|
-
/**
|
|
9
|
-
* Convert a loaders.gl Mesh to a Columnar Table
|
|
10
|
-
* @param mesh
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare function convertMeshToColumnarTable(mesh: Mesh): ColumnarTable;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=convert-mesh.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-mesh.d.ts","sourceRoot":"","sources":["../../../src/lib/mesh/convert-mesh.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,IAAI,EAAC,qCAAkC;AACpD,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU,EAAC,sCAAmC;AAG1E,KAAK,WAAW,GAAG,MAAM,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE7D;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,WAAW,EAClB,OAAO,CAAC,EAAE,GAAG,GACZ,IAAI,GAAG,aAAa,GAAG,UAAU,CAcnC;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,CAYpE"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
/**
|
|
5
|
-
* Convert a mesh to a specific shape
|
|
6
|
-
*/
|
|
7
|
-
export function convertMesh(mesh, shape, options) {
|
|
8
|
-
switch (shape || 'mesh') {
|
|
9
|
-
case 'mesh':
|
|
10
|
-
return mesh;
|
|
11
|
-
case 'columnar-table':
|
|
12
|
-
return convertMeshToColumnarTable(mesh);
|
|
13
|
-
// case 'arrow-table':
|
|
14
|
-
// return {
|
|
15
|
-
// shape: 'arrow-table',
|
|
16
|
-
// data: convertMeshToArrowTable(mesh)
|
|
17
|
-
// };
|
|
18
|
-
default:
|
|
19
|
-
throw new Error(`Unsupported shape ${options?.shape}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Convert a loaders.gl Mesh to a Columnar Table
|
|
24
|
-
* @param mesh
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
export function convertMeshToColumnarTable(mesh) {
|
|
28
|
-
const columns = {};
|
|
29
|
-
for (const [columnName, attribute] of Object.entries(mesh.attributes)) {
|
|
30
|
-
columns[columnName] = attribute.value;
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
shape: 'columnar-table',
|
|
34
|
-
schema: mesh.schema,
|
|
35
|
-
data: columns
|
|
36
|
-
};
|
|
37
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MeshAttribute, MeshAttributes } from "../../types/category-mesh.js";
|
|
2
|
-
import { Schema, Field } from "../../types/schema.js";
|
|
3
|
-
/**
|
|
4
|
-
* Create a schema for mesh attributes data
|
|
5
|
-
* @param attributes
|
|
6
|
-
* @param metadata
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare function deduceMeshSchema(attributes: MeshAttributes, metadata?: Record<string, string>): Schema;
|
|
10
|
-
/**
|
|
11
|
-
* Create arrow-like schema field for mesh attribute
|
|
12
|
-
* @param attributeName
|
|
13
|
-
* @param attribute
|
|
14
|
-
* @param optionalMetadata
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
export declare function deduceMeshField(name: string, attribute: MeshAttribute, optionalMetadata?: Record<string, string>): Field;
|
|
18
|
-
/**
|
|
19
|
-
* Make metadata by mesh attribute properties
|
|
20
|
-
* @param attribute
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
export declare function makeMeshAttributeMetadata(attribute: MeshAttribute): Record<string, string>;
|
|
24
|
-
//# sourceMappingURL=deduce-mesh-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deduce-mesh-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/mesh/deduce-mesh-schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,qCAAkC;AACxE,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,8BAA2B;AAGjD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,cAAc,EAC1B,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACpC,MAAM,CAGR;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,aAAa,EACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACxC,KAAK,CASP;AAgBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAY1F"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { getDataTypeFromTypedArray } from "../table/simple-table/data-type.js";
|
|
5
|
-
/**
|
|
6
|
-
* Create a schema for mesh attributes data
|
|
7
|
-
* @param attributes
|
|
8
|
-
* @param metadata
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export function deduceMeshSchema(attributes, metadata = {}) {
|
|
12
|
-
const fields = deduceMeshFields(attributes);
|
|
13
|
-
return { fields, metadata };
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Create arrow-like schema field for mesh attribute
|
|
17
|
-
* @param attributeName
|
|
18
|
-
* @param attribute
|
|
19
|
-
* @param optionalMetadata
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
export function deduceMeshField(name, attribute, optionalMetadata) {
|
|
23
|
-
const type = getDataTypeFromTypedArray(attribute.value);
|
|
24
|
-
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
25
|
-
return {
|
|
26
|
-
name,
|
|
27
|
-
type: { type: 'fixed-size-list', listSize: attribute.size, children: [{ name: 'value', type }] },
|
|
28
|
-
nullable: false,
|
|
29
|
-
metadata
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Create fields array for mesh attributes
|
|
34
|
-
* @param attributes
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
function deduceMeshFields(attributes) {
|
|
38
|
-
const fields = [];
|
|
39
|
-
for (const attributeName in attributes) {
|
|
40
|
-
const attribute = attributes[attributeName];
|
|
41
|
-
fields.push(deduceMeshField(attributeName, attribute));
|
|
42
|
-
}
|
|
43
|
-
return fields;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Make metadata by mesh attribute properties
|
|
47
|
-
* @param attribute
|
|
48
|
-
* @returns
|
|
49
|
-
*/
|
|
50
|
-
export function makeMeshAttributeMetadata(attribute) {
|
|
51
|
-
const result = {};
|
|
52
|
-
if ('byteOffset' in attribute) {
|
|
53
|
-
result.byteOffset = attribute.byteOffset.toString(10);
|
|
54
|
-
}
|
|
55
|
-
if ('byteStride' in attribute) {
|
|
56
|
-
result.byteStride = attribute.byteStride.toString(10);
|
|
57
|
-
}
|
|
58
|
-
if ('normalized' in attribute) {
|
|
59
|
-
result.normalized = attribute.normalized.toString();
|
|
60
|
-
}
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=mesh-to-arrow-table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-to-arrow-table.d.ts","sourceRoot":"","sources":["../../../src/lib/mesh/mesh-to-arrow-table.ts"],"names":[],"mappings":""}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl
|
|
3
|
-
// SPDX-License-Identifier: MIT
|
|
4
|
-
// Copyright (c) vis.gl contributors
|
|
5
|
-
/* Problem with arrow dependency...
|
|
6
|
-
import {
|
|
7
|
-
Table,
|
|
8
|
-
Schema,
|
|
9
|
-
RecordBatch,
|
|
10
|
-
FixedSizeList,
|
|
11
|
-
Field,
|
|
12
|
-
Data,
|
|
13
|
-
FixedSizeListVector
|
|
14
|
-
} from 'apache-arrow';
|
|
15
|
-
import {AbstractVector} from 'apache-arrow/vector';
|
|
16
|
-
import {getArrowType, getArrowVector} from '../table/arrow/arrow-type-utils';
|
|
17
|
-
import type {Mesh} from './mesh-types';
|
|
18
|
-
import {makeMeshAttributeMetadata} from './deduce-mesh-schema';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* * Convert a loaders.gl Mesh to an Apache Arrow Table
|
|
22
|
-
* @param mesh
|
|
23
|
-
* @param metadata
|
|
24
|
-
* @param batchSize
|
|
25
|
-
* @returns
|
|
26
|
-
*
|
|
27
|
-
export function convertMeshToArrowTable(mesh: Mesh, batchSize?: number): Table {
|
|
28
|
-
const vectors: AbstractVector[] = [];
|
|
29
|
-
const fields: Field[] = [];
|
|
30
|
-
for (const attributeKey in mesh.attributes) {
|
|
31
|
-
const attribute = mesh.attributes[attributeKey];
|
|
32
|
-
const {value, size = 1} = attribute;
|
|
33
|
-
const type = getArrowType(value);
|
|
34
|
-
const vector = getArrowVector(value);
|
|
35
|
-
const listType = new FixedSizeList(size, new Field('value', type));
|
|
36
|
-
const field = new Field(attributeKey, listType, false, makeMeshAttributeMetadata(attribute));
|
|
37
|
-
const data = new Data(listType, 0, value.length / size, 0, undefined, [vector]);
|
|
38
|
-
const listVector = new FixedSizeListVector(data);
|
|
39
|
-
vectors.push(listVector);
|
|
40
|
-
fields.push(field);
|
|
41
|
-
}
|
|
42
|
-
const schema = new Schema(fields, mesh?.schema?.metadata || new Map<string, string>());
|
|
43
|
-
const recordBatch = new RecordBatch(schema, vectors[0].length, vectors);
|
|
44
|
-
const table = new Table(schema, recordBatch);
|
|
45
|
-
return table;
|
|
46
|
-
}
|
|
47
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/mesh/mesh-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,6BAA0B;AAC7C,OAAO,EAAC,cAAc,EAAC,qCAAkC;AAEzD,KAAK,WAAW,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAC,CAAC;AAE/C;;;GAGG;AACH,KAAK,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAExE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,WAAW,GAAG,MAAM,CAU3D;AAED;;;;GAIG;AAEH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,GAAG,WAAW,CA4B1E"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DataType } from "./arrow-like-type.js";
|
|
2
|
-
/**
|
|
3
|
-
* ArrowJS `Field` API-compatible class for row-based tables
|
|
4
|
-
* https://loaders.gl/arrowjs/docs/api-reference/field
|
|
5
|
-
* A field holds name, nullable, and metadata information about a table "column"
|
|
6
|
-
* A Schema is essentially a list of fields
|
|
7
|
-
*/
|
|
8
|
-
export declare class ArrowLikeField {
|
|
9
|
-
name: string;
|
|
10
|
-
type: DataType;
|
|
11
|
-
nullable: boolean;
|
|
12
|
-
metadata: Map<string, string>;
|
|
13
|
-
constructor(name: string, type: DataType, nullable?: boolean, metadata?: Map<string, string>);
|
|
14
|
-
get typeId(): number;
|
|
15
|
-
clone(): ArrowLikeField;
|
|
16
|
-
compareTo(other: this): boolean;
|
|
17
|
-
toString(): string;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=arrow-like-field.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-like-field.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/arrow-like-field.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,6BAA0B;AAE3C;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAG5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,QAAQ,UAAQ,EAChB,QAAQ,GAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAa;IAQ3C,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,KAAK,IAAI,cAAc;IAIvB,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;IAS/B,QAAQ,IAAI,MAAM;CAKnB"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
/**
|
|
5
|
-
* ArrowJS `Field` API-compatible class for row-based tables
|
|
6
|
-
* https://loaders.gl/arrowjs/docs/api-reference/field
|
|
7
|
-
* A field holds name, nullable, and metadata information about a table "column"
|
|
8
|
-
* A Schema is essentially a list of fields
|
|
9
|
-
*/
|
|
10
|
-
export class ArrowLikeField {
|
|
11
|
-
name;
|
|
12
|
-
type;
|
|
13
|
-
nullable;
|
|
14
|
-
metadata;
|
|
15
|
-
constructor(name, type, nullable = false, metadata = new Map()) {
|
|
16
|
-
this.name = name;
|
|
17
|
-
this.type = type;
|
|
18
|
-
this.nullable = nullable;
|
|
19
|
-
this.metadata = metadata;
|
|
20
|
-
}
|
|
21
|
-
get typeId() {
|
|
22
|
-
return this.type && this.type.typeId;
|
|
23
|
-
}
|
|
24
|
-
clone() {
|
|
25
|
-
return new ArrowLikeField(this.name, this.type, this.nullable, this.metadata);
|
|
26
|
-
}
|
|
27
|
-
compareTo(other) {
|
|
28
|
-
return (this.name === other.name &&
|
|
29
|
-
this.type === other.type &&
|
|
30
|
-
this.nullable === other.nullable &&
|
|
31
|
-
this.metadata === other.metadata);
|
|
32
|
-
}
|
|
33
|
-
toString() {
|
|
34
|
-
return `${JSON.stringify(this.type)}${this.nullable ? ', nullable' : ''}${this.metadata ? `, metadata: ${JSON.stringify(this.metadata)}` : ''}`;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { DataType } from "./arrow-like-type.js";
|
|
2
|
-
/**
|
|
3
|
-
* ArrowJS `Field` API-compatible class for row-based tables
|
|
4
|
-
* https://loaders.gl/arrowjs/docs/api-reference/field
|
|
5
|
-
* A field holds name, nullable, and metadata information about a table "column"
|
|
6
|
-
* A Schema is essentially a list of fields
|
|
7
|
-
*/
|
|
8
|
-
export interface Field {
|
|
9
|
-
name: string;
|
|
10
|
-
type: DataType;
|
|
11
|
-
nullable: boolean;
|
|
12
|
-
metadata: Map<string, string>;
|
|
13
|
-
typeId(): number;
|
|
14
|
-
clone(): Field;
|
|
15
|
-
compareTo(other: this): boolean;
|
|
16
|
-
toString(): any;
|
|
17
|
-
}
|
|
18
|
-
export interface Schema {
|
|
19
|
-
fields: Field[];
|
|
20
|
-
metadata: Map<string, string>;
|
|
21
|
-
compareTo(other: Schema): boolean;
|
|
22
|
-
select(...columnNames: string[]): Schema;
|
|
23
|
-
selectAt(...columnIndices: number[]): Schema;
|
|
24
|
-
assign(schemaOrFields: Schema | Field[]): Schema;
|
|
25
|
-
}
|
|
26
|
-
export interface ArrowLikeVector {
|
|
27
|
-
table: Table;
|
|
28
|
-
columnName: string;
|
|
29
|
-
get(rowIndex: number): unknown;
|
|
30
|
-
toArray(): ArrayLike<unknown>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Class that provides an API similar to Apache Arrow Table class
|
|
34
|
-
* Forwards methods directly if the underlying table is Arrow, otherwise calls accessor functions
|
|
35
|
-
*/
|
|
36
|
-
export interface Table {
|
|
37
|
-
schema: Schema;
|
|
38
|
-
data: any;
|
|
39
|
-
numCols: number;
|
|
40
|
-
length(): number;
|
|
41
|
-
getChild(columnName: string): ArrowLikeVector;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=arrow-like-interface.d.ts.map
|