@loaders.gl/tile-converter 3.2.0-alpha.1 → 3.2.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/dist/3d-tiles-attributes-worker.d.ts +28 -0
  2. package/dist/3d-tiles-attributes-worker.d.ts.map +1 -0
  3. package/dist/3d-tiles-attributes-worker.js +4 -0
  4. package/dist/3d-tiles-attributes-worker.js.map +7 -0
  5. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +5 -1
  6. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
  7. package/dist/3d-tiles-converter/3d-tiles-converter.js +34 -3
  8. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +5 -4
  9. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
  10. package/dist/3d-tiles-converter/helpers/b3dm-converter.js +10 -10
  11. package/dist/constants.d.ts +2 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/constants.js +4 -0
  14. package/dist/converter-cli.d.ts +2 -0
  15. package/dist/converter-cli.d.ts.map +1 -0
  16. package/dist/converter-cli.js +232 -0
  17. package/dist/converter.min.js +68 -68
  18. package/dist/deps-installer/deps-installer.d.ts +11 -1
  19. package/dist/deps-installer/deps-installer.d.ts.map +1 -1
  20. package/dist/deps-installer/deps-installer.js +10 -0
  21. package/dist/dist.min.js +910 -790
  22. package/dist/es5/3d-tiles-attributes-worker.js +29 -0
  23. package/dist/es5/3d-tiles-attributes-worker.js.map +1 -0
  24. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +116 -46
  25. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  26. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +21 -23
  27. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  28. package/dist/es5/constants.js +9 -0
  29. package/dist/es5/constants.js.map +1 -0
  30. package/dist/es5/converter-cli.js +306 -0
  31. package/dist/es5/converter-cli.js.map +1 -0
  32. package/dist/es5/deps-installer/deps-installer.js.map +1 -1
  33. package/dist/es5/i3s-attributes-worker.js +29 -0
  34. package/dist/es5/i3s-attributes-worker.js.map +1 -0
  35. package/dist/es5/i3s-converter/helpers/coordinate-converter.js +19 -11
  36. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  37. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +2 -2
  38. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  39. package/dist/es5/i3s-converter/helpers/geometry-converter.js +271 -182
  40. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  41. package/dist/es5/i3s-converter/helpers/gltf-attributes.js +71 -0
  42. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -0
  43. package/dist/es5/i3s-converter/helpers/node-pages.js +47 -99
  44. package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
  45. package/dist/es5/i3s-converter/i3s-converter.js +293 -223
  46. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  47. package/dist/es5/i3s-converter/json-templates/layers.js +29 -0
  48. package/dist/es5/i3s-converter/json-templates/layers.js.map +1 -1
  49. package/dist/es5/index.js +0 -16
  50. package/dist/es5/index.js.map +1 -1
  51. package/dist/es5/lib/utils/compress-util.js +14 -17
  52. package/dist/es5/lib/utils/compress-util.js.map +1 -1
  53. package/dist/es5/lib/utils/file-utils.js +39 -14
  54. package/dist/es5/lib/utils/file-utils.js.map +1 -1
  55. package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
  56. package/dist/es5/lib/utils/queue.js +61 -0
  57. package/dist/es5/lib/utils/queue.js.map +1 -0
  58. package/dist/es5/lib/utils/statistic-utills.js.map +1 -1
  59. package/dist/es5/lib/utils/write-queue.js +225 -0
  60. package/dist/es5/lib/utils/write-queue.js.map +1 -0
  61. package/dist/es5/pgm-loader.js +1 -1
  62. package/dist/es5/workers/3d-tiles-attributes-worker.js +37 -0
  63. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -0
  64. package/dist/es5/workers/i3s-attributes-worker.js +40 -0
  65. package/dist/es5/workers/i3s-attributes-worker.js.map +1 -0
  66. package/dist/esm/3d-tiles-attributes-worker.js +16 -0
  67. package/dist/esm/3d-tiles-attributes-worker.js.map +1 -0
  68. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +36 -4
  69. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  70. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +16 -18
  71. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  72. package/dist/esm/constants.js +2 -0
  73. package/dist/esm/constants.js.map +1 -0
  74. package/dist/esm/converter-cli.js +230 -0
  75. package/dist/esm/converter-cli.js.map +1 -0
  76. package/dist/esm/deps-installer/deps-installer.js.map +1 -1
  77. package/dist/esm/i3s-attributes-worker.js +16 -0
  78. package/dist/esm/i3s-attributes-worker.js.map +1 -0
  79. package/dist/esm/i3s-converter/helpers/coordinate-converter.js +19 -11
  80. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  81. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +2 -2
  82. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  83. package/dist/esm/i3s-converter/helpers/geometry-converter.js +121 -62
  84. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  85. package/dist/esm/i3s-converter/helpers/gltf-attributes.js +54 -0
  86. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -0
  87. package/dist/esm/i3s-converter/helpers/node-pages.js +12 -4
  88. package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
  89. package/dist/esm/i3s-converter/i3s-converter.js +157 -52
  90. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  91. package/dist/esm/i3s-converter/json-templates/layers.js +25 -0
  92. package/dist/esm/i3s-converter/json-templates/layers.js.map +1 -1
  93. package/dist/esm/index.js +0 -2
  94. package/dist/esm/index.js.map +1 -1
  95. package/dist/esm/lib/utils/compress-util.js +6 -8
  96. package/dist/esm/lib/utils/compress-util.js.map +1 -1
  97. package/dist/esm/lib/utils/file-utils.js +11 -1
  98. package/dist/esm/lib/utils/file-utils.js.map +1 -1
  99. package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
  100. package/dist/esm/lib/utils/queue.js +19 -0
  101. package/dist/esm/lib/utils/queue.js.map +1 -0
  102. package/dist/esm/lib/utils/statistic-utills.js.map +1 -1
  103. package/dist/esm/lib/utils/write-queue.js +88 -0
  104. package/dist/esm/lib/utils/write-queue.js.map +1 -0
  105. package/dist/esm/pgm-loader.js +1 -1
  106. package/dist/esm/workers/3d-tiles-attributes-worker.js +5 -0
  107. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -0
  108. package/dist/esm/workers/i3s-attributes-worker.js +4 -0
  109. package/dist/esm/workers/i3s-attributes-worker.js.map +1 -0
  110. package/dist/i3s-attributes-worker.d.ts +33 -0
  111. package/dist/i3s-attributes-worker.d.ts.map +1 -0
  112. package/dist/i3s-attributes-worker.js +10 -0
  113. package/dist/i3s-attributes-worker.js.map +7 -0
  114. package/dist/i3s-converter/helpers/coordinate-converter.d.ts +7 -7
  115. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
  116. package/dist/i3s-converter/helpers/coordinate-converter.js +25 -21
  117. package/dist/i3s-converter/helpers/geometry-attributes.d.ts +2 -2
  118. package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -1
  119. package/dist/i3s-converter/helpers/geometry-attributes.js +2 -1
  120. package/dist/i3s-converter/helpers/geometry-converter.d.ts +28 -11
  121. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  122. package/dist/i3s-converter/helpers/geometry-converter.js +223 -113
  123. package/dist/i3s-converter/helpers/gltf-attributes.d.ts +9 -0
  124. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -0
  125. package/dist/i3s-converter/helpers/gltf-attributes.js +56 -0
  126. package/dist/i3s-converter/helpers/node-pages.d.ts +6 -5
  127. package/dist/i3s-converter/helpers/node-pages.d.ts.map +1 -1
  128. package/dist/i3s-converter/helpers/node-pages.js +13 -8
  129. package/dist/i3s-converter/i3s-converter.d.ts +7 -5
  130. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  131. package/dist/i3s-converter/i3s-converter.js +126 -40
  132. package/dist/i3s-converter/json-templates/layers.d.ts +4 -0
  133. package/dist/i3s-converter/json-templates/layers.d.ts.map +1 -1
  134. package/dist/i3s-converter/json-templates/layers.js +24 -0
  135. package/dist/i3s-converter/types.d.ts +83 -8
  136. package/dist/i3s-converter/types.d.ts.map +1 -1
  137. package/dist/index.d.ts +0 -2
  138. package/dist/index.d.ts.map +1 -1
  139. package/dist/index.js +1 -5
  140. package/dist/lib/utils/compress-util.d.ts +44 -5
  141. package/dist/lib/utils/compress-util.d.ts.map +1 -1
  142. package/dist/lib/utils/compress-util.js +73 -6
  143. package/dist/lib/utils/file-utils.d.ts +34 -5
  144. package/dist/lib/utils/file-utils.d.ts.map +1 -1
  145. package/dist/lib/utils/file-utils.js +40 -1
  146. package/dist/lib/utils/lod-conversion-utils.d.ts +25 -4
  147. package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -1
  148. package/dist/lib/utils/lod-conversion-utils.js +21 -2
  149. package/dist/lib/utils/queue.d.ts +7 -0
  150. package/dist/lib/utils/queue.d.ts.map +1 -0
  151. package/dist/lib/utils/queue.js +18 -0
  152. package/dist/lib/utils/statistic-utills.d.ts +2 -2
  153. package/dist/lib/utils/statistic-utills.d.ts.map +1 -1
  154. package/dist/lib/utils/write-queue.d.ts +22 -0
  155. package/dist/lib/utils/write-queue.d.ts.map +1 -0
  156. package/dist/lib/utils/write-queue.js +62 -0
  157. package/dist/workers/3d-tiles-attributes-worker.d.ts +2 -0
  158. package/dist/workers/3d-tiles-attributes-worker.d.ts.map +1 -0
  159. package/dist/workers/3d-tiles-attributes-worker.js +9 -0
  160. package/dist/workers/i3s-attributes-worker.d.ts +2 -0
  161. package/dist/workers/i3s-attributes-worker.d.ts.map +1 -0
  162. package/dist/workers/i3s-attributes-worker.js +5 -0
  163. package/package.json +23 -18
  164. package/src/3d-tiles-attributes-worker.ts +43 -0
  165. package/src/3d-tiles-converter/3d-tiles-converter.ts +50 -5
  166. package/src/3d-tiles-converter/helpers/b3dm-converter.ts +15 -13
  167. package/src/constants.ts +2 -0
  168. package/src/converter-cli.ts +310 -0
  169. package/src/deps-installer/{deps-installer.js → deps-installer.ts} +11 -1
  170. package/src/i3s-attributes-worker.ts +46 -0
  171. package/src/i3s-converter/helpers/coordinate-converter.ts +29 -24
  172. package/src/i3s-converter/helpers/geometry-attributes.ts +4 -3
  173. package/src/i3s-converter/helpers/{geometry-converter.js → geometry-converter.ts} +425 -179
  174. package/src/i3s-converter/helpers/gltf-attributes.ts +68 -0
  175. package/src/i3s-converter/helpers/node-pages.ts +25 -17
  176. package/src/i3s-converter/i3s-converter.ts +150 -90
  177. package/src/i3s-converter/json-templates/layers.ts +25 -0
  178. package/src/i3s-converter/types.ts +90 -8
  179. package/src/index.ts +0 -4
  180. package/src/lib/utils/{compress-util.js → compress-util.ts} +105 -18
  181. package/src/lib/utils/file-utils.ts +84 -0
  182. package/src/lib/utils/{lod-conversion-utils.js → lod-conversion-utils.ts} +27 -5
  183. package/src/lib/utils/queue.ts +17 -0
  184. package/src/lib/utils/{statistic-utills.js → statistic-utills.ts} +0 -0
  185. package/src/lib/utils/write-queue.ts +75 -0
  186. package/src/workers/3d-tiles-attributes-worker.ts +6 -0
  187. package/src/workers/i3s-attributes-worker.ts +6 -0
  188. package/dist/es5/deps-installer/deps-installer.d.ts +0 -10
  189. package/dist/es5/i3s-converter/helpers/geometry-converter.d.ts +0 -44
  190. package/dist/es5/lib/utils/compress-util.d.ts +0 -53
  191. package/dist/es5/lib/utils/file-utils.d.ts +0 -43
  192. package/dist/es5/lib/utils/lod-conversion-utils.d.ts +0 -32
  193. package/dist/esm/deps-installer/deps-installer.d.ts +0 -10
  194. package/dist/esm/i3s-converter/helpers/geometry-converter.d.ts +0 -44
  195. package/dist/esm/lib/utils/compress-util.d.ts +0 -53
  196. package/dist/esm/lib/utils/file-utils.d.ts +0 -43
  197. package/dist/esm/lib/utils/lod-conversion-utils.d.ts +0 -32
  198. package/src/deps-installer/deps-installer.d.ts +0 -10
  199. package/src/i3s-converter/helpers/geometry-converter.d.ts +0 -44
  200. package/src/lib/utils/compress-util.d.ts +0 -53
  201. package/src/lib/utils/file-utils.d.ts +0 -43
  202. package/src/lib/utils/file-utils.js +0 -38
  203. package/src/lib/utils/lod-conversion-utils.d.ts +0 -32
