@loaders.gl/schema 3.1.0-alpha.2 → 3.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +16157 -5
- package/dist/category/common.d.ts +19 -0
- package/dist/category/common.d.ts.map +1 -0
- package/dist/category/common.js +10 -2
- package/dist/category/gis.d.ts +50 -0
- package/dist/category/gis.d.ts.map +1 -0
- package/dist/category/gis.js +2 -2
- package/dist/category/mesh/convert-mesh.d.ts +15 -0
- package/dist/category/mesh/convert-mesh.d.ts.map +1 -0
- package/dist/category/mesh/convert-mesh.js +38 -31
- package/dist/category/mesh/deduce-mesh-schema.d.ts +24 -0
- package/dist/category/mesh/deduce-mesh-schema.d.ts.map +1 -0
- package/dist/category/mesh/deduce-mesh-schema.js +57 -37
- package/dist/category/mesh/mesh-to-arrow-table.d.ts +11 -0
- package/dist/category/mesh/mesh-to-arrow-table.d.ts.map +1 -0
- package/dist/category/mesh/mesh-to-arrow-table.js +33 -30
- package/dist/category/mesh/mesh-types.d.ts +50 -0
- package/dist/category/mesh/mesh-types.d.ts.map +1 -0
- package/dist/category/mesh/mesh-types.js +2 -2
- package/dist/category/mesh/mesh-utils.d.ts +23 -0
- package/dist/category/mesh/mesh-utils.d.ts.map +1 -0
- package/dist/category/mesh/mesh-utils.js +48 -35
- package/dist/category/table/deduce-table-schema.d.ts +9 -0
- package/dist/category/table/deduce-table-schema.d.ts.map +1 -0
- package/dist/category/table/deduce-table-schema.js +94 -39
- package/dist/category/table/table-types.d.ts +76 -0
- package/dist/category/table/table-types.d.ts.map +1 -0
- package/dist/category/table/table-types.js +2 -2
- package/dist/es5/bundle.js +7 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/category/common.js +2 -0
- package/dist/{category → es5/category}/common.js.map +0 -0
- package/dist/es5/category/gis.js +2 -0
- package/dist/{category → es5/category}/gis.js.map +0 -0
- package/dist/es5/category/mesh/convert-mesh.js +43 -0
- package/dist/{category → es5/category}/mesh/convert-mesh.js.map +1 -1
- package/dist/es5/category/mesh/deduce-mesh-schema.js +54 -0
- package/dist/es5/category/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/es5/category/mesh/mesh-to-arrow-table.js +41 -0
- package/dist/es5/category/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/es5/category/mesh/mesh-types.js +2 -0
- package/dist/{category → es5/category}/mesh/mesh-types.js.map +0 -0
- package/dist/es5/category/mesh/mesh-utils.js +47 -0
- package/dist/es5/category/mesh/mesh-utils.js.map +1 -0
- package/dist/es5/category/table/deduce-table-schema.js +58 -0
- package/dist/es5/category/table/deduce-table-schema.js.map +1 -0
- package/dist/es5/category/table/table-types.js +2 -0
- package/dist/{category → es5/category}/table/table-types.js.map +0 -0
- package/dist/es5/index.js +344 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/lib/arrow/arrow-like-type-utils.js +40 -0
- package/dist/es5/lib/arrow/arrow-like-type-utils.js.map +1 -0
- package/dist/es5/lib/arrow/arrow-type-utils.js +72 -0
- package/dist/es5/lib/arrow/arrow-type-utils.js.map +1 -0
- package/dist/es5/lib/arrow/get-type-info.js +33 -0
- package/dist/es5/lib/arrow/get-type-info.js.map +1 -0
- package/dist/es5/lib/batches/base-table-batch-aggregator.js +81 -0
- package/dist/es5/lib/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js +109 -0
- package/dist/es5/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/row-table-batch-aggregator.js +102 -0
- package/dist/es5/lib/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/batches/table-batch-aggregator.js +2 -0
- package/dist/{lib → es5/lib}/batches/table-batch-aggregator.js.map +0 -0
- package/dist/es5/lib/batches/table-batch-builder.js +187 -0
- package/dist/es5/lib/batches/table-batch-builder.js.map +1 -0
- package/dist/es5/lib/schema/impl/enum.js +56 -0
- package/dist/es5/lib/schema/impl/enum.js.map +1 -0
- package/dist/es5/lib/schema/impl/field.js +43 -0
- package/dist/es5/lib/schema/impl/field.js.map +1 -0
- package/dist/es5/lib/schema/impl/schema.js +103 -0
- package/dist/es5/lib/schema/impl/schema.js.map +1 -0
- package/dist/es5/lib/schema/impl/type.js +594 -0
- package/dist/es5/lib/schema/impl/type.js.map +1 -0
- package/dist/es5/lib/schema/schema.js +236 -0
- package/dist/es5/lib/schema/schema.js.map +1 -0
- package/dist/es5/lib/schema-utils/deduce-column-type.js +32 -0
- package/dist/es5/lib/schema-utils/deduce-column-type.js.map +1 -0
- package/dist/es5/lib/utils/assert.js +13 -0
- package/dist/es5/lib/utils/assert.js.map +1 -0
- package/dist/es5/lib/utils/async-queue.js +130 -0
- package/dist/es5/lib/utils/async-queue.js.map +1 -0
- package/dist/es5/lib/utils/row-utils.js +44 -0
- package/dist/es5/lib/utils/row-utils.js.map +1 -0
- package/dist/es5/types.js +2 -0
- package/dist/{types.js.map → es5/types.js.map} +0 -0
- package/dist/esm/bundle.js +5 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/category/common.js +2 -0
- package/dist/esm/category/common.js.map +1 -0
- package/dist/esm/category/gis.js +2 -0
- package/dist/esm/category/gis.js.map +1 -0
- package/dist/esm/category/mesh/convert-mesh.js +33 -0
- package/dist/esm/category/mesh/convert-mesh.js.map +1 -0
- package/dist/esm/category/mesh/deduce-mesh-schema.js +42 -0
- package/dist/esm/category/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/esm/category/mesh/mesh-to-arrow-table.js +31 -0
- package/dist/esm/category/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/esm/category/mesh/mesh-types.js +2 -0
- package/dist/esm/category/mesh/mesh-types.js.map +1 -0
- package/dist/esm/category/mesh/mesh-utils.js +38 -0
- package/dist/esm/category/mesh/mesh-utils.js.map +1 -0
- package/dist/esm/category/table/deduce-table-schema.js +51 -0
- package/dist/esm/category/table/deduce-table-schema.js.map +1 -0
- package/dist/esm/category/table/table-types.js +2 -0
- package/dist/esm/category/table/table-types.js.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/arrow/arrow-like-type-utils.js +32 -0
- package/dist/esm/lib/arrow/arrow-like-type-utils.js.map +1 -0
- package/dist/esm/lib/arrow/arrow-type-utils.js +62 -0
- package/dist/esm/lib/arrow/arrow-type-utils.js.map +1 -0
- package/dist/esm/lib/arrow/get-type-info.js +24 -0
- package/dist/esm/lib/arrow/get-type-info.js.map +1 -0
- package/dist/esm/lib/batches/base-table-batch-aggregator.js +74 -0
- package/dist/esm/lib/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js +100 -0
- package/dist/esm/lib/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/row-table-batch-aggregator.js +95 -0
- package/dist/esm/lib/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/table-batch-aggregator.js +2 -0
- package/dist/esm/lib/batches/table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/batches/table-batch-builder.js +182 -0
- package/dist/esm/lib/batches/table-batch-builder.js.map +1 -0
- package/dist/esm/lib/schema/impl/enum.js +49 -0
- package/dist/esm/lib/schema/impl/enum.js.map +1 -0
- package/dist/esm/lib/schema/impl/field.js +35 -0
- package/dist/esm/lib/schema/impl/field.js.map +1 -0
- package/dist/esm/lib/schema/impl/schema.js +92 -0
- package/dist/esm/lib/schema/impl/schema.js.map +1 -0
- package/dist/esm/lib/schema/impl/type.js +498 -0
- package/dist/esm/lib/schema/impl/type.js.map +1 -0
- package/dist/{lib/schema/index.js → esm/lib/schema/schema.js} +1 -1
- package/dist/esm/lib/schema/schema.js.map +1 -0
- package/dist/esm/lib/schema-utils/deduce-column-type.js +23 -0
- package/dist/esm/lib/schema-utils/deduce-column-type.js.map +1 -0
- package/dist/esm/lib/utils/assert.js +6 -0
- package/dist/esm/lib/utils/assert.js.map +1 -0
- package/dist/esm/lib/utils/async-queue.js +119 -0
- package/dist/esm/lib/utils/async-queue.js.map +1 -0
- package/dist/esm/lib/utils/row-utils.js +35 -0
- package/dist/esm/lib/utils/row-utils.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -13
- package/dist/lib/arrow/arrow-like-type-utils.d.ts +4 -0
- package/dist/lib/arrow/arrow-like-type-utils.d.ts.map +1 -0
- package/dist/lib/arrow/arrow-like-type-utils.js +26 -31
- package/dist/lib/arrow/arrow-type-utils.d.ts +6 -0
- package/dist/lib/arrow/arrow-type-utils.d.ts.map +1 -0
- package/dist/lib/arrow/arrow-type-utils.js +48 -60
- package/dist/lib/arrow/get-type-info.d.ts +14 -0
- package/dist/lib/arrow/get-type-info.d.ts.map +1 -0
- package/dist/lib/arrow/get-type-info.js +23 -19
- package/dist/lib/batches/base-table-batch-aggregator.d.ts +19 -0
- package/dist/lib/batches/base-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/base-table-batch-aggregator.js +52 -68
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts +23 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/columnar-table-batch-aggregator.js +82 -92
- package/dist/lib/batches/row-table-batch-aggregator.d.ts +22 -0
- package/dist/lib/batches/row-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/row-table-batch-aggregator.js +72 -88
- package/dist/lib/batches/table-batch-aggregator.d.ts +25 -0
- package/dist/lib/batches/table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/batches/table-batch-aggregator.js +2 -2
- package/dist/lib/batches/table-batch-builder.d.ts +53 -0
- package/dist/lib/batches/table-batch-builder.d.ts.map +1 -0
- package/dist/lib/batches/table-batch-builder.js +137 -166
- package/dist/lib/schema/impl/enum.d.ts +92 -0
- package/dist/lib/schema/impl/enum.d.ts.map +1 -0
- package/dist/lib/schema/impl/enum.js +96 -48
- package/dist/lib/schema/impl/field.d.ts +19 -0
- package/dist/lib/schema/impl/field.d.ts.map +1 -0
- package/dist/lib/schema/impl/field.js +31 -34
- package/dist/lib/schema/impl/schema.d.ts +16 -0
- package/dist/lib/schema/impl/schema.d.ts.map +1 -0
- package/dist/lib/schema/impl/schema.js +72 -81
- package/dist/lib/schema/impl/type.d.ts +176 -0
- package/dist/lib/schema/impl/type.d.ts.map +1 -0
- package/dist/lib/schema/impl/type.js +454 -490
- package/dist/lib/schema/schema.d.ts +5 -0
- package/dist/lib/schema/schema.d.ts.map +1 -0
- package/dist/lib/schema/schema.js +90 -0
- package/dist/lib/schema-utils/deduce-column-type.d.ts +3 -0
- package/dist/lib/schema-utils/deduce-column-type.d.ts.map +1 -0
- package/dist/lib/schema-utils/deduce-column-type.js +89 -20
- package/dist/lib/utils/assert.d.ts +2 -0
- package/dist/lib/utils/assert.d.ts.map +1 -0
- package/dist/lib/utils/assert.js +11 -5
- package/dist/lib/utils/async-queue.d.ts +18 -0
- package/dist/lib/utils/async-queue.d.ts.map +1 -0
- package/dist/lib/utils/async-queue.js +82 -109
- package/dist/lib/utils/row-utils.d.ts +9 -0
- package/dist/lib/utils/row-utils.d.ts.map +1 -0
- package/dist/lib/utils/row-utils.js +31 -33
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -2
- package/package.json +7 -8
- package/src/bundle.ts +2 -3
- package/src/category/mesh/deduce-mesh-schema.ts +1 -1
- package/src/category/mesh/mesh-to-arrow-table.ts +1 -1
- package/src/category/mesh/mesh-types.ts +1 -1
- package/src/category/table/deduce-table-schema.ts +1 -1
- package/src/category/table/table-types.ts +2 -2
- package/src/index.ts +1 -1
- package/src/lib/arrow/arrow-like-type-utils.ts +11 -1
- package/src/lib/arrow/arrow-type-utils.ts +1 -1
- package/src/lib/arrow/get-type-info.ts +1 -1
- package/src/lib/batches/base-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/columnar-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/row-table-batch-aggregator.ts +1 -1
- package/src/lib/batches/table-batch-aggregator.ts +1 -1
- package/src/lib/batches/table-batch-builder.ts +2 -2
- package/src/lib/schema/impl/schema.ts +2 -2
- package/src/lib/schema/impl/type.ts +2 -2
- package/src/lib/schema/{index.ts → schema.ts} +0 -0
- package/src/lib/schema-utils/deduce-column-type.ts +6 -2
- package/src/lib/utils/async-queue.ts +7 -4
- package/dist/bundle.js.map +0 -1
- package/dist/category/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/category/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/category/mesh/mesh-utils.js.map +0 -1
- package/dist/category/table/deduce-table-schema.js.map +0 -1
- package/dist/dist.min.js +0 -2
- package/dist/dist.min.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/arrow/arrow-like-type-utils.js.map +0 -1
- package/dist/lib/arrow/arrow-type-utils.js.map +0 -1
- package/dist/lib/arrow/get-type-info.js.map +0 -1
- package/dist/lib/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/table-batch-builder.js.map +0 -1
- package/dist/lib/schema/impl/enum.js.map +0 -1
- package/dist/lib/schema/impl/field.js.map +0 -1
- package/dist/lib/schema/impl/schema.js.map +0 -1
- package/dist/lib/schema/impl/type.js.map +0 -1
- package/dist/lib/schema/index.js.map +0 -1
- package/dist/lib/schema-utils/deduce-column-type.js.map +0 -1
- package/dist/lib/utils/assert.js.map +0 -1
- package/dist/lib/utils/async-queue.js.map +0 -1
- package/dist/lib/utils/row-utils.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RecordBatch } from 'apache-arrow';
|
|
2
|
+
export declare type Field = any;
|
|
3
|
+
export declare type Schema = {
|
|
4
|
+
[key: string]: Field;
|
|
5
|
+
};
|
|
6
|
+
export declare type Batch = {
|
|
7
|
+
batchType: 'data' | 'metadata' | 'partial-result' | 'final-result';
|
|
8
|
+
mimeType?: string;
|
|
9
|
+
shape: string;
|
|
10
|
+
data: any;
|
|
11
|
+
recordBatch?: RecordBatch;
|
|
12
|
+
length: number;
|
|
13
|
+
schema?: Schema;
|
|
14
|
+
bytesUsed?: number;
|
|
15
|
+
count?: number;
|
|
16
|
+
cursor?: number;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/category/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C,oBAAY,KAAK,GAAG,GAAG,CAAC;AAExB,oBAAY,MAAM,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,gBAAgB,GAAG,cAAc,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;IACV,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC"}
|
package/dist/category/common.js
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { TypedArray } from '../types';
|
|
2
|
+
export type { GeoJSON, Feature, Geometry, Position, GeoJsonProperties } from 'geojson';
|
|
3
|
+
export type { Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon } from 'geojson';
|
|
4
|
+
export declare type BinaryAttribute = {
|
|
5
|
+
value: TypedArray;
|
|
6
|
+
size: number;
|
|
7
|
+
};
|
|
8
|
+
export declare type BinaryGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
9
|
+
declare type NumericProps = {
|
|
10
|
+
[key: string]: BinaryAttribute;
|
|
11
|
+
};
|
|
12
|
+
declare type Properties = object[];
|
|
13
|
+
/**
|
|
14
|
+
* Represent a single Geometry, similar to a GeoJSON Geometry
|
|
15
|
+
*/
|
|
16
|
+
export declare type BinaryGeometry = BinaryPointGeometry | BinaryLineGeometry | BinaryPolygonGeometry;
|
|
17
|
+
export declare type BinaryPointGeometry = {
|
|
18
|
+
type: 'Point';
|
|
19
|
+
positions: BinaryAttribute;
|
|
20
|
+
};
|
|
21
|
+
export declare type BinaryLineGeometry = {
|
|
22
|
+
type: 'LineString';
|
|
23
|
+
positions: BinaryAttribute;
|
|
24
|
+
pathIndices: BinaryAttribute;
|
|
25
|
+
};
|
|
26
|
+
export declare type BinaryPolygonGeometry = {
|
|
27
|
+
type: 'Polygon';
|
|
28
|
+
positions: BinaryAttribute;
|
|
29
|
+
polygonIndices: BinaryAttribute;
|
|
30
|
+
primitivePolygonIndices: BinaryAttribute;
|
|
31
|
+
};
|
|
32
|
+
export declare type BinaryProperties = {
|
|
33
|
+
featureIds: BinaryAttribute;
|
|
34
|
+
globalFeatureIds: BinaryAttribute;
|
|
35
|
+
numericProps: NumericProps;
|
|
36
|
+
properties: Properties;
|
|
37
|
+
fields?: Properties;
|
|
38
|
+
};
|
|
39
|
+
export declare type BinaryPointFeatures = BinaryPointGeometry & BinaryProperties;
|
|
40
|
+
export declare type BinaryLineFeatures = BinaryLineGeometry & BinaryProperties;
|
|
41
|
+
export declare type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;
|
|
42
|
+
/**
|
|
43
|
+
* Represent a collection of Features, similar to a GeoJSON FeatureCollection
|
|
44
|
+
*/
|
|
45
|
+
export declare type BinaryFeatures = {
|
|
46
|
+
points?: BinaryPointFeatures;
|
|
47
|
+
lines?: BinaryLineFeatures;
|
|
48
|
+
polygons?: BinaryPolygonFeatures;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=gis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gis.d.ts","sourceRoot":"","sources":["../../src/category/gis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAKzC,YAAY,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAErF,YAAY,EAAC,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAInG,oBAAY,eAAe,GAAG;IAAC,KAAK,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC;AAChE,oBAAY,kBAAkB,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAEpE,aAAK,YAAY,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAA;CAAC,CAAC;AACrD,aAAK,UAAU,GAAG,MAAM,EAAE,CAAC;AAE3B;;GAEG;AACH,oBAAY,cAAc,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAE9F,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,eAAe,CAAC;IAC3B,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,eAAe,CAAC;IAC3B,cAAc,EAAE,eAAe,CAAC;IAChC,uBAAuB,EAAE,eAAe,CAAC;CAC1C,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,gBAAgB,EAAE,eAAe,CAAC;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AACzE,oBAAY,kBAAkB,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;AACvE,oBAAY,qBAAqB,GAAG,qBAAqB,GAAG,gBAAgB,CAAC;AAE7E;;GAEG;AACH,oBAAY,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC,CAAC"}
|
package/dist/category/gis.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Mesh } from './mesh-types';
|
|
2
|
+
import type { ColumnarTable, ArrowTable } from '../table/table-types';
|
|
3
|
+
declare 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-mesh.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/convert-mesh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAGpE,aAAK,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,33 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertMeshToColumnarTable = exports.convertMesh = void 0;
|
|
4
|
+
const mesh_to_arrow_table_1 = require("./mesh-to-arrow-table");
|
|
5
|
+
/**
|
|
6
|
+
* Convert a mesh to a specific shape
|
|
7
|
+
*/
|
|
8
|
+
function convertMesh(mesh, shape, options) {
|
|
9
|
+
switch (shape || 'mesh') {
|
|
10
|
+
case 'mesh':
|
|
11
|
+
return mesh;
|
|
12
|
+
case 'columnar-table':
|
|
13
|
+
return convertMeshToColumnarTable(mesh);
|
|
14
|
+
case 'arrow-table':
|
|
15
|
+
return {
|
|
16
|
+
shape: 'arrow-table',
|
|
17
|
+
data: (0, mesh_to_arrow_table_1.convertMeshToArrowTable)(mesh)
|
|
18
|
+
};
|
|
19
|
+
default:
|
|
20
|
+
throw new Error(`Unsupported shape ${options?.shape}`);
|
|
21
|
+
}
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
exports.convertMesh = convertMesh;
|
|
24
|
+
/**
|
|
25
|
+
* Convert a loaders.gl Mesh to a Columnar Table
|
|
26
|
+
* @param mesh
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
function convertMeshToColumnarTable(mesh) {
|
|
30
|
+
const columns = {};
|
|
31
|
+
for (const [columnName, attribute] of Object.entries(mesh.attributes)) {
|
|
32
|
+
columns[columnName] = attribute.value;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
shape: 'columnar-table',
|
|
36
|
+
schema: mesh.schema,
|
|
37
|
+
data: columns
|
|
38
|
+
};
|
|
32
39
|
}
|
|
33
|
-
|
|
40
|
+
exports.convertMeshToColumnarTable = convertMeshToColumnarTable;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MeshAttribute, MeshAttributes } from './mesh-types';
|
|
2
|
+
import { Schema, Field } from '../../lib/schema/schema';
|
|
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?: Map<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(attributeName: string, attribute: MeshAttribute, optionalMetadata?: Map<string, string>): Field;
|
|
18
|
+
/**
|
|
19
|
+
* Make metadata by mesh attribute properties
|
|
20
|
+
* @param attribute
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare function makeMeshAttributeMetadata(attribute: MeshAttribute): Map<string, string>;
|
|
24
|
+
//# sourceMappingURL=deduce-mesh-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduce-mesh-schema.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/deduce-mesh-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAE,KAAK,EAAgB,MAAM,yBAAyB,CAAC;AAGrE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,cAAc,EAC1B,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAGR;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,aAAa,EACxB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,KAAK,CAUP;AAgBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAYvF"}
|
|
@@ -1,42 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMeshAttributeMetadata = exports.deduceMeshField = exports.deduceMeshSchema = void 0;
|
|
4
|
+
const schema_1 = require("../../lib/schema/schema");
|
|
5
|
+
const arrow_like_type_utils_1 = require("../../lib/arrow/arrow-like-type-utils");
|
|
6
|
+
/**
|
|
7
|
+
* Create a schema for mesh attributes data
|
|
8
|
+
* @param attributes
|
|
9
|
+
* @param metadata
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
function deduceMeshSchema(attributes, metadata) {
|
|
13
|
+
const fields = deduceMeshFields(attributes);
|
|
14
|
+
return new schema_1.Schema(fields, metadata);
|
|
6
15
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
exports.deduceMeshSchema = deduceMeshSchema;
|
|
17
|
+
/**
|
|
18
|
+
* Create arrow-like schema field for mesh attribute
|
|
19
|
+
* @param attributeName
|
|
20
|
+
* @param attribute
|
|
21
|
+
* @param optionalMetadata
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
function deduceMeshField(attributeName, attribute, optionalMetadata) {
|
|
25
|
+
const type = (0, arrow_like_type_utils_1.getArrowTypeFromTypedArray)(attribute.value);
|
|
26
|
+
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
27
|
+
const field = new schema_1.Field(attributeName, new schema_1.FixedSizeList(attribute.size, new schema_1.Field('value', type)), false, metadata);
|
|
28
|
+
return field;
|
|
12
29
|
}
|
|
13
|
-
|
|
30
|
+
exports.deduceMeshField = deduceMeshField;
|
|
31
|
+
/**
|
|
32
|
+
* Create fields array for mesh attributes
|
|
33
|
+
* @param attributes
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
14
36
|
function deduceMeshFields(attributes) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return fields;
|
|
37
|
+
const fields = [];
|
|
38
|
+
for (const attributeName in attributes) {
|
|
39
|
+
const attribute = attributes[attributeName];
|
|
40
|
+
fields.push(deduceMeshField(attributeName, attribute));
|
|
41
|
+
}
|
|
42
|
+
return fields;
|
|
23
43
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Make metadata by mesh attribute properties
|
|
46
|
+
* @param attribute
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
function makeMeshAttributeMetadata(attribute) {
|
|
50
|
+
const result = new Map();
|
|
51
|
+
if ('byteOffset' in attribute) {
|
|
52
|
+
result.set('byteOffset', attribute.byteOffset.toString(10));
|
|
53
|
+
}
|
|
54
|
+
if ('byteStride' in attribute) {
|
|
55
|
+
result.set('byteStride', attribute.byteStride.toString(10));
|
|
56
|
+
}
|
|
57
|
+
if ('normalized' in attribute) {
|
|
58
|
+
result.set('normalized', attribute.normalized.toString());
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
41
61
|
}
|
|
42
|
-
|
|
62
|
+
exports.makeMeshAttributeMetadata = makeMeshAttributeMetadata;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Table } from 'apache-arrow/Arrow.dom';
|
|
2
|
+
import type { Mesh } from './mesh-types';
|
|
3
|
+
/**
|
|
4
|
+
* * Convert a loaders.gl Mesh to an Apache Arrow Table
|
|
5
|
+
* @param mesh
|
|
6
|
+
* @param metadata
|
|
7
|
+
* @param batchSize
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function convertMeshToArrowTable(mesh: Mesh, batchSize?: number): Table;
|
|
11
|
+
//# sourceMappingURL=mesh-to-arrow-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-to-arrow-table.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/mesh-to-arrow-table.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAON,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAGvC;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAmB7E"}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertMeshToArrowTable = void 0;
|
|
4
|
+
const Arrow_dom_1 = require("apache-arrow/Arrow.dom");
|
|
5
|
+
const arrow_type_utils_1 = require("../../lib/arrow/arrow-type-utils");
|
|
6
|
+
const deduce_mesh_schema_1 = require("./deduce-mesh-schema");
|
|
7
|
+
/**
|
|
8
|
+
* * Convert a loaders.gl Mesh to an Apache Arrow Table
|
|
9
|
+
* @param mesh
|
|
10
|
+
* @param metadata
|
|
11
|
+
* @param batchSize
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
function convertMeshToArrowTable(mesh, batchSize) {
|
|
15
|
+
const vectors = [];
|
|
16
|
+
const fields = [];
|
|
17
|
+
for (const attributeKey in mesh.attributes) {
|
|
18
|
+
const attribute = mesh.attributes[attributeKey];
|
|
19
|
+
const { value, size = 1 } = attribute;
|
|
20
|
+
const type = (0, arrow_type_utils_1.getArrowType)(value);
|
|
21
|
+
const vector = (0, arrow_type_utils_1.getArrowVector)(value);
|
|
22
|
+
const listType = new Arrow_dom_1.FixedSizeList(size, new Arrow_dom_1.Field('value', type));
|
|
23
|
+
const field = new Arrow_dom_1.Field(attributeKey, listType, false, (0, deduce_mesh_schema_1.makeMeshAttributeMetadata)(attribute));
|
|
24
|
+
const data = new Arrow_dom_1.Data(listType, 0, value.length / size, 0, undefined, [vector]);
|
|
25
|
+
const listVector = new Arrow_dom_1.FixedSizeListVector(data);
|
|
26
|
+
vectors.push(listVector);
|
|
27
|
+
fields.push(field);
|
|
28
|
+
}
|
|
29
|
+
const schema = new Arrow_dom_1.Schema(fields, mesh?.schema?.metadata || new Map());
|
|
30
|
+
const recordBatch = new Arrow_dom_1.RecordBatch(schema, vectors[0].length, vectors);
|
|
31
|
+
const table = new Arrow_dom_1.Table(schema, recordBatch);
|
|
32
|
+
return table;
|
|
30
33
|
}
|
|
31
|
-
|
|
34
|
+
exports.convertMeshToArrowTable = convertMeshToArrowTable;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Schema } from '../../lib/schema/schema';
|
|
2
|
+
import type { TypedArray } from '../../types';
|
|
3
|
+
import type { ColumnarTable, ArrowTable } from '../table/table-types';
|
|
4
|
+
/** Mesh as columnar table */
|
|
5
|
+
export interface MeshTable extends ColumnarTable {
|
|
6
|
+
topology: 'point-list' | 'triangle-list' | 'triangle-strip';
|
|
7
|
+
indices?: MeshAttribute;
|
|
8
|
+
}
|
|
9
|
+
/** Mesh as arrow table */
|
|
10
|
+
export interface MeshArrowTable extends ArrowTable {
|
|
11
|
+
topology: 'point-list' | 'triangle-list' | 'triangle-strip';
|
|
12
|
+
indices?: MeshAttribute;
|
|
13
|
+
}
|
|
14
|
+
/** Geometry part of a Mesh (compatible with a standard luma.gl "mesh") */
|
|
15
|
+
export declare type MeshGeometry = {
|
|
16
|
+
attributes: {
|
|
17
|
+
[attributeName: string]: MeshAttribute;
|
|
18
|
+
};
|
|
19
|
+
indices?: MeshAttribute;
|
|
20
|
+
topology: 'point-list' | 'triangle-list' | 'triangle-strip';
|
|
21
|
+
mode: number;
|
|
22
|
+
};
|
|
23
|
+
/** Geometry and metadata for a Mesh (compatible with a standard luma.gl "mesh") */
|
|
24
|
+
export declare type Mesh = MeshGeometry & {
|
|
25
|
+
loader?: string;
|
|
26
|
+
loaderData?: {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
};
|
|
29
|
+
header?: {
|
|
30
|
+
vertexCount: number;
|
|
31
|
+
boundingBox?: [number[], number[]];
|
|
32
|
+
};
|
|
33
|
+
schema: Schema;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* luma.gl compatible attribute descriptors
|
|
37
|
+
* Can be mapped to any WebGL framework
|
|
38
|
+
*/
|
|
39
|
+
export declare type MeshAttribute = {
|
|
40
|
+
value: TypedArray;
|
|
41
|
+
size: number;
|
|
42
|
+
byteOffset?: number;
|
|
43
|
+
byteStride?: number;
|
|
44
|
+
normalized?: boolean;
|
|
45
|
+
};
|
|
46
|
+
/** A map of mesh attributes keyed by attribute names */
|
|
47
|
+
export declare type MeshAttributes = {
|
|
48
|
+
[attributeName: string]: MeshAttribute;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=mesh-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-types.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/mesh-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEpE,6BAA6B;AAC7B,MAAM,WAAW,SAAU,SAAQ,aAAa;IAE9C,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,0BAA0B;AAC1B,MAAM,WAAW,cAAe,SAAQ,UAAU;IAEhD,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,0EAA0E;AAC1E,oBAAY,YAAY,GAAG;IACzB,UAAU,EAAE;QAAC,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAA;KAAC,CAAC;IACrD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,mFAAmF;AACnF,oBAAY,IAAI,GAAG,YAAY,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,CAAC;IAClC,MAAM,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;KACpC,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,oBAAY,aAAa,GAAG;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wDAAwD;AACxD,oBAAY,cAAc,GAAG;IAAC,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAAA;CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TypedArray } from '../../types';
|
|
2
|
+
import { MeshAttributes } from './mesh-types';
|
|
3
|
+
declare type TypedArrays = {
|
|
4
|
+
[key: string]: TypedArray;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Holds an axis aligned bounding box
|
|
8
|
+
* TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)
|
|
9
|
+
*/
|
|
10
|
+
declare type BoundingBox = [[number, number, number], [number, number, number]];
|
|
11
|
+
/**
|
|
12
|
+
* Get number of vertices in mesh
|
|
13
|
+
* @param attributes
|
|
14
|
+
*/
|
|
15
|
+
export declare function getMeshSize(attributes: TypedArrays): number;
|
|
16
|
+
/**
|
|
17
|
+
* Get the (axis aligned) bounding box of a mesh
|
|
18
|
+
* @param attributes
|
|
19
|
+
* @returns array of two vectors representing the axis aligned bounding box
|
|
20
|
+
*/
|
|
21
|
+
export declare function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=mesh-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-utils.d.ts","sourceRoot":"","sources":["../../../src/category/mesh/mesh-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5C,aAAK,WAAW,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAC,CAAC;AAE/C;;;GAGG;AACH,aAAK,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,38 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMeshBoundingBox = exports.getMeshSize = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get number of vertices in mesh
|
|
6
|
+
* @param attributes
|
|
7
|
+
*/
|
|
8
|
+
function getMeshSize(attributes) {
|
|
9
|
+
let size = 0;
|
|
10
|
+
for (const attributeName in attributes) {
|
|
11
|
+
const attribute = attributes[attributeName];
|
|
12
|
+
if (ArrayBuffer.isView(attribute)) {
|
|
13
|
+
// @ts-ignore DataView doesn't have BYTES_PER_ELEMENT
|
|
14
|
+
size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;
|
|
15
|
+
}
|
|
9
16
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return size;
|
|
17
|
+
return size;
|
|
13
18
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
exports.getMeshSize = getMeshSize;
|
|
20
|
+
/**
|
|
21
|
+
* Get the (axis aligned) bounding box of a mesh
|
|
22
|
+
* @param attributes
|
|
23
|
+
* @returns array of two vectors representing the axis aligned bounding box
|
|
24
|
+
*/
|
|
25
|
+
// eslint-disable-next-line complexity
|
|
26
|
+
function getMeshBoundingBox(attributes) {
|
|
27
|
+
let minX = Infinity;
|
|
28
|
+
let minY = Infinity;
|
|
29
|
+
let minZ = Infinity;
|
|
30
|
+
let maxX = -Infinity;
|
|
31
|
+
let maxY = -Infinity;
|
|
32
|
+
let maxZ = -Infinity;
|
|
33
|
+
const positions = attributes.POSITION ? attributes.POSITION.value : [];
|
|
34
|
+
const len = positions && positions.length;
|
|
35
|
+
for (let i = 0; i < len; i += 3) {
|
|
36
|
+
const x = positions[i];
|
|
37
|
+
const y = positions[i + 1];
|
|
38
|
+
const z = positions[i + 2];
|
|
39
|
+
minX = x < minX ? x : minX;
|
|
40
|
+
minY = y < minY ? y : minY;
|
|
41
|
+
minZ = z < minZ ? z : minZ;
|
|
42
|
+
maxX = x > maxX ? x : maxX;
|
|
43
|
+
maxY = y > maxY ? y : maxY;
|
|
44
|
+
maxZ = z > maxZ ? z : maxZ;
|
|
45
|
+
}
|
|
46
|
+
return [
|
|
47
|
+
[minX, minY, minZ],
|
|
48
|
+
[maxX, maxY, maxZ]
|
|
49
|
+
];
|
|
37
50
|
}
|
|
38
|
-
|
|
51
|
+
exports.getMeshBoundingBox = getMeshBoundingBox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Schema } from '../../lib/schema/schema';
|
|
2
|
+
/**
|
|
3
|
+
* SCHEMA SUPPORT - AUTODEDUCTION
|
|
4
|
+
* @param {*} table
|
|
5
|
+
* @param {*} schema
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function deduceTableSchema(table: any, schema?: Schema): Schema;
|
|
9
|
+
//# sourceMappingURL=deduce-table-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduce-table-schema.d.ts","sourceRoot":"","sources":["../../../src/category/table/deduce-table-schema.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EAcP,MAAM,yBAAyB,CAAC;AAmBjC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,KAAA,EAAE,MAAM,CAAC,EAAE,MAAM,UAMvD"}
|