@loaders.gl/i3s 3.3.0-alpha.1 → 3.3.0-alpha.10

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.
Files changed (124) hide show
  1. package/dist/dist.min.js +1215 -1478
  2. package/dist/es5/arcgis-webscene-loader.js +2 -8
  3. package/dist/es5/arcgis-webscene-loader.js.map +1 -1
  4. package/dist/es5/bundle.js +0 -1
  5. package/dist/es5/bundle.js.map +1 -1
  6. package/dist/es5/i3s-attribute-loader.js +19 -59
  7. package/dist/es5/i3s-attribute-loader.js.map +1 -1
  8. package/dist/es5/i3s-building-scene-layer-loader.js +1 -10
  9. package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
  10. package/dist/es5/i3s-content-loader.js +18 -18
  11. package/dist/es5/i3s-content-loader.js.map +1 -1
  12. package/dist/es5/i3s-loader.js +48 -80
  13. package/dist/es5/i3s-loader.js.map +1 -1
  14. package/dist/es5/i3s-node-page-loader.js +1 -12
  15. package/dist/es5/i3s-node-page-loader.js.map +1 -1
  16. package/dist/es5/index.js +12 -18
  17. package/dist/es5/index.js.map +1 -1
  18. package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +18 -78
  19. package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
  20. package/dist/es5/lib/parsers/constants.js +3 -19
  21. package/dist/es5/lib/parsers/constants.js.map +1 -1
  22. package/dist/es5/lib/parsers/parse-arcgis-webscene.js +128 -30
  23. package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -1
  24. package/dist/es5/lib/parsers/parse-i3s-attribute.js +1 -23
  25. package/dist/es5/lib/parsers/parse-i3s-attribute.js.map +1 -1
  26. package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js +8 -25
  27. package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -1
  28. package/dist/es5/lib/parsers/parse-i3s-tile-content.js +90 -199
  29. package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  30. package/dist/es5/lib/parsers/parse-i3s.js +6 -37
  31. package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
  32. package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js +0 -7
  33. package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
  34. package/dist/es5/lib/utils/customizeColors.js +164 -0
  35. package/dist/es5/lib/utils/customizeColors.js.map +1 -0
  36. package/dist/es5/lib/utils/url-utils.js +3 -8
  37. package/dist/es5/lib/utils/url-utils.js.map +1 -1
  38. package/dist/es5/types.js +0 -3
  39. package/dist/es5/types.js.map +1 -1
  40. package/dist/es5/workers/i3s-content-nodejs-worker.js +7 -0
  41. package/dist/es5/workers/i3s-content-nodejs-worker.js.map +1 -0
  42. package/dist/es5/workers/i3s-content-worker.js +0 -2
  43. package/dist/es5/workers/i3s-content-worker.js.map +1 -1
  44. package/dist/esm/arcgis-webscene-loader.js +3 -1
  45. package/dist/esm/arcgis-webscene-loader.js.map +1 -1
  46. package/dist/esm/bundle.js +1 -1
  47. package/dist/esm/bundle.js.map +1 -1
  48. package/dist/esm/i3s-attribute-loader.js +9 -26
  49. package/dist/esm/i3s-attribute-loader.js.map +1 -1
  50. package/dist/esm/i3s-building-scene-layer-loader.js +2 -3
  51. package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -1
  52. package/dist/esm/i3s-content-loader.js +13 -6
  53. package/dist/esm/i3s-content-loader.js.map +1 -1
  54. package/dist/esm/i3s-loader.js +16 -24
  55. package/dist/esm/i3s-loader.js.map +1 -1
  56. package/dist/esm/i3s-node-page-loader.js +1 -2
  57. package/dist/esm/i3s-node-page-loader.js.map +1 -1
  58. package/dist/esm/index.js.map +1 -1
  59. package/dist/esm/lib/helpers/i3s-nodepages-tiles.js +2 -45
  60. package/dist/esm/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
  61. package/dist/esm/lib/parsers/constants.js +2 -11
  62. package/dist/esm/lib/parsers/constants.js.map +1 -1
  63. package/dist/esm/lib/parsers/parse-arcgis-webscene.js +50 -11
  64. package/dist/esm/lib/parsers/parse-arcgis-webscene.js.map +1 -1
  65. package/dist/esm/lib/parsers/parse-i3s-attribute.js +1 -8
  66. package/dist/esm/lib/parsers/parse-i3s-attribute.js.map +1 -1
  67. package/dist/esm/lib/parsers/parse-i3s-building-scene-layer.js +1 -4
  68. package/dist/esm/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -1
  69. package/dist/esm/lib/parsers/parse-i3s-tile-content.js +60 -104
  70. package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  71. package/dist/esm/lib/parsers/parse-i3s.js +16 -18
  72. package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
  73. package/dist/esm/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -1
  74. package/dist/esm/lib/utils/customizeColors.js +96 -0
  75. package/dist/esm/lib/utils/customizeColors.js.map +1 -0
  76. package/dist/esm/lib/utils/url-utils.js +5 -5
  77. package/dist/esm/lib/utils/url-utils.js.map +1 -1
  78. package/dist/esm/types.js +0 -3
  79. package/dist/esm/types.js.map +1 -1
  80. package/dist/esm/workers/i3s-content-nodejs-worker.js +5 -0
  81. package/dist/esm/workers/i3s-content-nodejs-worker.js.map +1 -0
  82. package/dist/esm/workers/i3s-content-worker.js.map +1 -1
  83. package/dist/i3s-attribute-loader.d.ts +6 -0
  84. package/dist/i3s-attribute-loader.d.ts.map +1 -1
  85. package/dist/i3s-attribute-loader.js +2 -1
  86. package/dist/i3s-content-loader.d.ts.map +1 -1
  87. package/dist/i3s-content-loader.js +9 -4
  88. package/dist/i3s-content-nodejs-worker.js +201 -0
  89. package/dist/i3s-content-nodejs-worker.js.map +7 -0
  90. package/dist/i3s-content-worker.js +672 -1045
  91. package/dist/i3s-loader.d.ts +5 -0
  92. package/dist/i3s-loader.d.ts.map +1 -1
  93. package/dist/i3s-loader.js +12 -10
  94. package/dist/index.d.ts +1 -1
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/lib/parsers/constants.js +1 -1
  97. package/dist/lib/parsers/parse-arcgis-webscene.d.ts.map +1 -1
  98. package/dist/lib/parsers/parse-arcgis-webscene.js +49 -7
  99. package/dist/lib/parsers/parse-i3s-tile-content.d.ts +2 -2
  100. package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
  101. package/dist/lib/parsers/parse-i3s-tile-content.js +38 -33
  102. package/dist/lib/parsers/parse-i3s.d.ts +1 -1
  103. package/dist/lib/parsers/parse-i3s.d.ts.map +1 -1
  104. package/dist/lib/parsers/parse-i3s.js +1 -1
  105. package/dist/lib/utils/customizeColors.d.ts +14 -0
  106. package/dist/lib/utils/customizeColors.d.ts.map +1 -0
  107. package/dist/lib/utils/customizeColors.js +89 -0
  108. package/dist/types.d.ts +265 -85
  109. package/dist/types.d.ts.map +1 -1
  110. package/dist/workers/i3s-content-nodejs-worker.d.ts +2 -0
  111. package/dist/workers/i3s-content-nodejs-worker.d.ts.map +1 -0
  112. package/dist/workers/i3s-content-nodejs-worker.js +6 -0
  113. package/package.json +12 -12
  114. package/src/i3s-attribute-loader.ts +1 -1
  115. package/src/i3s-content-loader.ts +19 -6
  116. package/src/i3s-loader.ts +22 -13
  117. package/src/index.ts +8 -1
  118. package/src/lib/parsers/constants.ts +1 -1
  119. package/src/lib/parsers/parse-arcgis-webscene.ts +57 -7
  120. package/src/lib/parsers/parse-i3s-tile-content.ts +56 -43
  121. package/src/lib/parsers/parse-i3s.ts +1 -1
  122. package/src/lib/utils/customizeColors.ts +129 -0
  123. package/src/types.ts +198 -3
  124. package/src/workers/i3s-content-nodejs-worker.ts +5 -0