@@ -1,39 +1,114 @@
1
- import { BoundingVolumes, I3SMaterialDefinition, SharedResources } from '@loaders.gl/i3s';
1
+ import { BoundingVolumes, I3SMaterialDefinition, MaterialDefinitionInfo, TextureDefinitionInfo } from '@loaders.gl/i3s';
2
+ import { ImageDataType } from '@loaders.gl/images';
3
+ /** Converted resources for specific node */
2
4
  export declare type I3SConvertedResources = {
5
+ /** Non-compressed geometry buffer that have structure met
6
+ * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
7
+ * (Geometry buffer)
8
+ */
3
9
  geometry: ArrayBuffer | null;
4
- compressedGeometry?: ArrayBuffer | null;
10
+ /**
11
+ * Draco compressed geometry
12
+ */
13
+ compressedGeometry?: Promise<ArrayBuffer> | null;
14
+ /**
15
+ * Texture image content
16
+ */
5
17
  texture: any | null;
6
- sharedResources: SharedResources | null;
18
+ /**
19
+ * Shared resources built from GLTF material
20
+ */
21
+ sharedResources: SharedResourcesArrays | null;
22
+ /**
23
+ * Material definition of the node
24
+ */
7
25
  meshMaterial?: I3SMaterialDefinition | null;
26
+ /**
27
+ * Number of vertices in the node
28
+ */
8
29
  vertexCount: number | null;
9
- attributes: any | null;
30
+ /**
31
+ * Feature attributes contents
32
+ */
33
+ attributes: ArrayBuffer[] | null;
34
+ /**
35
+ * Number of features in the node
36
+ */
10
37
  featureCount: number | null;
11
- geometryBuffer?: ArrayBuffer;
38
+ /**
39
+ * MBS and/or OBB bounding volumes of the node
40
+ */
12
41
  boundingVolumes: BoundingVolumes | null;
13
42
  };
