@loaders.gl/schema 3.1.8 → 3.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/category/common.d.ts +1 -2
- package/dist/category/common.d.ts.map +1 -1
- package/dist/category/image/image.d.ts +18 -0
- package/dist/category/image/image.d.ts.map +1 -0
- package/dist/category/image/image.js +2 -0
- package/dist/category/mesh/convert-mesh.js +6 -5
- package/dist/category/mesh/mesh-to-arrow-table.d.ts +10 -0
- package/dist/category/mesh/mesh-to-arrow-table.d.ts.map +1 -1
- package/dist/category/mesh/mesh-to-arrow-table.js +26 -36
- package/dist/category/table/table-types.d.ts +9 -3
- package/dist/category/table/table-types.d.ts.map +1 -1
- package/dist/category/texture/texture.d.ts +18 -0
- package/dist/category/texture/texture.d.ts.map +1 -0
- package/dist/category/texture/texture.js +2 -0
- package/dist/dist.min.js +15078 -208
- package/dist/es5/category/image/image.js +2 -0
- package/dist/es5/category/image/image.js.map +1 -0
- package/dist/es5/category/mesh/convert-mesh.js +8 -0
- package/dist/es5/category/mesh/convert-mesh.js.map +1 -1
- package/dist/es5/category/mesh/mesh-to-arrow-table.js +38 -0
- package/dist/es5/category/mesh/mesh-to-arrow-table.js.map +1 -1
- package/dist/es5/category/texture/texture.js +2 -0
- package/dist/es5/category/texture/texture.js.map +1 -0
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/arrow/arrow-type-utils.js +70 -0
- package/dist/es5/lib/arrow/arrow-type-utils.js.map +1 -1
- package/dist/esm/category/image/image.js +2 -0
- package/dist/esm/category/image/image.js.map +1 -0
- package/dist/esm/category/mesh/convert-mesh.js +7 -0
- package/dist/esm/category/mesh/convert-mesh.js.map +1 -1
- package/dist/esm/category/mesh/mesh-to-arrow-table.js +29 -0
- package/dist/esm/category/mesh/mesh-to-arrow-table.js.map +1 -1
- package/dist/esm/category/texture/texture.js +2 -0
- package/dist/esm/category/texture/texture.js.map +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/arrow/arrow-type-utils.js +60 -0
- package/dist/esm/lib/arrow/arrow-type-utils.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/arrow/arrow-type-utils.d.ts +5 -0
- package/dist/lib/arrow/arrow-type-utils.d.ts.map +1 -1
- package/dist/lib/arrow/arrow-type-utils.js +47 -67
- package/package.json +4 -3
- package/src/category/common.ts +1 -2
- package/src/category/image/image.ts +19 -0
- package/src/category/mesh/convert-mesh.ts +6 -6
- package/src/category/mesh/mesh-to-arrow-table.ts +2 -4
- package/src/category/table/table-types.ts +7 -4
- package/src/category/texture/texture.ts +28 -0
- package/src/index.ts +8 -2
- package/src/lib/arrow/arrow-type-utils.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"image.js"}
|
|
@@ -10,6 +10,8 @@ exports.convertMeshToColumnarTable = convertMeshToColumnarTable;
|
|
|
10
10
|
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
|
|
13
|
+
var _meshToArrowTable = require("./mesh-to-arrow-table");
|
|
14
|
+
|
|
13
15
|
function convertMesh(mesh, shape, options) {
|
|
14
16
|
switch (shape || 'mesh') {
|
|
15
17
|
case 'mesh':
|
|
@@ -18,6 +20,12 @@ function convertMesh(mesh, shape, options) {
|
|
|
18
20
|
case 'columnar-table':
|
|
19
21
|
return convertMeshToColumnarTable(mesh);
|
|
20
22
|
|
|
23
|
+
case 'arrow-table':
|
|
24
|
+
return {
|
|
25
|
+
shape: 'arrow-table',
|
|
26
|
+
data: (0, _meshToArrowTable.convertMeshToArrowTable)(mesh)
|
|
27
|
+
};
|
|
28
|
+
|
|
21
29
|
default:
|
|
22
30
|
throw new Error("Unsupported shape ".concat(options === null || options === void 0 ? void 0 : options.shape));
|
|
23
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/category/mesh/convert-mesh.ts"],"names":["convertMesh","mesh","shape","options","convertMeshToColumnarTable","Error","columns","Object","entries","attributes","columnName","attribute","value","schema"
|
|
1
|
+
{"version":3,"sources":["../../../../src/category/mesh/convert-mesh.ts"],"names":["convertMesh","mesh","shape","options","convertMeshToColumnarTable","data","Error","columns","Object","entries","attributes","columnName","attribute","value","schema"],"mappings":";;;;;;;;;;;;AAEA;;AAOO,SAASA,WAAT,CACLC,IADK,EAELC,KAFK,EAGLC,OAHK,EAI8B;AACnC,UAAQD,KAAK,IAAI,MAAjB;AACE,SAAK,MAAL;AACE,aAAOD,IAAP;;AACF,SAAK,gBAAL;AACE,aAAOG,0BAA0B,CAACH,IAAD,CAAjC;;AACF,SAAK,aAAL;AACE,aAAO;AACLC,QAAAA,KAAK,EAAE,aADF;AAELG,QAAAA,IAAI,EAAE,+CAAwBJ,IAAxB;AAFD,OAAP;;AAIF;AACE,YAAM,IAAIK,KAAJ,6BAA+BH,OAA/B,aAA+BA,OAA/B,uBAA+BA,OAAO,CAAED,KAAxC,EAAN;AAXJ;AAaD;;AAOM,SAASE,0BAAT,CAAoCH,IAApC,EAA+D;AACpE,MAAMM,OAAO,GAAG,EAAhB;;AAEA,qCAAsCC,MAAM,CAACC,OAAP,CAAeR,IAAI,CAACS,UAApB,CAAtC,qCAAuE;AAAlE;AAAA,QAAOC,UAAP;AAAA,QAAmBC,SAAnB;;AACHL,IAAAA,OAAO,CAACI,UAAD,CAAP,GAAsBC,SAAS,CAACC,KAAhC;AACD;;AAED,SAAO;AACLX,IAAAA,KAAK,EAAE,gBADF;AAELY,IAAAA,MAAM,EAAEb,IAAI,CAACa,MAFR;AAGLT,IAAAA,IAAI,EAAEE;AAHD,GAAP;AAKD","sourcesContent":["import type {Mesh} from './mesh-types';\nimport type {ColumnarTable, ArrowTable} from '../table/table-types';\nimport {convertMeshToArrowTable} from './mesh-to-arrow-table';\n\ntype TargetShape = 'mesh' | 'columnar-table' | 'arrow-table';\n\n/**\n * Convert a mesh to a specific shape\n */\nexport function convertMesh(\n mesh: Mesh,\n shape: TargetShape,\n options?: any\n): Mesh | ColumnarTable | ArrowTable {\n switch (shape || 'mesh') {\n case 'mesh':\n return mesh;\n case 'columnar-table':\n return convertMeshToColumnarTable(mesh);\n case 'arrow-table':\n return {\n shape: 'arrow-table',\n data: convertMeshToArrowTable(mesh)\n };\n default:\n throw new Error(`Unsupported shape ${options?.shape}`);\n }\n}\n\n/**\n * Convert a loaders.gl Mesh to a Columnar Table\n * @param mesh\n * @returns\n */\nexport function convertMeshToColumnarTable(mesh: Mesh): ColumnarTable {\n const columns = {};\n\n for (const [columnName, attribute] of Object.entries(mesh.attributes)) {\n columns[columnName] = attribute.value;\n }\n\n return {\n shape: 'columnar-table',\n schema: mesh.schema,\n data: columns\n };\n}\n"],"file":"convert-mesh.js"}
|
|
@@ -1,2 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.convertMeshToArrowTable = convertMeshToArrowTable;
|
|
7
|
+
|
|
8
|
+
var _Arrow = require("apache-arrow/Arrow.dom");
|
|
9
|
+
|
|
10
|
+
var _arrowTypeUtils = require("../../lib/arrow/arrow-type-utils");
|
|
11
|
+
|
|
12
|
+
var _deduceMeshSchema = require("./deduce-mesh-schema");
|
|
13
|
+
|
|
14
|
+
function convertMeshToArrowTable(mesh, batchSize) {
|
|
15
|
+
var _mesh$schema;
|
|
16
|
+
|
|
17
|
+
var vectors = [];
|
|
18
|
+
var fields = [];
|
|
19
|
+
|
|
20
|
+
for (var attributeKey in mesh.attributes) {
|
|
21
|
+
var attribute = mesh.attributes[attributeKey];
|
|
22
|
+
var value = attribute.value,
|
|
23
|
+
_attribute$size = attribute.size,
|
|
24
|
+
size = _attribute$size === void 0 ? 1 : _attribute$size;
|
|
25
|
+
var type = (0, _arrowTypeUtils.getArrowType)(value);
|
|
26
|
+
var vector = (0, _arrowTypeUtils.getArrowVector)(value);
|
|
27
|
+
var listType = new _Arrow.FixedSizeList(size, new _Arrow.Field('value', type));
|
|
28
|
+
var field = new _Arrow.Field(attributeKey, listType, false, (0, _deduceMeshSchema.makeMeshAttributeMetadata)(attribute));
|
|
29
|
+
var data = new _Arrow.Data(listType, 0, value.length / size, 0, undefined, [vector]);
|
|
30
|
+
var listVector = new _Arrow.FixedSizeListVector(data);
|
|
31
|
+
vectors.push(listVector);
|
|
32
|
+
fields.push(field);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var schema = new _Arrow.Schema(fields, (mesh === null || mesh === void 0 ? void 0 : (_mesh$schema = mesh.schema) === null || _mesh$schema === void 0 ? void 0 : _mesh$schema.metadata) || new Map());
|
|
36
|
+
var recordBatch = new _Arrow.RecordBatch(schema, vectors[0].length, vectors);
|
|
37
|
+
var table = new _Arrow.Table(schema, recordBatch);
|
|
38
|
+
return table;
|
|
39
|
+
}
|
|
2
40
|
//# sourceMappingURL=mesh-to-arrow-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"mesh-to-arrow-table.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/category/mesh/mesh-to-arrow-table.ts"],"names":["convertMeshToArrowTable","mesh","batchSize","vectors","fields","attributeKey","attributes","attribute","value","size","type","vector","listType","FixedSizeList","Field","field","data","Data","length","undefined","listVector","FixedSizeListVector","push","schema","Schema","metadata","Map","recordBatch","RecordBatch","table","Table"],"mappings":";;;;;;;AAAA;;AAUA;;AAEA;;AASO,SAASA,uBAAT,CAAiCC,IAAjC,EAA6CC,SAA7C,EAAwE;AAAA;;AAC7E,MAAMC,OAAyB,GAAG,EAAlC;AACA,MAAMC,MAAe,GAAG,EAAxB;;AACA,OAAK,IAAMC,YAAX,IAA2BJ,IAAI,CAACK,UAAhC,EAA4C;AAC1C,QAAMC,S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D","sourcesContent":["import {\n Table,\n Schema,\n RecordBatch,\n FixedSizeList,\n Field,\n Data,\n FixedSizeListVector\n} from 'apache-arrow/Arrow.dom';\nimport {AbstractVector} from 'apache-arrow/vector';\nimport {getArrowType, getArrowVector} from '../../lib/arrow/arrow-type-utils';\nimport type {Mesh} from './mesh-types';\nimport {makeMeshAttributeMetadata} from './deduce-mesh-schema';\n\n/**\n * * Convert a loaders.gl Mesh to an Apache Arrow Table\n * @param mesh\n * @param metadata\n * @param batchSize\n * @returns\n */\nexport function convertMeshToArrowTable(mesh: Mesh, batchSize?: number): Table {\n const vectors: AbstractVector[] = [];\n const fields: Field[] = [];\n for (const attributeKey in mesh.attributes) {\n const attribute = mesh.attributes[attributeKey];\n const {value, size = 1} = attribute;\n const type = getArrowType(value);\n const vector = getArrowVector(value);\n const listType = new FixedSizeList(size, new Field('value', type));\n const field = new Field(attributeKey, listType, false, makeMeshAttributeMetadata(attribute));\n const data = new Data(listType, 0, value.length / size, 0, undefined, [vector]);\n const listVector = new FixedSizeListVector(data);\n vectors.push(listVector);\n fields.push(field);\n }\n const schema = new Schema(fields, mesh?.schema?.metadata || new Map<string, string>());\n const recordBatch = new RecordBatch(schema, vectors[0].length, vectors);\n const table = new Table(schema, recordBatch);\n return table;\n}\n"],"file":"mesh-to-arrow-table.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"texture.js"}
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;AAEA;;AACA;;AAEA;;AAYA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;AAEA;;AACA;;AAEA;;AAYA;;AACA;;AACA;;AAuDA;;AA0CA;;AACA;;AACA;;AAEA","sourcesContent":["// COMMON CATEGORY\nexport type {TypedArray, NumberArray, AnyArray} from './types';\n\nexport type {Batch} from './category/common';\n\n// TABLE CATEGORY TYPES\nexport type {\n Table,\n ArrayRowTable,\n ObjectRowTable,\n ColumnarTable,\n ArrowTable,\n Tables\n} from './category/table/table-types';\nexport type {\n TableBatch,\n RowArrayTableBatch,\n RowObjectTableBatch,\n ColumnarTableBatch,\n ArrowTableBatch\n} from './category/table/table-types';\n\n// TABLE CATEGORY UTILS\nexport {default as TableBatchBuilder} from './lib/batches/table-batch-builder';\nexport type {TableBatchAggregator} from './lib/batches/table-batch-aggregator';\nexport {default as RowTableBatchAggregator} from './lib/batches/row-table-batch-aggregator';\nexport {default as ColumnarTableBatchAggregator} from './lib/batches/columnar-table-batch-aggregator';\n\nexport {convertToObjectRow, convertToArrayRow} from './lib/utils/row-utils';\n\n// MESH CATEGORY\nexport type {\n MeshTable,\n MeshArrowTable,\n Mesh,\n MeshGeometry,\n MeshAttribute,\n MeshAttributes\n} from './category/mesh/mesh-types';\n\nexport {getMeshSize, getMeshBoundingBox} from './category/mesh/mesh-utils';\nexport {convertMesh} from './category/mesh/convert-mesh';\nexport {\n deduceMeshSchema,\n deduceMeshField,\n makeMeshAttributeMetadata\n} from './category/mesh/deduce-mesh-schema';\n\n// TEXTURES\nexport type {TextureLevel, GPUTextureFormat} from './category/texture/texture';\n\n// IMAGES\nexport type {ImageDataType, ImageType, ImageTypeEnum} from './category/image/image';\n\n// TYPES\n// GIS CATEGORY - GEOJSON\nexport type {GeoJSON, Feature, Geometry, Position, GeoJsonProperties} from './category/gis';\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from './category/gis';\n\nexport type {GeojsonGeometryInfo} from './category/gis';\n\n// GIS CATEGORY - FLAT GEOJSON\nexport type {\n FlatFeature,\n FlatIndexedGeometry,\n FlatGeometry,\n FlatGeometryType,\n FlatPoint,\n FlatLineString,\n FlatPolygon\n} from './category/gis';\n\n// GIS CATEGORY - BINARY\nexport type {\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryAttribute\n} from './category/gis';\nexport type {\n BinaryFeatures,\n BinaryPointFeatures,\n BinaryLineFeatures,\n BinaryPolygonFeatures\n} from './category/gis';\n\n// SCHEMA\nexport {\n Schema,\n Field,\n DataType,\n Null,\n Binary,\n Bool,\n Int,\n Int8,\n Int16,\n Int32,\n Int64,\n Uint8,\n Uint16,\n Uint32,\n Uint64,\n Float,\n Float16,\n Float32,\n Float64,\n Utf8,\n Date,\n DateDay,\n DateMillisecond,\n Time,\n TimeMillisecond,\n TimeSecond,\n Timestamp,\n TimestampSecond,\n TimestampMillisecond,\n TimestampMicrosecond,\n TimestampNanosecond,\n Interval,\n IntervalDayTime,\n IntervalYearMonth,\n FixedSizeList,\n Struct\n} from './lib/schema/schema';\n\n// EXPERIMENTAL APIs\n\n// SCHEMA UTILS\nexport {deduceTypeFromColumn, deduceTypeFromValue} from './lib/schema-utils/deduce-column-type';\nexport {getTypeInfo} from './lib/arrow/get-type-info';\nexport {getArrowTypeFromTypedArray} from './lib/arrow/arrow-like-type-utils';\n\nexport {default as AsyncQueue} from './lib/utils/async-queue';\n"],"file":"index.js"}
|
|
@@ -1,2 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getArrowType = getArrowType;
|
|
7
|
+
exports.getArrowVector = getArrowVector;
|
|
8
|
+
|
|
9
|
+
var _Arrow = require("apache-arrow/Arrow.dom");
|
|
10
|
+
|
|
11
|
+
function getArrowType(array) {
|
|
12
|
+
switch (array.constructor) {
|
|
13
|
+
case Int8Array:
|
|
14
|
+
return new _Arrow.Int8();
|
|
15
|
+
|
|
16
|
+
case Uint8Array:
|
|
17
|
+
return new _Arrow.Uint8();
|
|
18
|
+
|
|
19
|
+
case Int16Array:
|
|
20
|
+
return new _Arrow.Int16();
|
|
21
|
+
|
|
22
|
+
case Uint16Array:
|
|
23
|
+
return new _Arrow.Uint16();
|
|
24
|
+
|
|
25
|
+
case Int32Array:
|
|
26
|
+
return new _Arrow.Int32();
|
|
27
|
+
|
|
28
|
+
case Uint32Array:
|
|
29
|
+
return new _Arrow.Uint32();
|
|
30
|
+
|
|
31
|
+
case Float32Array:
|
|
32
|
+
return new _Arrow.Float32();
|
|
33
|
+
|
|
34
|
+
case Float64Array:
|
|
35
|
+
return new _Arrow.Float64();
|
|
36
|
+
|
|
37
|
+
default:
|
|
38
|
+
throw new Error('array type not supported');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getArrowVector(array) {
|
|
43
|
+
switch (array.constructor) {
|
|
44
|
+
case Int8Array:
|
|
45
|
+
return _Arrow.Int8Vector.from(array);
|
|
46
|
+
|
|
47
|
+
case Uint8Array:
|
|
48
|
+
return _Arrow.Uint8Vector.from(array);
|
|
49
|
+
|
|
50
|
+
case Int16Array:
|
|
51
|
+
return _Arrow.Int16Vector.from(array);
|
|
52
|
+
|
|
53
|
+
case Uint16Array:
|
|
54
|
+
return _Arrow.Uint16Vector.from(array);
|
|
55
|
+
|
|
56
|
+
case Int32Array:
|
|
57
|
+
return _Arrow.Int32Vector.from(array);
|
|
58
|
+
|
|
59
|
+
case Uint32Array:
|
|
60
|
+
return _Arrow.Uint32Vector.from(array);
|
|
61
|
+
|
|
62
|
+
case Float32Array:
|
|
63
|
+
return _Arrow.Float32Vector.from(array);
|
|
64
|
+
|
|
65
|
+
case Float64Array:
|
|
66
|
+
return _Arrow.Float64Vector.from(array);
|
|
67
|
+
|
|
68
|
+
default:
|
|
69
|
+
throw new Error('array type not supported');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
2
72
|
//# sourceMappingURL=arrow-type-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"arrow-type-utils.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/arrow/arrow-type-utils.ts"],"names":["getArrowType","array","constructor","Int8Array","Int8","Uint8Array","Uint8","Int16Array","Int16","Uint16Array","Uint16","Int32Array","Int32","Uint32Array","Uint32","Float32Array","Float32","Float64Array","Float64","Error","getArrowVector","Int8Vector","from","Uint8Vector","Int16Vector","Uint16Vector","Int32Vector","Uint32Vector","Float32Vector","Float64Vector"],"mappings":";;;;;;;;AACA;;AAqBO,SAASA,YAAT,CAAsBC,KAAtB,EAAmD;AACxD,UAAQA,KAAK,CAACC,WAAd;AACE,SAAKC,SAAL;AACE,aAAO,IAAIC,WAAJ,EAAP;;AACF,SAAKC,UAAL;AACE,aAAO,IAAIC,YAAJ,EAAP;;AACF,SAAKC,UAAL;AACE,aAAO,IAAIC,YAAJ,EAAP;;AACF,SAAKC,WAAL;AACE,aAAO,IAAIC,aAAJ,EAAP;;AACF,SAAKC,UAAL;AACE,aAAO,IAAIC,YAAJ,EAAP;;AACF,SAAKC,WAAL;AACE,aAAO,IAAIC,aAAJ,EAAP;;AACF,SAAKC,YAAL;AACE,aAAO,IAAIC,cAAJ,EAAP;;AACF,SAAKC,YAAL;AACE,aAAO,IAAIC,cAAJ,EAAP;;AACF;AACE,YAAM,IAAIC,KAAJ,CAAU,0BAAV,CAAN;AAlBJ;AAoBD;;AAEM,SAASC,cAAT,CAAwBnB,KAAxB,EAA2D;AAChE,UAAQA,KAAK,CAACC,WAAd;AACE,SAAKC,SAAL;AACE,aAAOkB,kBAAWC,IAAX,CAAgBrB,KAAhB,CAAP;;AACF,SAAKI,UAAL;AACE,aAAOkB,mBAAYD,IAAZ,CAAiBrB,KAAjB,CAAP;;AACF,SAAKM,UAAL;AACE,aAAOiB,mBAAYF,IAAZ,CAAiBrB,KAAjB,CAAP;;AACF,SAAKQ,WAAL;AACE,aAAOgB,oBAAaH,IAAb,CAAkBrB,KAAlB,CAAP;;AACF,SAAKU,UAAL;AACE,aAAOe,mBAAYJ,IAAZ,CAAiBrB,KAAjB,CAAP;;AACF,SAAKY,WAAL;AACE,aAAOc,oBAAaL,IAAb,CAAkBrB,KAAlB,CAAP;;AACF,SAAKc,YAAL;AACE,aAAOa,qBAAcN,IAAd,CAAmBrB,KAAnB,CAAP;;AACF,SAAKgB,YAAL;AACE,aAAOY,qBAAcP,IAAd,CAAmBrB,KAAnB,CAAP;;AACF;AACE,YAAM,IAAIkB,KAAJ,CAAU,0BAAV,CAAN;AAlBJ;AAoBD","sourcesContent":["import type {TypedArray} from '../../types';\nimport {\n DataType,\n Float32,\n Float64,\n Int16,\n Int32,\n Int8,\n Uint16,\n Uint32,\n Uint8,\n Int8Vector,\n Uint8Vector,\n Int16Vector,\n Uint16Vector,\n Int32Vector,\n Uint32Vector,\n Float32Vector,\n Float64Vector\n} from 'apache-arrow/Arrow.dom';\nimport {AbstractVector} from 'apache-arrow/vector';\n\nexport function getArrowType(array: TypedArray): DataType {\n switch (array.constructor) {\n case Int8Array:\n return new Int8();\n case Uint8Array:\n return new Uint8();\n case Int16Array:\n return new Int16();\n case Uint16Array:\n return new Uint16();\n case Int32Array:\n return new Int32();\n case Uint32Array:\n return new Uint32();\n case Float32Array:\n return new Float32();\n case Float64Array:\n return new Float64();\n default:\n throw new Error('array type not supported');\n }\n}\n\nexport function getArrowVector(array: TypedArray): AbstractVector {\n switch (array.constructor) {\n case Int8Array:\n return Int8Vector.from(array);\n case Uint8Array:\n return Uint8Vector.from(array);\n case Int16Array:\n return Int16Vector.from(array);\n case Uint16Array:\n return Uint16Vector.from(array);\n case Int32Array:\n return Int32Vector.from(array);\n case Uint32Array:\n return Uint32Vector.from(array);\n case Float32Array:\n return Float32Vector.from(array);\n case Float64Array:\n return Float64Vector.from(array);\n default:\n throw new Error('array type not supported');\n }\n}\n"],"file":"arrow-type-utils.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"image.js"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { convertMeshToArrowTable } from './mesh-to-arrow-table';
|
|
1
2
|
export function convertMesh(mesh, shape, options) {
|
|
2
3
|
switch (shape || 'mesh') {
|
|
3
4
|
case 'mesh':
|
|
@@ -6,6 +7,12 @@ export function convertMesh(mesh, shape, options) {
|
|
|
6
7
|
case 'columnar-table':
|
|
7
8
|
return convertMeshToColumnarTable(mesh);
|
|
8
9
|
|
|
10
|
+
case 'arrow-table':
|
|
11
|
+
return {
|
|
12
|
+
shape: 'arrow-table',
|
|
13
|
+
data: convertMeshToArrowTable(mesh)
|
|
14
|
+
};
|
|
15
|
+
|
|
9
16
|
default:
|
|
10
17
|
throw new Error("Unsupported shape ".concat(options === null || options === void 0 ? void 0 : options.shape));
|
|
11
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/category/mesh/convert-mesh.ts"],"names":["convertMesh","mesh","shape","options","convertMeshToColumnarTable","Error","columns","columnName","attribute","Object","entries","attributes","value","schema"
|
|
1
|
+
{"version":3,"sources":["../../../../src/category/mesh/convert-mesh.ts"],"names":["convertMeshToArrowTable","convertMesh","mesh","shape","options","convertMeshToColumnarTable","data","Error","columns","columnName","attribute","Object","entries","attributes","value","schema"],"mappings":"AAEA,SAAQA,uBAAR,QAAsC,uBAAtC;AAOA,OAAO,SAASC,WAAT,CACLC,IADK,EAELC,KAFK,EAGLC,OAHK,EAI8B;AACnC,UAAQD,KAAK,IAAI,MAAjB;AACE,SAAK,MAAL;AACE,aAAOD,IAAP;;AACF,SAAK,gBAAL;AACE,aAAOG,0BAA0B,CAACH,IAAD,CAAjC;;AACF,SAAK,aAAL;AACE,aAAO;AACLC,QAAAA,KAAK,EAAE,aADF;AAELG,QAAAA,IAAI,EAAEN,uBAAuB,CAACE,IAAD;AAFxB,OAAP;;AAIF;AACE,YAAM,IAAIK,KAAJ,6BAA+BH,OAA/B,aAA+BA,OAA/B,uBAA+BA,OAAO,CAAED,KAAxC,EAAN;AAXJ;AAaD;AAOD,OAAO,SAASE,0BAAT,CAAoCH,IAApC,EAA+D;AACpE,QAAMM,OAAO,GAAG,EAAhB;;AAEA,OAAK,MAAM,CAACC,UAAD,EAAaC,SAAb,CAAX,IAAsCC,MAAM,CAACC,OAAP,CAAeV,IAAI,CAACW,UAApB,CAAtC,EAAuE;AACrEL,IAAAA,OAAO,CAACC,UAAD,CAAP,GAAsBC,SAAS,CAACI,KAAhC;AACD;;AAED,SAAO;AACLX,IAAAA,KAAK,EAAE,gBADF;AAELY,IAAAA,MAAM,EAAEb,IAAI,CAACa,MAFR;AAGLT,IAAAA,IAAI,EAAEE;AAHD,GAAP;AAKD","sourcesContent":["import type {Mesh} from './mesh-types';\nimport type {ColumnarTable, ArrowTable} from '../table/table-types';\nimport {convertMeshToArrowTable} from './mesh-to-arrow-table';\n\ntype TargetShape = 'mesh' | 'columnar-table' | 'arrow-table';\n\n/**\n * Convert a mesh to a specific shape\n */\nexport function convertMesh(\n mesh: Mesh,\n shape: TargetShape,\n options?: any\n): Mesh | ColumnarTable | ArrowTable {\n switch (shape || 'mesh') {\n case 'mesh':\n return mesh;\n case 'columnar-table':\n return convertMeshToColumnarTable(mesh);\n case 'arrow-table':\n return {\n shape: 'arrow-table',\n data: convertMeshToArrowTable(mesh)\n };\n default:\n throw new Error(`Unsupported shape ${options?.shape}`);\n }\n}\n\n/**\n * Convert a loaders.gl Mesh to a Columnar Table\n * @param mesh\n * @returns\n */\nexport function convertMeshToColumnarTable(mesh: Mesh): ColumnarTable {\n const columns = {};\n\n for (const [columnName, attribute] of Object.entries(mesh.attributes)) {\n columns[columnName] = attribute.value;\n }\n\n return {\n shape: 'columnar-table',\n schema: mesh.schema,\n data: columns\n };\n}\n"],"file":"convert-mesh.js"}
|
|
@@ -1,2 +1,31 @@
|
|
|
1
|
+
import { Table, Schema, RecordBatch, FixedSizeList, Field, Data, FixedSizeListVector } from 'apache-arrow/Arrow.dom';
|
|
2
|
+
import { getArrowType, getArrowVector } from '../../lib/arrow/arrow-type-utils';
|
|
3
|
+
import { makeMeshAttributeMetadata } from './deduce-mesh-schema';
|
|
4
|
+
export function convertMeshToArrowTable(mesh, batchSize) {
|
|
5
|
+
var _mesh$schema;
|
|
1
6
|
|
|
7
|
+
const vectors = [];
|
|
8
|
+
const fields = [];
|
|
9
|
+
|
|
10
|
+
for (const attributeKey in mesh.attributes) {
|
|
11
|
+
const attribute = mesh.attributes[attributeKey];
|
|
12
|
+
const {
|
|
13
|
+
value,
|
|
14
|
+
size = 1
|
|
15
|
+
} = attribute;
|
|
16
|
+
const type = getArrowType(value);
|
|
17
|
+
const vector = getArrowVector(value);
|
|
18
|
+
const listType = new FixedSizeList(size, new Field('value', type));
|
|
19
|
+
const field = new Field(attributeKey, listType, false, makeMeshAttributeMetadata(attribute));
|
|
20
|
+
const data = new Data(listType, 0, value.length / size, 0, undefined, [vector]);
|
|
21
|
+
const listVector = new FixedSizeListVector(data);
|
|
22
|
+
vectors.push(listVector);
|
|
23
|
+
fields.push(field);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const schema = new Schema(fields, (mesh === null || mesh === void 0 ? void 0 : (_mesh$schema = mesh.schema) === null || _mesh$schema === void 0 ? void 0 : _mesh$schema.metadata) || new Map());
|
|
27
|
+
const recordBatch = new RecordBatch(schema, vectors[0].length, vectors);
|
|
28
|
+
const table = new Table(schema, recordBatch);
|
|
29
|
+
return table;
|
|
30
|
+
}
|
|
2
31
|
//# sourceMappingURL=mesh-to-arrow-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"mesh-to-arrow-table.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/category/mesh/mesh-to-arrow-table.ts"],"names":["Table","Schema","RecordBatch","FixedSizeList","Field","Data","FixedSizeListVector","getArrowType","getArrowVector","makeMeshAttributeMetadata","convertMeshToArrowTable","mesh","batchSize","vectors","fields","attributeKey","attributes","attribute","value","size","type","vector","listType","field","data","length","undefined","listVector","push","schema","metadata","Map","recordBatch","table"],"mappings":"AAAA,SACEA,KADF,EAEEC,MAFF,EAGEC,WAHF,EAIEC,aAJF,EAKEC,KALF,EAMEC,IANF,EAOEC,mBAPF,QAQO,wBARP;AAUA,SAAQC,YAAR,EAAsBC,cAAtB,QAA2C,kCAA3C;AAEA,SAAQC,yBAAR,QAAwC,sBAAxC;AASA,OAAO,SAASC,uBAAT,CAAiCC,IAAjC,EAA6CC,SAA7C,EAAwE;AAAA;;AAC7E,QAAMC,OAAyB,GAAG,EAAlC;AACA,QAAMC,MAAe,GAAG,EAAxB;;AACA,OAAK,MAAMC,YAAX,IAA2BJ,IAAI,CAACK,UAAhC,EAA4C;AAC1C,UAAMC,SAAS,GAA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,\n RecordBatch,\n FixedSizeList,\n Field,\n Data,\n FixedSizeListVector\n} from 'apache-arrow/Arrow.dom';\nimport {AbstractVector} from 'apache-arrow/vector';\nimport {getArrowType, getArrowVector} from '../../lib/arrow/arrow-type-utils';\nimport type {Mesh} from './mesh-types';\nimport {makeMeshAttributeMetadata} from './deduce-mesh-schema';\n\n/**\n * * Convert a loaders.gl Mesh to an Apache Arrow Table\n * @param mesh\n * @param metadata\n * @param batchSize\n * @returns\n */\nexport function convertMeshToArrowTable(mesh: Mesh, batchSize?: number): Table {\n const vectors: AbstractVector[] = [];\n const fields: Field[] = [];\n for (const attributeKey in mesh.attributes) {\n const attribute = mesh.attributes[attributeKey];\n const {value, size = 1} = attribute;\n const type = getArrowType(value);\n const vector = getArrowVector(value);\n const listType = new FixedSizeList(size, new Field('value', type));\n const field = new Field(attributeKey, listType, false, makeMeshAttributeMetadata(attribute));\n const data = new Data(listType, 0, value.length / size, 0, undefined, [vector]);\n const listVector = new FixedSizeListVector(data);\n vectors.push(listVector);\n fields.push(field);\n }\n const schema = new Schema(fields, mesh?.schema?.metadata || new Map<string, string>());\n const recordBatch = new RecordBatch(schema, vectors[0].length, vectors);\n const table = new Table(schema, recordBatch);\n return table;\n}\n"],"file":"mesh-to-arrow-table.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"texture.js"}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":["default","TableBatchBuilder","RowTableBatchAggregator","ColumnarTableBatchAggregator","convertToObjectRow","convertToArrayRow","getMeshSize","getMeshBoundingBox","convertMesh","deduceMeshSchema","deduceMeshField","makeMeshAttributeMetadata","Schema","Field","DataType","Null","Binary","Bool","Int","Int8","Int16","Int32","Int64","Uint8","Uint16","Uint32","Uint64","Float","Float16","Float32","Float64","Utf8","Date","DateDay","DateMillisecond","Time","TimeMillisecond","TimeSecond","Timestamp","TimestampSecond","TimestampMillisecond","TimestampMicrosecond","TimestampNanosecond","Interval","IntervalDayTime","IntervalYearMonth","FixedSizeList","Struct","deduceTypeFromColumn","deduceTypeFromValue","getTypeInfo","getArrowTypeFromTypedArray","AsyncQueue"],"mappings":"AAuBA,SAAQA,OAAO,IAAIC,iBAAnB,QAA2C,mCAA3C;AAEA,SAAQD,OAAO,IAAIE,uBAAnB,QAAiD,0CAAjD;AACA,SAAQF,OAAO,IAAIG,4BAAnB,QAAsD,+CAAtD;AAEA,SAAQC,kBAAR,EAA4BC,iBAA5B,QAAoD,uBAApD;AAYA,SAAQC,WAAR,EAAqBC,kBAArB,QAA8C,4BAA9C;AACA,SAAQC,WAAR,QAA0B,8BAA1B;AACA,SACEC,gBADF,EAEEC,eAFF,EAGEC,yBAHF,QAIO,oCAJP;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":["default","TableBatchBuilder","RowTableBatchAggregator","ColumnarTableBatchAggregator","convertToObjectRow","convertToArrayRow","getMeshSize","getMeshBoundingBox","convertMesh","deduceMeshSchema","deduceMeshField","makeMeshAttributeMetadata","Schema","Field","DataType","Null","Binary","Bool","Int","Int8","Int16","Int32","Int64","Uint8","Uint16","Uint32","Uint64","Float","Float16","Float32","Float64","Utf8","Date","DateDay","DateMillisecond","Time","TimeMillisecond","TimeSecond","Timestamp","TimestampSecond","TimestampMillisecond","TimestampMicrosecond","TimestampNanosecond","Interval","IntervalDayTime","IntervalYearMonth","FixedSizeList","Struct","deduceTypeFromColumn","deduceTypeFromValue","getTypeInfo","getArrowTypeFromTypedArray","AsyncQueue"],"mappings":"AAuBA,SAAQA,OAAO,IAAIC,iBAAnB,QAA2C,mCAA3C;AAEA,SAAQD,OAAO,IAAIE,uBAAnB,QAAiD,0CAAjD;AACA,SAAQF,OAAO,IAAIG,4BAAnB,QAAsD,+CAAtD;AAEA,SAAQC,kBAAR,EAA4BC,iBAA5B,QAAoD,uBAApD;AAYA,SAAQC,WAAR,EAAqBC,kBAArB,QAA8C,4BAA9C;AACA,SAAQC,WAAR,QAA0B,8BAA1B;AACA,SACEC,gBADF,EAEEC,eAFF,EAGEC,yBAHF,QAIO,oCAJP;AAuDA,SACEC,MADF,EAEEC,KAFF,EAGEC,QAHF,EAIEC,IAJF,EAKEC,MALF,EAMEC,IANF,EAOEC,GAPF,EAQEC,IARF,EASEC,KATF,EAUEC,KAVF,EAWEC,KAXF,EAYEC,KAZF,EAaEC,MAbF,EAcEC,MAdF,EAeEC,MAfF,EAgBEC,KAhBF,EAiBEC,OAjBF,EAkBEC,OAlBF,EAmBEC,OAnBF,EAoBEC,IApBF,EAqBEC,IArBF,EAsBEC,OAtBF,EAuBEC,eAvBF,EAwBEC,IAxBF,EAyBEC,eAzBF,EA0BEC,UA1BF,EA2BEC,SA3BF,EA4BEC,eA5BF,EA6BEC,oBA7BF,EA8BEC,oBA9BF,EA+BEC,mBA/BF,EAgCEC,QAhCF,EAiCEC,eAjCF,EAkCEC,iBAlCF,EAmCEC,aAnCF,EAoCEC,MApCF,QAqCO,qBArCP;AA0CA,SAAQC,oBAAR,EAA8BC,mBAA9B,QAAwD,uCAAxD;AACA,SAAQC,WAAR,QAA0B,2BAA1B;AACA,SAAQC,0BAAR,QAAyC,mCAAzC;AAEA,SAAQnD,OAAO,IAAIoD,UAAnB,QAAoC,yBAApC","sourcesContent":["// COMMON CATEGORY\nexport type {TypedArray, NumberArray, AnyArray} from './types';\n\nexport type {Batch} from './category/common';\n\n// TABLE CATEGORY TYPES\nexport type {\n Table,\n ArrayRowTable,\n ObjectRowTable,\n ColumnarTable,\n ArrowTable,\n Tables\n} from './category/table/table-types';\nexport type {\n TableBatch,\n RowArrayTableBatch,\n RowObjectTableBatch,\n ColumnarTableBatch,\n ArrowTableBatch\n} from './category/table/table-types';\n\n// TABLE CATEGORY UTILS\nexport {default as TableBatchBuilder} from './lib/batches/table-batch-builder';\nexport type {TableBatchAggregator} from './lib/batches/table-batch-aggregator';\nexport {default as RowTableBatchAggregator} from './lib/batches/row-table-batch-aggregator';\nexport {default as ColumnarTableBatchAggregator} from './lib/batches/columnar-table-batch-aggregator';\n\nexport {convertToObjectRow, convertToArrayRow} from './lib/utils/row-utils';\n\n// MESH CATEGORY\nexport type {\n MeshTable,\n MeshArrowTable,\n Mesh,\n MeshGeometry,\n MeshAttribute,\n MeshAttributes\n} from './category/mesh/mesh-types';\n\nexport {getMeshSize, getMeshBoundingBox} from './category/mesh/mesh-utils';\nexport {convertMesh} from './category/mesh/convert-mesh';\nexport {\n deduceMeshSchema,\n deduceMeshField,\n makeMeshAttributeMetadata\n} from './category/mesh/deduce-mesh-schema';\n\n// TEXTURES\nexport type {TextureLevel, GPUTextureFormat} from './category/texture/texture';\n\n// IMAGES\nexport type {ImageDataType, ImageType, ImageTypeEnum} from './category/image/image';\n\n// TYPES\n// GIS CATEGORY - GEOJSON\nexport type {GeoJSON, Feature, Geometry, Position, GeoJsonProperties} from './category/gis';\nexport type {\n Point,\n MultiPoint,\n LineString,\n MultiLineString,\n Polygon,\n MultiPolygon,\n GeometryCollection\n} from './category/gis';\n\nexport type {GeojsonGeometryInfo} from './category/gis';\n\n// GIS CATEGORY - FLAT GEOJSON\nexport type {\n FlatFeature,\n FlatIndexedGeometry,\n FlatGeometry,\n FlatGeometryType,\n FlatPoint,\n FlatLineString,\n FlatPolygon\n} from './category/gis';\n\n// GIS CATEGORY - BINARY\nexport type {\n BinaryGeometryType,\n BinaryGeometry,\n BinaryPointGeometry,\n BinaryLineGeometry,\n BinaryPolygonGeometry,\n BinaryAttribute\n} from './category/gis';\nexport type {\n BinaryFeatures,\n BinaryPointFeatures,\n BinaryLineFeatures,\n BinaryPolygonFeatures\n} from './category/gis';\n\n// SCHEMA\nexport {\n Schema,\n Field,\n DataType,\n Null,\n Binary,\n Bool,\n Int,\n Int8,\n Int16,\n Int32,\n Int64,\n Uint8,\n Uint16,\n Uint32,\n Uint64,\n Float,\n Float16,\n Float32,\n Float64,\n Utf8,\n Date,\n DateDay,\n DateMillisecond,\n Time,\n TimeMillisecond,\n TimeSecond,\n Timestamp,\n TimestampSecond,\n TimestampMillisecond,\n TimestampMicrosecond,\n TimestampNanosecond,\n Interval,\n IntervalDayTime,\n IntervalYearMonth,\n FixedSizeList,\n Struct\n} from './lib/schema/schema';\n\n// EXPERIMENTAL APIs\n\n// SCHEMA UTILS\nexport {deduceTypeFromColumn, deduceTypeFromValue} from './lib/schema-utils/deduce-column-type';\nexport {getTypeInfo} from './lib/arrow/get-type-info';\nexport {getArrowTypeFromTypedArray} from './lib/arrow/arrow-like-type-utils';\n\nexport {default as AsyncQueue} from './lib/utils/async-queue';\n"],"file":"index.js"}
|
|
@@ -1,2 +1,62 @@
|
|
|
1
|
+
import { Float32, Float64, Int16, Int32, Int8, Uint16, Uint32, Uint8, Int8Vector, Uint8Vector, Int16Vector, Uint16Vector, Int32Vector, Uint32Vector, Float32Vector, Float64Vector } from 'apache-arrow/Arrow.dom';
|
|
2
|
+
export function getArrowType(array) {
|
|
3
|
+
switch (array.constructor) {
|
|
4
|
+
case Int8Array:
|
|
5
|
+
return new Int8();
|
|
1
6
|
|
|
7
|
+
case Uint8Array:
|
|
8
|
+
return new Uint8();
|
|
9
|
+
|
|
10
|
+
case Int16Array:
|
|
11
|
+
return new Int16();
|
|
12
|
+
|
|
13
|
+
case Uint16Array:
|
|
14
|
+
return new Uint16();
|
|
15
|
+
|
|
16
|
+
case Int32Array:
|
|
17
|
+
return new Int32();
|
|
18
|
+
|
|
19
|
+
case Uint32Array:
|
|
20
|
+
return new Uint32();
|
|
21
|
+
|
|
22
|
+
case Float32Array:
|
|
23
|
+
return new Float32();
|
|
24
|
+
|
|
25
|
+
case Float64Array:
|
|
26
|
+
return new Float64();
|
|
27
|
+
|
|
28
|
+
default:
|
|
29
|
+
throw new Error('array type not supported');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function getArrowVector(array) {
|
|
33
|
+
switch (array.constructor) {
|
|
34
|
+
case Int8Array:
|
|
35
|
+
return Int8Vector.from(array);
|
|
36
|
+
|
|
37
|
+
case Uint8Array:
|
|
38
|
+
return Uint8Vector.from(array);
|
|
39
|
+
|
|
40
|
+
case Int16Array:
|
|
41
|
+
return Int16Vector.from(array);
|
|
42
|
+
|
|
43
|
+
case Uint16Array:
|
|
44
|
+
return Uint16Vector.from(array);
|
|
45
|
+
|
|
46
|
+
case Int32Array:
|
|
47
|
+
return Int32Vector.from(array);
|
|
48
|
+
|
|
49
|
+
case Uint32Array:
|
|
50
|
+
return Uint32Vector.from(array);
|
|
51
|
+
|
|
52
|
+
case Float32Array:
|
|
53
|
+
return Float32Vector.from(array);
|
|
54
|
+
|
|
55
|
+
case Float64Array:
|
|
56
|
+
return Float64Vector.from(array);
|
|
57
|
+
|
|
58
|
+
default:
|
|
59
|
+
throw new Error('array type not supported');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
2
62
|
//# sourceMappingURL=arrow-type-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"arrow-type-utils.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/arrow/arrow-type-utils.ts"],"names":["Float32","Float64","Int16","Int32","Int8","Uint16","Uint32","Uint8","Int8Vector","Uint8Vector","Int16Vector","Uint16Vector","Int32Vector","Uint32Vector","Float32Vector","Float64Vector","getArrowType","array","constructor","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","Error","getArrowVector","from"],"mappings":"AACA,SAEEA,OAFF,EAGEC,OAHF,EAIEC,KAJF,EAKEC,KALF,EAMEC,IANF,EAOEC,MAPF,EAQEC,MARF,EASEC,KATF,EAUEC,UAVF,EAWEC,WAXF,EAYEC,WAZF,EAaEC,YAbF,EAcEC,WAdF,EAeEC,YAfF,EAgBEC,aAhBF,EAiBEC,aAjBF,QAkBO,wBAlBP;AAqBA,OAAO,SAASC,YAAT,CAAsBC,KAAtB,EA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AN;AAlBJ;AAoBD","sourcesContent":["import type {TypedArray} from '../../types';\nimport {\n DataType,\n Float32,\n Float64,\n Int16,\n Int32,\n Int8,\n Uint16,\n Uint32,\n Uint8,\n Int8Vector,\n Uint8Vector,\n Int16Vector,\n Uint16Vector,\n Int32Vector,\n Uint32Vector,\n Float32Vector,\n Float64Vector\n} from 'apache-arrow/Arrow.dom';\nimport {AbstractVector} from 'apache-arrow/vector';\n\nexport function getArrowType(array: TypedArray): DataType {\n switch (array.constructor) {\n case Int8Array:\n return new Int8();\n case Uint8Array:\n return new Uint8();\n case Int16Array:\n return new Int16();\n case Uint16Array:\n return new Uint16();\n case Int32Array:\n return new Int32();\n case Uint32Array:\n return new Uint32();\n case Float32Array:\n return new Float32();\n case Float64Array:\n return new Float64();\n default:\n throw new Error('array type not supported');\n }\n}\n\nexport function getArrowVector(array: TypedArray): AbstractVector {\n switch (array.constructor) {\n case Int8Array:\n return Int8Vector.from(array);\n case Uint8Array:\n return Uint8Vector.from(array);\n case Int16Array:\n return Int16Vector.from(array);\n case Uint16Array:\n return Uint16Vector.from(array);\n case Int32Array:\n return Int32Vector.from(array);\n case Uint32Array:\n return Uint32Vector.from(array);\n case Float32Array:\n return Float32Vector.from(array);\n case Float64Array:\n return Float64Vector.from(array);\n default:\n throw new Error('array type not supported');\n }\n}\n"],"file":"arrow-type-utils.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { TypedArray, NumberArray, AnyArray } from './types';
|
|
2
2
|
export type { Batch } from './category/common';
|
|
3
|
-
export type { Table, ArrayRowTable, ObjectRowTable, ColumnarTable, ArrowTable } from './category/table/table-types';
|
|
3
|
+
export type { Table, ArrayRowTable, ObjectRowTable, ColumnarTable, ArrowTable, Tables } from './category/table/table-types';
|
|
4
4
|
export type { TableBatch, RowArrayTableBatch, RowObjectTableBatch, ColumnarTableBatch, ArrowTableBatch } from './category/table/table-types';
|
|
5
5
|
export { default as TableBatchBuilder } from './lib/batches/table-batch-builder';
|
|
6
6
|
export type { TableBatchAggregator } from './lib/batches/table-batch-aggregator';
|
|
@@ -11,6 +11,8 @@ export type { MeshTable, MeshArrowTable, Mesh, MeshGeometry, MeshAttribute, Mesh
|
|
|
11
11
|
export { getMeshSize, getMeshBoundingBox } from './category/mesh/mesh-utils';
|
|
12
12
|
export { convertMesh } from './category/mesh/convert-mesh';
|
|
13
13
|
export { deduceMeshSchema, deduceMeshField, makeMeshAttributeMetadata } from './category/mesh/deduce-mesh-schema';
|
|
14
|
+
export type { TextureLevel, GPUTextureFormat } from './category/texture/texture';
|
|
15
|
+
export type { ImageDataType, ImageType, ImageTypeEnum } from './category/image/image';
|
|
14
16
|
export type { GeoJSON, Feature, Geometry, Position, GeoJsonProperties } from './category/gis';
|
|
15
17
|
export type { Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection } from './category/gis';
|
|
16
18
|
export type { GeojsonGeometryInfo } from './category/gis';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE/D,YAAY,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE/D,YAAY,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAG7C,YAAY,EACV,KAAK,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACV,MAAM,EACP,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EAChB,MAAM,8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ACnB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,MAAM,EACN,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,eAAe,EACf,IAAI,EACJ,eAAe,EACf,UAAU,EACV,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,MAAM,EACP,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,uCAAuC,CAAC;AAChG,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAC,0BAA0B,EAAC,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
import type { TypedArray } from '../../types';
|
|
2
|
+
import { DataType } from 'apache-arrow/Arrow.dom';
|
|
3
|
+
import { AbstractVector } from 'apache-arrow/vector';
|
|
4
|
+
export declare function getArrowType(array: TypedArray): DataType;
|
|
5
|
+
export declare function getArrowVector(array: TypedArray): AbstractVector;
|
|
1
6
|
//# sourceMappingURL=arrow-type-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-type-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/arrow/arrow-type-utils.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"arrow-type-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/arrow/arrow-type-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,QAAQ,EAiBT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEnD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAqBxD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,CAqBhE"}
|
|
@@ -1,70 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
switch (array.constructor) {
|
|
27
|
-
case Int8Array:
|
|
28
|
-
return new Int8();
|
|
29
|
-
case Uint8Array:
|
|
30
|
-
return new Uint8();
|
|
31
|
-
case Int16Array:
|
|
32
|
-
return new Int16();
|
|
33
|
-
case Uint16Array:
|
|
34
|
-
return new Uint16();
|
|
35
|
-
case Int32Array:
|
|
36
|
-
return new Int32();
|
|
37
|
-
case Uint32Array:
|
|
38
|
-
return new Uint32();
|
|
39
|
-
case Float32Array:
|
|
40
|
-
return new Float32();
|
|
41
|
-
case Float64Array:
|
|
42
|
-
return new Float64();
|
|
43
|
-
default:
|
|
44
|
-
throw new Error('array type not supported');
|
|
45
|
-
}
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getArrowVector = exports.getArrowType = void 0;
|
|
4
|
+
const Arrow_dom_1 = require("apache-arrow/Arrow.dom");
|
|
5
|
+
function getArrowType(array) {
|
|
6
|
+
switch (array.constructor) {
|
|
7
|
+
case Int8Array:
|
|
8
|
+
return new Arrow_dom_1.Int8();
|
|
9
|
+
case Uint8Array:
|
|
10
|
+
return new Arrow_dom_1.Uint8();
|
|
11
|
+
case Int16Array:
|
|
12
|
+
return new Arrow_dom_1.Int16();
|
|
13
|
+
case Uint16Array:
|
|
14
|
+
return new Arrow_dom_1.Uint16();
|
|
15
|
+
case Int32Array:
|
|
16
|
+
return new Arrow_dom_1.Int32();
|
|
17
|
+
case Uint32Array:
|
|
18
|
+
return new Arrow_dom_1.Uint32();
|
|
19
|
+
case Float32Array:
|
|
20
|
+
return new Arrow_dom_1.Float32();
|
|
21
|
+
case Float64Array:
|
|
22
|
+
return new Arrow_dom_1.Float64();
|
|
23
|
+
default:
|
|
24
|
+
throw new Error('array type not supported');
|
|
25
|
+
}
|
|
46
26
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
27
|
+
exports.getArrowType = getArrowType;
|
|
28
|
+
function getArrowVector(array) {
|
|
29
|
+
switch (array.constructor) {
|
|
30
|
+
case Int8Array:
|
|
31
|
+
return Arrow_dom_1.Int8Vector.from(array);
|
|
32
|
+
case Uint8Array:
|
|
33
|
+
return Arrow_dom_1.Uint8Vector.from(array);
|
|
34
|
+
case Int16Array:
|
|
35
|
+
return Arrow_dom_1.Int16Vector.from(array);
|
|
36
|
+
case Uint16Array:
|
|
37
|
+
return Arrow_dom_1.Uint16Vector.from(array);
|
|
38
|
+
case Int32Array:
|
|
39
|
+
return Arrow_dom_1.Int32Vector.from(array);
|
|
40
|
+
case Uint32Array:
|
|
41
|
+
return Arrow_dom_1.Uint32Vector.from(array);
|
|
42
|
+
case Float32Array:
|
|
43
|
+
return Arrow_dom_1.Float32Vector.from(array);
|
|
44
|
+
case Float64Array:
|
|
45
|
+
return Arrow_dom_1.Float64Vector.from(array);
|
|
46
|
+
default:
|
|
47
|
+
throw new Error('array type not supported');
|
|
48
|
+
}
|
|
69
49
|
}
|
|
70
|
-
|
|
50
|
+
exports.getArrowVector = getArrowVector;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/schema",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.0-alpha.1",
|
|
4
4
|
"description": "Table format APIs for JSON, CSV, etc...",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@types/geojson": "^7946.0.7"
|
|
35
|
+
"@types/geojson": "^7946.0.7",
|
|
36
|
+
"apache-arrow": "^4.0.0"
|
|
36
37
|
},
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "423a2815092b08dcf93ad5b7dc2940b167305afe"
|
|
38
39
|
}
|
package/src/category/common.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* data images
|
|
3
|
+
*/
|
|
4
|
+
export type ImageDataType = {
|
|
5
|
+
data: Uint8Array;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
compressed?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Supported Image Types
|
|
13
|
+
*/
|
|
14
|
+
export type ImageType = ImageBitmap | typeof Image | ImageDataType;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Image type string used to control or determine the type of images returned from ImageLoader
|
|
18
|
+
*/
|
|
19
|
+
export type ImageTypeEnum = 'imagebitmap' | 'image' | 'data';
|