@@ -13,7 +13,7 @@ import {
13
13
  } from '../../types';
14
14
  import type {LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';
15
15
 
16
- export function normalizeTileData(tile : Node3DIndexDocument, options : LoaderOptions, context: LoaderContext): I3STileHeader {
16
+ export function normalizeTileData(tile : Node3DIndexDocument, context: LoaderContext): I3STileHeader {
17
17
  const url: string = context.url || '';
18
18
  let contentUrl: string | undefined;
19
19
  if (tile.geometryData) {
@@ -0,0 +1,129 @@
1
+ import type {MeshAttribute} from '@loaders.gl/schema';
2
+ import type {COLOR, I3STileOptions, I3STilesetOptions} from '../../types';
3
+
4
+ import {load} from '@loaders.gl/core';
5
+ import {getAttributeValueType, I3SAttributeLoader} from '../../i3s-attribute-loader';
6
+ import {I3SLoaderOptions} from '../../i3s-loader';
7
+ import {getUrlWithToken} from '../utils/url-utils';
8
+
9
+ /**
10
+ * Modify vertex colors array to visualize 3D objects in a attribute driven way
11
+ * @param colors - vertex colors attribute
12
+ * @param featureIds - feature Ids attribute
13
+ * @param tileOptions - tile - related options
14
+ * @param tilesetOptions - tileset-related options
15
+ * @param options - loader options
16
+ * @returns midified colors attribute
17
+ */
18
+ export async function customizeColors(
19
+ colors: MeshAttribute,
20
+ featureIds: MeshAttribute,
21
+ tileOptions: I3STileOptions,
22
+ tilesetOptions: I3STilesetOptions,
23
+ options?: I3SLoaderOptions
24
+ ): Promise<MeshAttribute> {
25
+ if (!options?.i3s?.colorsByAttribute) {
26
+ return colors;
27
+ }
28
+
29
+ const colorizeAttributeField = tilesetOptions.fields.find(
30
+ ({name}) => name === options?.i3s?.colorsByAttribute?.attributeName
31
+ );
32
+ if (
33
+ !colorizeAttributeField ||
34
+ !['esriFieldTypeDouble', 'esriFieldTypeInteger', 'esriFieldTypeSmallInteger'].includes(
35
+ colorizeAttributeField.type
36
+ )
37
+ ) {
38
+ return colors;
39
+ }
40
+
41
+ const colorizeAttributeData = await loadFeatureAttributeData(
42
+ colorizeAttributeField.name,
43
+ tileOptions,
44
+ tilesetOptions,
45
+ options
46
+ );
47
+ if (!colorizeAttributeData) {
48
+ return colors;
49
+ }
50
+
51
+ const objectIdField = tilesetOptions.fields.find(({type}) => type === 'esriFieldTypeOID');
52
+ if (!objectIdField) {
53
+ return colors;
54
+ }
55
+
56
+ const objectIdAttributeData = await loadFeatureAttributeData(
57
+ objectIdField.name,
58
+ tileOptions,
59
+ tilesetOptions,
60
+ options
61
+ );
62
+ if (!objectIdAttributeData) {
63
+ return colors;
64
+ }
65
+
66
+ const attributeValuesMap: {[key: number]: COLOR} = {};
67
+ for (let i = 0; i < objectIdAttributeData[objectIdField.name].length; i++) {
68
+ attributeValuesMap[objectIdAttributeData[objectIdField.name][i]] = calculateColorForAttribute(
69
+ colorizeAttributeData[colorizeAttributeField.name][i] as number,
70
+ options
71
+ );
72
+ }
73
+
74
+ for (let i = 0; i < featureIds.value.length; i++) {
75
+ const color = attributeValuesMap[featureIds.value[i]];
76
+ if (!color) {
77
+ continue; // eslint-disable-line no-continue
78
+ }
79
+ colors.value.set(color, i * 4);
80
+ }
81
+
82
+ return colors;
83
+ }
84
+
85
+ /**
86
+ * Calculate rgba color from the attribute value
87
+ * @param attributeValue - value of the attribute
88
+ * @param options - loader options
89
+ * @returns - color array for a specific attribute value
90
+ */
91
+ function calculateColorForAttribute(attributeValue: number, options?: I3SLoaderOptions): COLOR {
92
+ if (!options?.i3s?.colorsByAttribute) {
93
+ return [255, 255, 255, 255];
94
+ }
95
+ const {minValue, maxValue, minColor, maxColor} = options.i3s.colorsByAttribute;
96
+ const rate = (attributeValue - minValue) / (maxValue - minValue);
97
+ const color: COLOR = [255, 255, 255, 255];
98
+ for (let i = 0; i < minColor.length; i++) {
99
+ color[i] = Math.round((maxColor[i] - minColor[i]) * rate + minColor[i]);
100
+ }
101
+ return color;
102
+ }
103
+
104
+ /**
105
+ * Load feature attribute data from the ArcGIS rest service
106
+ * @param attributeName - attribute name
107
+ * @param tileOptions - tile-related options
108
+ * @param tilesetOptions - tileset-related options
109
+ * @param options - loader options
110
+ * @returns - Array-like list of the attribute values
111
+ */
112
+ async function loadFeatureAttributeData(
113
+ attributeName: string,
114
+ {attributeUrls}: I3STileOptions,
115
+ {attributeStorageInfo}: I3STilesetOptions,
116
+ options?: I3SLoaderOptions
117
+ ): Promise<{[key: string]: string[] | Uint32Array | Uint16Array | Float64Array} | null> {
118
+ const attributeIndex = attributeStorageInfo.findIndex(({name}) => attributeName === name);
119
+ if (attributeIndex === -1) {
120
+ return null;
121
+ }
122
+ const objectIdAttributeUrl = getUrlWithToken(attributeUrls[attributeIndex], options?.i3s?.token);
123
+ const attributeType = getAttributeValueType(attributeStorageInfo[attributeIndex]);
124
+ const objectIdAttributeData = await load(objectIdAttributeUrl, I3SAttributeLoader, {
125
+ attributeName,
126
+ attributeType
127
+ });
128
+ return objectIdAttributeData;
129
+ }
package/src/types.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type {Matrix4, Quaternion, Vector3} from '@math.gl/core';
2
2
  import type {TypedArray, MeshAttribute, TextureLevel} from '@loaders.gl/schema';
3
+ import {Tile3D, Tileset3D} from '@loaders.gl/tiles';
3
4
 
4
5
  export enum DATA_TYPE {
5
6
  UInt8 = 'UInt8',
@@ -12,6 +13,9 @@ export enum DATA_TYPE {
12
13
  Float32 = 'Float32',
13
14
  Float64 = 'Float64'
14
15
  }
16
+
17
+ export type COLOR = [number, number, number, number];
18
+
15
19
  /**
16
20
  * spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/3DSceneLayer.cmn.md
17
21
  */
@@ -80,6 +84,60 @@ export type I3STileHeader = {
80
84
  lodSelection?: LodSelection[];
81
85
  [key: string]: any;
82
86
  };
87
+
88
+ export type I3SParseOptions = {
89
+ /** ArcGIS access token */
90
+ token?: string;
91
+ /** Is 3DSceneLayer json expected in response */
92
+ isTileset?: string;
93
+ /** Is 3DNodeIndexDocument json expected in response */
94
+ isTileHeader?: string;
95
+ /** Tile3D instance. This property used only to load tile content */
96
+ /** @deprecated */
97
+ tile?: Tile3D | I3STileOptions;
98
+ /** Tileset3D instance. This property used only to load tile content */
99
+ /** @deprecated */
100
+ tileset?: Tileset3D | I3STilesetOptions;
101
+ /** Tile-specific options */
102
+ _tileOptions?: I3STileOptions;
103
+ /** Tileset-specific options */
104
+ _tilesetOptions?: I3STilesetOptions;
105
+ /** Load Draco Compressed geometry if available */
106
+ useDracoGeometry?: boolean;
107
+ /** Load compressed textures if available */
108
+ useCompressedTextures?: boolean;
109
+ /** Set false if don't need to parse textures */
110
+ decodeTextures?: boolean;
111
+ /** deck.gl compatible coordinate system.
112
+ * https://github.com/visgl/deck.gl/blob/master/docs/developer-guide/coordinate-systems.md
113
+ * Supported coordinate systems: METER_OFFSETS, LNGLAT_OFFSETS
114
+ */
115
+ coordinateSystem?: number;
116
+ colorsByAttribute?: {
117
+ attributeName: string;
118
+ minValue: number;
119
+ maxValue: number;
120
+ minColor: COLOR;
121
+ maxColor: COLOR;
122
+ };
123
+ };
124
+
125
+ export type I3STileOptions = {
126
+ isDracoGeometry: boolean;
127
+ textureUrl?: string;
128
+ textureFormat?: I3STextureFormat;
129
+ textureLoaderOptions?: any;
130
+ materialDefinition?: I3SMaterialDefinition;
131
+ attributeUrls: string[];
132
+ mbs: Mbs;
133
+ };
134
+
135
+ export type I3STilesetOptions = {
136
+ store: Store;
137
+ attributeStorageInfo: AttributeStorageInfo[];
138
+ fields: Field[];
139
+ };
140
+
83
141
  // TODO Replace "[key: string]: any" with actual defenition
84
142
  export type I3STileContent = {
85
143
  attributes: I3SMeshAttributes;
@@ -112,7 +170,7 @@ export type BoundingVolumes = {
112
170
  export type Obb = {
113
171
  center: number[] | Vector3;
114
172
  halfSize: number[] | Vector3;
115
- quaternion: Quaternion;
173
+ quaternion: number[] | Quaternion;
116
174
  };
117
175
 
118
176
  export type Mbs = [number, number, number, number];
@@ -305,7 +363,6 @@ export type PopupInfo = {
305
363
  export type Node3DIndexDocument = {
306
364
  id: string;
307
365
  version?: string;
308
- path?: string;
309
366
  level?: number;
310
367
  mbs?: Mbs;
311
368
  obb?: Obb;
@@ -775,6 +832,7 @@ export type FieldInfo = {
775
832
  export type ArcGisWebSceneData = {
776
833
  header: ArcGisWebScene;
777
834
  layers: OperationalLayer[];
835
+ unsupportedLayers: OperationalLayer[];
778
836
  };
779
837
 
780
838
  /**
@@ -821,7 +879,7 @@ export type ArcGisWebScene = {
821
879
  * Spec - https://developers.arcgis.com/web-scene-specification/objects/presentation/
822
880
  * @todo Add presentation type.
823
881
  */
824
- presentation: any;
882
+ presentation: ArcGisPresentation;
825
883
  /**
826
884
  * An object that provides information about the initial environment settings and viewpoint of the web scene.
827
885
  */
@@ -868,6 +926,100 @@ export type ArcGisWebScene = {
868
926
  widgets?: any;
869
927
  };
870
928
 
929
+ /**
930
+ * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html
931
+ */
932
+ type ArcGisPresentation = {
933
+ slides: Slide[];
934
+ };
935
+
936
+ /**
937
+ * A slide stores a snapshot of several pre-set properties of the WebScene and SceneView,
938
+ * such as the basemap, viewpoint and visible layers.
939
+ * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html
940
+ */
941
+ type Slide = {
942
+ id: string;
943
+ title: {
944
+ text: string;
945
+ };
946
+ thumbnail: {
947
+ url: string;
948
+ };
949
+ description: {
950
+ text: string;
951
+ };
952
+ ground: {
953
+ transparency: number;
954
+ };
955
+ baseMap: ArcGisBaseMap;
956
+ visibleLayers: ArcGisVisibleLayer[];
957
+ viewpoint: ArcGisViewPoint;
958
+ };
959
+
960
+ /**
961
+ * The basemap of the scene. Only the base and reference layers of the basemap are stored in a slide.
962
+ * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html
963
+ */
964
+ type ArcGisBaseMap = {
965
+ id: string;
966
+ title: string;
967
+ baseMapLayers: ArcGisBaseMapLayer[];
968
+ };
969
+
970
+ /**
971
+ * The visible layers of the scene.
972
+ * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers
973
+ */
974
+ type ArcGisVisibleLayer = {
975
+ id: string;
976
+ sublayerIds: number[];
977
+ };
978
+ /**
979
+ * The basemap of the scene.
980
+ * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html
981
+ */
982
+ type ArcGisBaseMapLayer = {
983
+ id: string;
984
+ title: string;
985
+ url: string;
986
+ layerType: string;
987
+ visibility: boolean;
988
+ };
989
+
990
+ /**
991
+ * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene.
992
+ * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html
993
+ */
994
+ type ArcGisViewPoint = {
995
+ scale: number;
996
+ rotation?: number;
997
+ /**
998
+ * Spec - https://developers.arcgis.com/web-scene-specification/objects/viewpoint/
999
+ */
1000
+ targetGeometry: any;
1001
+ camera: ArcGisCamera;
1002
+ };
1003
+
1004
+ /**
1005
+ * The camera defines the position, tilt, and heading of the point from which the SceneView's visible extent is observed.
1006
+ * It is not associated with device hardware. This class only applies to 3D SceneViews.
1007
+ * Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html
1008
+ */
1009
+ export type ArcGisCamera = {
1010
+ position: {
1011
+ x: number;
1012
+ y: number;
1013
+ z: number;
1014
+ };
1015
+ spatialReference: {
1016
+ wkid: number;
1017
+ latestWkid: number;
1018
+ };
1019
+ heading: number;
1020
+ tilt: number;
1021
+ };
1022
+
871
1023
  /**
872
1024
  * Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.
873
1025
  * Spec- https://developers.arcgis.com/web-scene-specification/objects/operationalLayers/
@@ -960,3 +1112,46 @@ type CameraPosition = {
960
1112
  y: number;
961
1113
  z: number;
962
1114
  };
1115
+
1116
+ /**
1117
+ * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/statsInfo.cmn.md
1118
+ */
1119
+ export type StatsInfo = {
1120
+ /** Represents the count of the value. */
1121
+ totalValuesCount?: number;
1122
+ /** Minimum attribute value for the entire layer. */
1123
+ min?: number;
1124
+ /** Maximum attribute value for the entire layer. */
1125
+ max?: number;
1126
+ /** Count for the entire layer. */
1127
+ count?: number;
1128
+ /** Sum of the attribute values over the entire layer. */
1129
+ sum?: number;
1130
+ /** Representing average or mean value. For example, sum/count. */
1131
+ avg?: number;
1132
+ /** Representing the standard deviation. */
1133
+ stddev?: number;
1134
+ /** Representing variance. For example, stats.stddev *stats.stddev. */
1135
+ variance?: number;
1136
+ /** Represents the histogram. */
1137
+ histogram?: Histogram;
1138
+ /** An array of most frequently used values within the point cloud scene layer. */
1139
+ mostFrequentValues?: ValueCount[];
1140
+ };
1141
+
1142
+ /** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/histogram.cmn.md */
1143
+ export type Histogram = {
1144
+ /** Minimum attribute value for the entire layer. */
1145
+ minimum: number;
1146
+ /** Maximum attribute value for the entire layer. Maximum array size for stats.histo.counts is 256. */
1147
+ maximum: number;
1148
+ /** Count for the entire layer. */
1149
+ counts: number[];
1150
+ };
1151
+
1152
+ export type ValueCount = {
1153
+ /** Type of the attribute values after decompression, if applicable. Please note that string is not supported for point cloud scene layer attributes. */
1154
+ value: number | string;
1155
+ /** Count of the number of values. May exceed 32 bits. */
1156
+ count: number;
1157
+ };
@@ -0,0 +1,5 @@
1
+ import {createLoaderWorker} from '@loaders.gl/loader-utils';
2
+ import '@loaders.gl/polyfills';
3
+ import {I3SContentLoader} from '../i3s-content-loader';
4
+
5
+ createLoaderWorker(I3SContentLoader);