14
- export declare type AttributesData = {
43
+ /**
44
+ * Geometry and feature attributes converted from GLTF primitives
45
+ */
46
+ export declare type ConvertedAttributes = {
47
+ /** POSITION attribute value */
15
48
  positions: Float32Array;
49
+ /** NORMAL attribute value */
16
50
  normals: Float32Array;
51
+ /** TEXCOORD_0 attribute value */
17
52
  texCoords: Float32Array;
53
+ /** COLOR_0 attribute value */
18
54
  colors: Uint8Array;
55
+ /** Feature indices grouped by ...
56
+ * converted from "batch ids" of GLTF
57
+ */
58
+ featureIndicesGroups?: number[][];
59
+ /** Feature indices converted from "batch ids" */
19
60
  featureIndices: number[];
20
- triangleCount: number;
21
- boundingVolumes?: BoundingVolumes | null;
61
+ /**
62
+ * MBS and/or OBB bounding volumes of the node
63
+ */
64
+ boundingVolumes: null | BoundingVolumes;
22
65
  };
66
+ /** Postprocessed geometry and feature attributes
67
+ * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
68
+ */
23
69
  export declare type GeometryAttributes = {
70
+ /** POSITION attribute value */
24
71
  positions: Float32Array;
72
+ /** NORMAL attribute value */
25
73
  normals: Float32Array;
74
+ /** TEXCOORD_0 attribute value */
26
75
  texCoords: Float32Array;
76
+ /** COLOR_0 attribute value */
27
77
  colors: Uint8Array;
78
+ /** faceRanges attribute value */
28
79
  faceRange: Uint32Array;
80
+ /** feature Ids attribute value */
29
81
  featureIds: number[];
82
+ /** number of features in the node */
30
83
  featureCount: number;
31
84
  };
85
+ /** Geometry attributes specific for the particular feature */
32
86
  export declare type GroupedByFeatureIdAttributes = {
87
+ /** Feature Id */
33
88
  featureId: number;
89
+ /** POSITION attribute value */
34
90
  positions: Float32Array;
91
+ /** NORMAL attribute value */
35
92
  normals: Float32Array;
93
+ /** COLOR_0 attribute value */
36
94
  colors: Uint8Array;
95
+ /** TEXCOORD_0 attribute value */
37
96
  texCoords: Float32Array;
38
97
  };
98
+ /** Shared resources made from GLTF material */
99
+ export declare type SharedResourcesArrays = {
100
+ /** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */
101
+ materialDefinitionInfos?: MaterialDefinitionInfo[];
102
+ /** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/
103
+ textureDefinitionInfos?: TextureDefinitionInfo[];
104
+ /** node id to make unique SharedResource ids */
105
+ nodePath?: string;
106
+ };
107
+ /** I3S material definition and texture content taken from GLTF material */
108
+ export declare type I3SMaterialWithTexture = {
109
+ /** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */
110
+ material: I3SMaterialDefinition;
111
+ /** Texture content (image) */
112
+ texture?: ImageDataType;
113
+ };
39
114
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAExF,oBAAY,qBAAqB,GAAG;IAClC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,kBAAkB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACxC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACpB,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC5C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,GAAG,GAAG,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,YAAY,CAAC;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAC1C,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,YAAY,CAAC;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEjD,4CAA4C;AAC5C,oBAAY,qBAAqB,GAAG;IAClC;;;OAGG;IACH,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IACjD;;OAEG;IACH,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACpB;;OAEG;IACH,eAAe,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC9C;;OAEG;IACH,YAAY,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC5C;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;OAEG;IACH,UAAU,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACjC;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;OAEG;IACH,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,oBAAY,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,6BAA6B;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,8BAA8B;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IAClC,iDAAiD;IACjD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,eAAe,EAAE,IAAI,GAAG,eAAe,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,+BAA+B;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,6BAA6B;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,8BAA8B;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,kCAAkC;IAClC,SAAS,EAAE,WAAW,CAAC;IACvB,kCAAkC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,8DAA8D;AAC9D,oBAAY,4BAA4B,GAAG;IACzC,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,6BAA6B;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,8BAA8B;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,iCAAiC;IACjC,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,+CAA+C;AAC/C,oBAAY,qBAAqB,GAAG;IAClC,oHAAoH;IACpH,uBAAuB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACnD,kHAAkH;IAClH,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjD,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,2EAA2E;AAC3E,oBAAY,sBAAsB,GAAG;IACnC,2GAA2G;IAC3G,QAAQ,EAAE,qBAAqB,CAAC;IAChC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
1
  export { default as I3SConverter } from './i3s-converter/i3s-converter';
2
- export { default as NodePages } from './i3s-converter/helpers/node-pages';
3
2
  export { default as Tiles3DConverter } from './3d-tiles-converter/3d-tiles-converter';
4
- export { DepsInstaller } from './deps-installer/deps-installer';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,oCAAoC,CAAC;AAExE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,yCAAyC,CAAC;AAEpF,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,yCAAyC,CAAC"}
package/dist/index.js CHANGED
@@ -3,12 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DepsInstaller = exports.Tiles3DConverter = exports.NodePages = exports.I3SConverter = void 0;
6
+ exports.Tiles3DConverter = exports.I3SConverter = void 0;
7
7
  var i3s_converter_1 = require("./i3s-converter/i3s-converter");
8
8
  Object.defineProperty(exports, "I3SConverter", { enumerable: true, get: function () { return __importDefault(i3s_converter_1).default; } });
9
- var node_pages_1 = require("./i3s-converter/helpers/node-pages");
10
- Object.defineProperty(exports, "NodePages", { enumerable: true, get: function () { return __importDefault(node_pages_1).default; } });
11
9
  var _3d_tiles_converter_1 = require("./3d-tiles-converter/3d-tiles-converter");
12
10
  Object.defineProperty(exports, "Tiles3DConverter", { enumerable: true, get: function () { return __importDefault(_3d_tiles_converter_1).default; } });
13
- var deps_installer_1 = require("./deps-installer/deps-installer");
14
- Object.defineProperty(exports, "DepsInstaller", { enumerable: true, get: function () { return deps_installer_1.DepsInstaller; } });
@@ -1,6 +1,45 @@
1
- export function compressFileWithGzip(pathFile: any): Promise<any>;
2
- export function compressFilesWithZip(fileMap: any, outputFile: any, level?: number): Promise<any>;
3
- export function compressWithChildProcess(...args: any[]): Promise<void>;
4
- export function generateHash128FromZip(inputZipFile: any, outputFile: any): Promise<any>;
5
- export function addFileToZip(inputFolder: any, fileName: any, zipFile: any, sevenZipExe: any): Promise<void>;
1
+ /**
2
+ * Compress file to gzip file
3
+ *
4
+ * @param pathFile - the path to the file
5
+ * @return the path to the gzip file
6
+ */
7
+ export declare function compressFileWithGzip(pathFile: string): Promise<string>;
8
+ /**
9
+ * Compress files from map into slpk file
10
+ *
11
+ * @param fileMap - map with file paths (key: output path, value: input path)
12
+ * @param outputFile - output slpk file
13
+ * @param level - compression level
14
+ */
15
+ export declare function compressFilesWithZip(fileMap: {
16
+ [key: string]: string;
17
+ }, outputFile: string, level?: number): Promise<unknown>;
18
+ /**
19
+ * Compress files using external tool 'zip'/'7z'
20
+ *
21
+ * @param inputFolder - folder to archive - for cwd option
22
+ * @param outputFile - output slpk file
23
+ * @param level - compression level
24
+ * @param inputFiles - input files path to pass to the executable as option
25
+ * @param sevenZipExe - path to 7z.exe executable
26
+ */
27
+ export declare function compressWithChildProcess(inputFolder: string, outputFile: string, level: number, inputFiles: string, sevenZipExe: string): Promise<void>;
28
+ /**
29
+ * Generate hash file from zip archive
30
+ * https://github.com/Esri/i3s-spec/blob/master/docs/1.7/slpk_hashtable.cmn.md
31
+ *
32
+ * @param inputZipFile
33
+ * @param outputFile
34
+ */
35
+ export declare function generateHash128FromZip(inputZipFile: string, outputFile: string): Promise<unknown>;
36
+ /**
37
+ * Add file to zip archive
38
+ *
39
+ * @param inputFile
40
+ * @param fileName
41
+ * @param zipFile
42
+ * @param sevenZipExe
43
+ */
44
+ export declare function addFileToZip(inputFolder: string, fileName: string, zipFile: string, sevenZipExe: string): Promise<void>;
6
45
  //# sourceMappingURL=compress-util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compress-util.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/compress-util.js"],"names":[],"mappings":"AAWA,kEAiBC;AAED,kGAoDC;AAED,wEAOC;AA0CD,yFA6CC;AASD,6GAGC"}
1
+ {"version":3,"file":"compress-util.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/compress-util.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBtE;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,EAChC,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,MAAU,oBAqDlB;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,iBAQpB;AAgED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBA6CpF;AAeD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,iBAIpB"}
@@ -14,6 +14,12 @@ const jszip_1 = __importDefault(require("jszip"));
14
14
  const crypto_1 = require("@loaders.gl/crypto");
15
15
  const crypt_1 = __importDefault(require("crypt"));
16
16
  const file_utils_2 = require("./file-utils");
17
+ /**
18
+ * Compress file to gzip file
19
+ *
20
+ * @param pathFile - the path to the file
21
+ * @return the path to the gzip file
22
+ */
17
23
  function compressFileWithGzip(pathFile) {
18
24
  const compressedPathFile = `${pathFile}.gz`;
19
25
  const gzip = (0, zlib_1.createGzip)();
@@ -32,6 +38,13 @@ function compressFileWithGzip(pathFile) {
32
38
  });
33
39
  }
34
40
  exports.compressFileWithGzip = compressFileWithGzip;
41
+ /**
42
+ * Compress files from map into slpk file
43
+ *
44
+ * @param fileMap - map with file paths (key: output path, value: input path)
45
+ * @param outputFile - output slpk file
46
+ * @param level - compression level
47
+ */
35
48
  async function compressFilesWithZip(fileMap, outputFile, level = 0) {
36
49
  // Before creating a new file, we need to delete the old file
37
50
  try {
@@ -79,16 +92,33 @@ async function compressFilesWithZip(fileMap, outputFile, level = 0) {
79
92
  });
80
93
  }
81
94
  exports.compressFilesWithZip = compressFilesWithZip;
82
- async function compressWithChildProcess() {
95
+ /**
96
+ * Compress files using external tool 'zip'/'7z'
97
+ *
98
+ * @param inputFolder - folder to archive - for cwd option
99
+ * @param outputFile - output slpk file
100
+ * @param level - compression level
101
+ * @param inputFiles - input files path to pass to the executable as option
102
+ * @param sevenZipExe - path to 7z.exe executable
103
+ */
104
+ async function compressWithChildProcess(inputFolder, outputFile, level, inputFiles, sevenZipExe) {
83
105
  // eslint-disable-next-line no-undef
84
106
  if (process.platform === 'win32') {
85
- await compressWithChildProcessWindows(...arguments);
107
+ await compressWithChildProcessWindows(inputFolder, outputFile, level, inputFiles, sevenZipExe);
86
108
  }
87
109
  else {
88
- await compressWithChildProcessUnix(...arguments);
110
+ await compressWithChildProcessUnix(inputFolder, outputFile, level, inputFiles);
89
111
  }
90
112
  }
91
113
  exports.compressWithChildProcess = compressWithChildProcess;
114
+ /**
115
+ * Compress files using external linux tool 'zip'
116
+ *
117
+ * @param inputFolder - folder to archive - for cwd option
118
+ * @param outputFile - output slpk file
119
+ * @param level - compression level
120
+ * @param inputFiles - input files path to pass to the executable as option
121
+ */
92
122
  async function compressWithChildProcessUnix(inputFolder, outputFile, level = 0, inputFiles = '.') {
93
123
  const fullOutputFile = (0, file_utils_2.getAbsoluteFilePath)(outputFile);
94
124
  const args = [`-${level}`, '-r', fullOutputFile, inputFiles];
@@ -102,6 +132,15 @@ async function compressWithChildProcessUnix(inputFolder, outputFile, level = 0,
102
132
  wait: 0
103
133
  });
104
134
  }
135
+ /**
136
+ * Compress files using windows external tool '7z'
137
+ *
138
+ * @param inputFolder - folder to archive - for cwd option
139
+ * @param outputFile - output slpk file
140
+ * @param level - compression level
141
+ * @param inputFiles - input files path to pass to the executable as option
142
+ * @param sevenZipExe - path to 7z.exe executable
143
+ */
105
144
  async function compressWithChildProcessWindows(inputFolder, outputFile, level = 0, inputFiles = (0, path_1.join)('.', '*'), sevenZipExe) {
106
145
  // Workaround for @listfile issue. In 7z.exe @-leading files are handled as listfiles
107
146
  // https://sevenzip.osdn.jp/chm/cmdline/syntax.htm
@@ -120,6 +159,13 @@ async function compressWithChildProcessWindows(inputFolder, outputFile, level =
120
159
  wait: 0
121
160
  });
122
161
  }
162
+ /**
163
+ * Generate hash file from zip archive
164
+ * https://github.com/Esri/i3s-spec/blob/master/docs/1.7/slpk_hashtable.cmn.md
165
+ *
166
+ * @param inputZipFile
167
+ * @param outputFile
168
+ */
123
169
  async function generateHash128FromZip(inputZipFile, outputFile) {
124
170
  const input = await fs_1.promises.readFile(inputZipFile);
125
171
  const zip = await jszip_1.default.loadAsync(input);
@@ -157,7 +203,7 @@ async function generateHash128FromZip(inputZipFile, outputFile) {
157
203
  });
158
204
  for (const key in hashTable) {
159
205
  const item = hashTable[key];
160
- const value = _longToByteArray(item.value);
206
+ const value = longToByteArray(item.value);
161
207
  // TODO: perhaps you need to wait for the 'drain' event if the write returns 'false'
162
208
  // eslint-disable-next-line no-undef
163
209
  output.write(Buffer.from(crypt_1.default.hexToBytes(item.key).concat(value)));
@@ -166,17 +212,38 @@ async function generateHash128FromZip(inputZipFile, outputFile) {
166
212
  });
167
213
  }
168
214
  exports.generateHash128FromZip = generateHash128FromZip;
169
- function _longToByteArray(long) {
215
+ /**
216
+ * Encode 64 bit value to byte array
217
+ *
218
+ * @param long - stringified number
219
+ * @returns
220
+ */
221
+ function longToByteArray(long) {
170
222
  const buffer = new ArrayBuffer(8); // JS numbers are 8 bytes long, or 64 bits
171
223
  const longNum = new Float64Array(buffer); // so equivalent to Float64
172
- longNum[0] = long;
224
+ longNum[0] = parseInt(long);
173
225
  return Array.from(new Uint8Array(buffer)).reverse(); // reverse to get little endian
174
226
  }
227
+ /**
228
+ * Add file to zip archive
229
+ *
230
+ * @param inputFile
231
+ * @param fileName
232
+ * @param zipFile
233
+ * @param sevenZipExe
234
+ */
175
235
  async function addFileToZip(inputFolder, fileName, zipFile, sevenZipExe) {
176
236
  await compressWithChildProcess(inputFolder, zipFile, 0, fileName, sevenZipExe);
177
237
  console.log(`${fileName} added to ${zipFile}.`); // eslint-disable-line
178
238
  }
179
239
  exports.addFileToZip = addFileToZip;
240
+ /**
241
+ *
242
+ * @param archive zip archive instance
243
+ * @param subFileName file path inside archive
244
+ * @param subFileData source file path
245
+ * @returns
246
+ */
180
247
  function appendFileToArchive(archive, subFileName, subFileData) {
181
248
  return new Promise((resolve) => {
182
249
  const fileStream = (0, fs_1.createReadStream)(subFileData);
@@ -1,6 +1,35 @@
1
- export function writeFile(path: any, data: any, fileName?: string): Promise<string>;
2
- export function writeFileForSlpk(path: any, data: any, fileName?: string, compress?: boolean): Promise<string>;
3
- export function removeDir(path: any): Promise<void>;
4
- export function removeFile(path: any): Promise<void>;
5
- export function getAbsoluteFilePath(filePath: any): any;
1
+ /**
2
+ * Write a file with data and name fileName to path
3
+ *
4
+ * @param path - output path
5
+ * @param data - file content
6
+ * @param fileName - name of output file (default: index.json)
7
+ */
8
+ export declare function writeFile(path: string, data: string | Uint8Array | ArrayBuffer | Promise<ArrayBuffer>, fileName?: string): Promise<string>;
9
+ /**
10
+ * Write a file with data and name fileName to path - specific one for further packaging into slpk
11
+ *
12
+ * @param path - output path
13
+ * @param data - file content
14
+ * @param fileName - name of output file (default: index.json)
15
+ * @param compress - if need to compress file with gzip (default: true)
16
+ */
17
+ export declare function writeFileForSlpk(path: string, data: string | Uint8Array | ArrayBuffer | Promise<ArrayBuffer>, fileName?: string, compress?: boolean): Promise<string>;
18
+ /**
19
+ * Remove dir with path
20
+ *
21
+ * @param path
22
+ */
23
+ export declare function removeDir(path: string): Promise<void>;
24
+ /**
25
+ * Remove file with path
26
+ *
27
+ * @param path
28
+ */
29
+ export declare function removeFile(path: string): Promise<void>;
30
+ /**
31
+ * Generates absolute file path
32
+ * @param filePath
33
+ */
34
+ export declare function getAbsoluteFilePath(filePath: string): string;
6
35
  //# sourceMappingURL=file-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/file-utils.js"],"names":[],"mappings":"AAIA,oFAUC;AAED,+GASC;AAED,oDAEC;AAED,qDAEC;AAED,wDAEC"}
1
+ {"version":3,"file":"file-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/file-utils.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,EAC9D,QAAQ,GAAE,MAAqB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,EAC9D,QAAQ,GAAE,MAAqB,EAC/B,QAAQ,GAAE,OAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CASjB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,iBAErC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,iBAEtC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,UAEnD"}
@@ -4,11 +4,28 @@ exports.getAbsoluteFilePath = exports.removeFile = exports.removeDir = exports.w
4
4
  const fs_1 = require("fs");
5
5
  const path_1 = require("path");
6
6
  const compress_util_1 = require("./compress-util");
7
+ /**
8
+ * Write a file with data and name fileName to path
9
+ *
10
+ * @param path - output path
11
+ * @param data - file content
12
+ * @param fileName - name of output file (default: index.json)
13
+ */
7
14
  async function writeFile(path, data, fileName = 'index.json') {
15
+ let toWriteData;
16
+ if (data instanceof Promise) {
17
+ toWriteData = new Uint8Array(await data);
18
+ }
19
+ else if (data instanceof ArrayBuffer) {
20
+ toWriteData = new Uint8Array(data);
21
+ }
22
+ else {
23
+ toWriteData = data;
24
+ }
8
25
  await fs_1.promises.mkdir(path, { recursive: true });
9
26
  const pathFile = (0, path_1.join)(path, fileName);
10
27
  try {
11
- await fs_1.promises.writeFile(pathFile, data);
28
+ await fs_1.promises.writeFile(pathFile, toWriteData);
12
29
  }
13
30
  catch (err) {
14
31
  throw err;
@@ -17,6 +34,14 @@ async function writeFile(path, data, fileName = 'index.json') {
17
34
  return pathFile;
18
35
  }
19
36
  exports.writeFile = writeFile;
37
+ /**
38
+ * Write a file with data and name fileName to path - specific one for further packaging into slpk
39
+ *
40
+ * @param path - output path
41
+ * @param data - file content
42
+ * @param fileName - name of output file (default: index.json)
43
+ * @param compress - if need to compress file with gzip (default: true)
44
+ */
20
45
  async function writeFileForSlpk(path, data, fileName = 'index.json', compress = true) {
21
46
  const pathFile = await writeFile(path, data, fileName);
22
47
  if (compress) {
@@ -28,14 +53,28 @@ async function writeFileForSlpk(path, data, fileName = 'index.json', compress =
28
53
  return pathFile;
29
54
  }
30
55
  exports.writeFileForSlpk = writeFileForSlpk;
56
+ /**
57
+ * Remove dir with path
58
+ *
59
+ * @param path
60
+ */
31
61
  function removeDir(path) {
32
62
  return fs_1.promises.rmdir(path, { recursive: true });
33
63
  }
34
64
  exports.removeDir = removeDir;
65
+ /**
66
+ * Remove file with path
67
+ *
68
+ * @param path
69
+ */
35
70
  function removeFile(path) {
36
71
  return fs_1.promises.unlink(path);
37
72
  }
38
73
  exports.removeFile = removeFile;
74
+ /**
75
+ * Generates absolute file path
76
+ * @param filePath
77
+ */
39
78
  function getAbsoluteFilePath(filePath) {
40
79
  return (0, path_1.isAbsolute)(filePath) ? filePath : (0, path_1.join)(process.cwd(), filePath); // eslint-disable-line no-undef
41
80
  }
@@ -1,7 +1,8 @@
1
+ import { BoundingVolumes } from '@loaders.gl/i3s';
2
+ import { Tile3D } from '@loaders.gl/tiles';
1
3
  /**
2
4
  * Do conversion from geometric error to screen threshold
3
- * @param {Object} tile
4
- * @param {Object} coordinates
5
+ *
5
6
  * In 3DTiles we have HLOD logic and parent tile also has bigger lodMetric value then its children.
6
7
  * In I3s we have reverse logic related to maxError. Parent has lower maxError than its child.
7
8
  * In nodes where are no children tile.lodMetricValue is 0. This is because of logic of HLOD in 3DTiles
@@ -11,10 +12,30 @@
11
12
  * https://github.com/Esri/i3s-spec/blob/master/docs/1.7/lodSelection.cmn.md
12
13
  * To avoid infinity values when we do calculations of maxError we shold replace 0 with value which allows us
13
14
  * to make child maxError bigger than his parent maxError.
15
+ *
16
+ * @param tile - 3d-tiles tile Object
17
+ * @param coordinates - node converted coordinates
18
+ * @returns An array of LOD metrics in format compatible with i3s 3DNodeIndexDocument.lodSelection
19
+ * @example
20
+ * [
21
+ {
22
+ "metricType": "maxScreenThresholdSQ",
23
+ "maxError": 870638.071285568
24
+ },
25
+ {
26
+ "metricType": "maxScreenThreshold",
27
+ "maxError": 1052.8679031638949
28
+ }
29
+ ]
14
30
  */
15
- export function convertGeometricErrorToScreenThreshold(tile: any, coordinates: any): {
31
+ export declare function convertGeometricErrorToScreenThreshold(tile: Tile3D, coordinates: BoundingVolumes): {
16
32
  metricType: string;
17
33
  maxError: number;
18
34
  }[];
19
- export function convertScreenThresholdToGeometricError(node: any): number;
35
+ /**
36
+ * Convert LOD metric from "Screen Threshold" to "Screen Space Error"
37
+ * @param node - i3s node data
38
+ * @returns lod metric in 3d-tiles format
39
+ */
40
+ export declare function convertScreenThresholdToGeometricError(node: Tile3D): number;
20
41
  //# sourceMappingURL=lod-conversion-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lod-conversion-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/lod-conversion-utils.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH;;;IAsBC;AAED,0EAeC"}
1
+ {"version":3,"file":"lod-conversion-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/lod-conversion-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAIzC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,sCAAsC,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe;gBAC9D,MAAM;cAAY,MAAM;IAqB1D;AAED;;;;GAIG;AACH,wBAAgB,sCAAsC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAe3E"}
@@ -5,8 +5,7 @@ exports.convertScreenThresholdToGeometricError = exports.convertGeometricErrorTo
5
5
  const DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR = 16;
6
6
  /**
7
7
  * Do conversion from geometric error to screen threshold
8
- * @param {Object} tile
9
- * @param {Object} coordinates
8
+ *
10
9
  * In 3DTiles we have HLOD logic and parent tile also has bigger lodMetric value then its children.
11
10
  * In I3s we have reverse logic related to maxError. Parent has lower maxError than its child.
12
11
  * In nodes where are no children tile.lodMetricValue is 0. This is because of logic of HLOD in 3DTiles
@@ -16,6 +15,21 @@ const DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR = 16;
16
15
  * https://github.com/Esri/i3s-spec/blob/master/docs/1.7/lodSelection.cmn.md
17
16
  * To avoid infinity values when we do calculations of maxError we shold replace 0 with value which allows us
18
17
  * to make child maxError bigger than his parent maxError.
18
+ *
19
+ * @param tile - 3d-tiles tile Object
20
+ * @param coordinates - node converted coordinates
21
+ * @returns An array of LOD metrics in format compatible with i3s 3DNodeIndexDocument.lodSelection
22
+ * @example
23
+ * [
24
+ {
25
+ "metricType": "maxScreenThresholdSQ",
26
+ "maxError": 870638.071285568
27
+ },
28
+ {
29
+ "metricType": "maxScreenThreshold",
30
+ "maxError": 1052.8679031638949
31
+ }
32
+ ]
19
33
  */
20
34
  function convertGeometricErrorToScreenThreshold(tile, coordinates) {
21
35
  const lodSelection = [];
@@ -40,6 +54,11 @@ function convertGeometricErrorToScreenThreshold(tile, coordinates) {
40
54
  return lodSelection;
41
55
  }
42
56
  exports.convertGeometricErrorToScreenThreshold = convertGeometricErrorToScreenThreshold;
57
+ /**
58
+ * Convert LOD metric from "Screen Threshold" to "Screen Space Error"
59
+ * @param node - i3s node data
60
+ * @returns lod metric in 3d-tiles format
61
+ */
43
62
  function convertScreenThresholdToGeometricError(node) {
44
63
  const metricData = node.header.lodSelection.maxScreenThreshold || {};
45
64
  let maxError = metricData.maxError;
@@ -0,0 +1,7 @@
1
+ export declare class Queue<T> extends Array<T> {
2
+ enqueue(val: T): void;
3
+ dequeue(): T | undefined;
4
+ peek(): T;
5
+ isEmpty(): boolean;
6
+ }
7
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/queue.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,CAAC;IAId,OAAO,IAAI,CAAC,GAAG,SAAS;IAIxB,IAAI,IAAI,CAAC;IAIT,OAAO;CAGR"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Queue = void 0;
4
+ class Queue extends Array {
5
+ enqueue(val) {
6
+ this.push(val);
7
+ }
8
+ dequeue() {
9
+ return this.shift();
10
+ }
11
+ peek() {
12
+ return this[0];
13
+ }
14
+ isEmpty() {
15
+ return this.length === 0;
16
+ }
17
+ }
18
+ exports.Queue = Queue;
@@ -1,3 +1,3 @@
1
- export function timeConverter(time: any): string;
2
- export function calculateFilesSize(params: any): Promise<number | null>;
1
+ export declare function timeConverter(time: any): string;
2
+ export declare function calculateFilesSize(params: any): Promise<number | null>;
3
3
  //# sourceMappingURL=statistic-utills.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"statistic-utills.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/statistic-utills.js"],"names":[],"mappings":"AAIA,iDA4BC;AAED,wEAkBC"}
1
+ {"version":3,"file":"statistic-utills.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/statistic-utills.ts"],"names":[],"mappings":"AAIA,wBAAgB,aAAa,CAAC,IAAI,KAAA,UA4BjC;AAED,wBAAsB,kBAAkB,CAAC,MAAM,KAAA,0BAkB9C"}
@@ -0,0 +1,22 @@
1
+ import { Queue } from './queue';
2
+ export declare type WriteQueueItem = {
3
+ archiveKey?: string;
4
+ writePromise: Promise<string>;
5
+ };
6
+ export default class WriteQueue<T extends WriteQueueItem> extends Queue<T> {
7
+ private intervalId?;
8
+ writePromise: Promise<void> | null;
9
+ fileMap: {
10
+ [key: string]: string;
11
+ };
12
+ listeningInterval: number;
13
+ writeConcurrency: number;
14
+ constructor(listeningInterval?: number, writeConcurrency?: number);
15
+ startListening(): void;
16
+ stopListening(): void;
17
+ startWrite(): Promise<void>;
18
+ finalize(): Promise<void>;
19
+ private doWrite;
20
+ private updateFileMap;
21
+ }
22
+ //# sourceMappingURL=write-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-queue.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/write-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAE9B,oBAAY,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,UAAU,CAAC,CAAiB;IAC7B,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAQ;IAC1C,OAAO,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAM;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;gBAEpB,iBAAiB,GAAE,MAAa,EAAE,gBAAgB,GAAE,MAAY;IAM5E,cAAc;IAId,aAAa;IAMP,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAKjB,OAAO;IAmBrB,OAAO,CAAC,aAAa;CAStB"}