@loaders.gl/tile-converter 4.0.0-alpha.8 → 4.0.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.
Files changed (300) hide show
  1. package/bin/i3s-server.js +4 -0
  2. package/bin/slpk-extractor.js +4 -0
  3. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +5 -5
  4. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
  5. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +10 -5
  6. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
  7. package/dist/3d-tiles-converter/helpers/load-i3s.d.ts +10 -0
  8. package/dist/3d-tiles-converter/helpers/load-i3s.d.ts.map +1 -0
  9. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts +2 -1
  10. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts.map +1 -1
  11. package/dist/converter.min.js +172 -103
  12. package/dist/deps-installer/deps-installer.d.ts +3 -2
  13. package/dist/deps-installer/deps-installer.d.ts.map +1 -1
  14. package/dist/dist.min.js +32718 -32568
  15. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +97 -117
  16. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  17. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +24 -22
  18. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  19. package/dist/es5/3d-tiles-converter/helpers/load-i3s.js +63 -0
  20. package/dist/es5/3d-tiles-converter/helpers/load-i3s.js.map +1 -0
  21. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
  22. package/dist/es5/converter-cli.js +25 -65
  23. package/dist/es5/converter-cli.js.map +1 -1
  24. package/dist/es5/deps-installer/deps-installer.js +115 -40
  25. package/dist/es5/deps-installer/deps-installer.js.map +1 -1
  26. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +45 -15
  27. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  28. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  29. package/dist/es5/i3s-converter/helpers/feature-attributes.js +8 -18
  30. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
  31. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +83 -43
  32. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  33. package/dist/es5/i3s-converter/helpers/geometry-converter.js +100 -102
  34. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  35. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  36. package/dist/es5/i3s-converter/helpers/load-3d-tiles.js +70 -4
  37. package/dist/es5/i3s-converter/helpers/load-3d-tiles.js.map +1 -1
  38. package/dist/es5/i3s-converter/helpers/node-index-document.js +3 -2
  39. package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -1
  40. package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +47 -12
  41. package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
  42. package/dist/es5/i3s-converter/i3s-converter.js +187 -174
  43. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  44. package/dist/es5/i3s-converter/types.js +11 -11
  45. package/dist/es5/i3s-converter/types.js.map +1 -1
  46. package/dist/es5/i3s-server/README.md +46 -2
  47. package/dist/es5/i3s-server/app.js +23 -15
  48. package/dist/es5/i3s-server/app.js.map +1 -1
  49. package/dist/es5/i3s-server/bin/www.js +33 -0
  50. package/dist/es5/i3s-server/bin/www.js.map +1 -0
  51. package/dist/es5/i3s-server/controllers/index-controller.js +23 -22
  52. package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -1
  53. package/dist/es5/i3s-server/controllers/slpk-controller.js +35 -38
  54. package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
  55. package/dist/es5/i3s-server/routes/index.js +2 -2
  56. package/dist/es5/i3s-server/routes/index.js.map +1 -1
  57. package/dist/es5/i3s-server/routes/slpk-router.js +14 -13
  58. package/dist/es5/i3s-server/routes/slpk-router.js.map +1 -1
  59. package/dist/es5/i3s-server/utils/create-scene-server.js +7 -4
  60. package/dist/es5/i3s-server/utils/create-scene-server.js.map +1 -1
  61. package/dist/es5/i3s-server/utils/server-utils.js +49 -0
  62. package/dist/es5/i3s-server/utils/server-utils.js.map +1 -0
  63. package/dist/es5/lib/utils/cli-utils.js +57 -0
  64. package/dist/es5/lib/utils/cli-utils.js.map +1 -0
  65. package/dist/es5/lib/utils/compress-util.js +1 -1
  66. package/dist/es5/lib/utils/compress-util.js.map +1 -1
  67. package/dist/es5/lib/utils/lod-conversion-utils.js +10 -4
  68. package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
  69. package/dist/es5/pgm-loader.js +11 -3
  70. package/dist/es5/pgm-loader.js.map +1 -1
  71. package/dist/es5/slpk-extractor/slpk-extractor.js +171 -0
  72. package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -0
  73. package/dist/es5/slpk-extractor-cli.js +117 -0
  74. package/dist/es5/slpk-extractor-cli.js.map +1 -0
  75. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +51 -58
  76. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  77. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +12 -11
  78. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  79. package/dist/esm/3d-tiles-converter/helpers/load-i3s.js +32 -0
  80. package/dist/esm/3d-tiles-converter/helpers/load-i3s.js.map +1 -0
  81. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
  82. package/dist/esm/converter-cli.js +8 -48
  83. package/dist/esm/converter-cli.js.map +1 -1
  84. package/dist/esm/deps-installer/deps-installer.js +40 -13
  85. package/dist/esm/deps-installer/deps-installer.js.map +1 -1
  86. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +28 -11
  87. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  88. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  89. package/dist/esm/i3s-converter/helpers/feature-attributes.js +10 -8
  90. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
  91. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +77 -34
  92. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  93. package/dist/esm/i3s-converter/helpers/geometry-converter.js +60 -61
  94. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  95. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  96. package/dist/esm/i3s-converter/helpers/load-3d-tiles.js +33 -4
  97. package/dist/esm/i3s-converter/helpers/load-3d-tiles.js.map +1 -1
  98. package/dist/esm/i3s-converter/helpers/node-index-document.js +2 -1
  99. package/dist/esm/i3s-converter/helpers/node-index-document.js.map +1 -1
  100. package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +37 -12
  101. package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
  102. package/dist/esm/i3s-converter/i3s-converter.js +101 -73
  103. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  104. package/dist/esm/i3s-converter/types.js +9 -9
  105. package/dist/esm/i3s-converter/types.js.map +1 -1
  106. package/dist/esm/i3s-server/README.md +46 -2
  107. package/dist/esm/i3s-server/app.js +13 -11
  108. package/dist/esm/i3s-server/app.js.map +1 -1
  109. package/dist/esm/i3s-server/bin/i3s-server.min.js +516 -0
  110. package/dist/esm/i3s-server/bin/www.js +30 -0
  111. package/dist/esm/i3s-server/bin/www.js.map +1 -0
  112. package/dist/esm/i3s-server/controllers/index-controller.js +4 -7
  113. package/dist/esm/i3s-server/controllers/index-controller.js.map +1 -1
  114. package/dist/esm/i3s-server/controllers/slpk-controller.js +9 -26
  115. package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
  116. package/dist/esm/i3s-server/routes/index.js +1 -1
  117. package/dist/esm/i3s-server/routes/index.js.map +1 -1
  118. package/dist/esm/i3s-server/routes/slpk-router.js +5 -11
  119. package/dist/esm/i3s-server/routes/slpk-router.js.map +1 -1
  120. package/dist/esm/i3s-server/utils/create-scene-server.js +2 -5
  121. package/dist/esm/i3s-server/utils/create-scene-server.js.map +1 -1
  122. package/dist/esm/i3s-server/utils/server-utils.js +40 -0
  123. package/dist/esm/i3s-server/utils/server-utils.js.map +1 -0
  124. package/dist/esm/lib/utils/cli-utils.js +47 -0
  125. package/dist/esm/lib/utils/cli-utils.js.map +1 -0
  126. package/dist/esm/lib/utils/compress-util.js +1 -1
  127. package/dist/esm/lib/utils/compress-util.js.map +1 -1
  128. package/dist/esm/lib/utils/lod-conversion-utils.js +6 -4
  129. package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
  130. package/dist/esm/pgm-loader.js +7 -4
  131. package/dist/esm/pgm-loader.js.map +1 -1
  132. package/dist/esm/slpk-extractor/slpk-extractor.js +63 -0
  133. package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -0
  134. package/dist/esm/slpk-extractor-cli.js +74 -0
  135. package/dist/esm/slpk-extractor-cli.js.map +1 -0
  136. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +15 -2
  137. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
  138. package/dist/i3s-converter/helpers/coordinate-converter.d.ts +1 -2
  139. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
  140. package/dist/i3s-converter/helpers/feature-attributes.d.ts +8 -8
  141. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
  142. package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -1
  143. package/dist/i3s-converter/helpers/geometry-converter.d.ts +9 -9
  144. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  145. package/dist/i3s-converter/helpers/gltf-attributes.d.ts +3 -3
  146. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
  147. package/dist/i3s-converter/helpers/load-3d-tiles.d.ts +15 -0
  148. package/dist/i3s-converter/helpers/load-3d-tiles.d.ts.map +1 -1
  149. package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -1
  150. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts +4 -5
  151. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -1
  152. package/dist/i3s-converter/i3s-converter.d.ts +3 -2
  153. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  154. package/dist/i3s-converter/types.d.ts +48 -7
  155. package/dist/i3s-converter/types.d.ts.map +1 -1
  156. package/dist/i3s-server/app.d.ts +1 -2
  157. package/dist/i3s-server/app.d.ts.map +1 -1
  158. package/dist/i3s-server/bin/www.d.ts +3 -0
  159. package/dist/i3s-server/bin/www.d.ts.map +1 -0
  160. package/dist/i3s-server/controllers/index-controller.d.ts +6 -1
  161. package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -1
  162. package/dist/i3s-server/controllers/slpk-controller.d.ts +13 -2
  163. package/dist/i3s-server/controllers/slpk-controller.d.ts.map +1 -1
  164. package/dist/i3s-server/routes/index.d.ts +1 -2
  165. package/dist/i3s-server/routes/index.d.ts.map +1 -1
  166. package/dist/i3s-server/routes/slpk-router.d.ts +2 -2
  167. package/dist/i3s-server/routes/slpk-router.d.ts.map +1 -1
  168. package/dist/i3s-server/utils/create-scene-server.d.ts +11 -5
  169. package/dist/i3s-server/utils/create-scene-server.d.ts.map +1 -1
  170. package/dist/i3s-server/utils/server-utils.d.ts +24 -0
  171. package/dist/i3s-server/utils/server-utils.d.ts.map +1 -0
  172. package/dist/lib/utils/cli-utils.d.ts +34 -0
  173. package/dist/lib/utils/cli-utils.d.ts.map +1 -0
  174. package/dist/lib/utils/lod-conversion-utils.d.ts +2 -2
  175. package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -1
  176. package/dist/pgm-loader.d.ts +9 -2
  177. package/dist/pgm-loader.d.ts.map +1 -1
  178. package/dist/slpk-extractor/slpk-extractor.d.ts +23 -0
  179. package/dist/slpk-extractor/slpk-extractor.d.ts.map +1 -0
  180. package/dist/slpk-extractor-cli.d.ts +17 -0
  181. package/dist/slpk-extractor-cli.d.ts.map +1 -0
  182. package/dist/slpk-extractor.min.js +189 -0
  183. package/package.json +28 -22
  184. package/src/3d-tiles-converter/3d-tiles-converter.ts +65 -69
  185. package/src/3d-tiles-converter/helpers/b3dm-converter.ts +23 -19
  186. package/src/3d-tiles-converter/helpers/load-i3s.ts +52 -0
  187. package/src/3d-tiles-converter/helpers/texture-atlas.ts +6 -2
  188. package/src/converter-cli.ts +16 -74
  189. package/src/deps-installer/deps-installer.ts +58 -12
  190. package/src/i3s-converter/helpers/batch-ids-extensions.ts +77 -32
  191. package/src/i3s-converter/helpers/coordinate-converter.ts +1 -2
  192. package/src/i3s-converter/helpers/feature-attributes.ts +23 -18
  193. package/src/i3s-converter/helpers/geometry-attributes.ts +81 -44
  194. package/src/i3s-converter/helpers/geometry-converter.ts +149 -126
  195. package/src/i3s-converter/helpers/gltf-attributes.ts +9 -10
  196. package/src/i3s-converter/helpers/load-3d-tiles.ts +61 -5
  197. package/src/i3s-converter/helpers/node-index-document.ts +5 -1
  198. package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +70 -21
  199. package/src/i3s-converter/i3s-converter.ts +145 -73
  200. package/src/i3s-converter/types.ts +49 -7
  201. package/src/i3s-server/README.md +46 -2
  202. package/src/i3s-server/{app.js → app.ts} +11 -9
  203. package/src/i3s-server/bin/www.ts +38 -0
  204. package/src/i3s-server/controllers/{index-controller.js → index-controller.ts} +10 -9
  205. package/src/i3s-server/controllers/slpk-controller.ts +32 -0
  206. package/src/i3s-server/routes/{index.js → index.ts} +2 -1
  207. package/src/i3s-server/routes/{slpk-router.js → slpk-router.ts} +5 -10
  208. package/src/i3s-server/utils/create-scene-server.ts +20 -0
  209. package/src/i3s-server/utils/server-utils.ts +70 -0
  210. package/src/lib/utils/cli-utils.ts +78 -0
  211. package/src/lib/utils/compress-util.ts +1 -1
  212. package/src/lib/utils/lod-conversion-utils.ts +10 -6
  213. package/src/pgm-loader.ts +15 -7
  214. package/src/slpk-extractor/slpk-extractor.ts +101 -0
  215. package/src/slpk-extractor-cli.ts +128 -0
  216. package/dist/3d-tiles-attributes-worker.d.ts +0 -28
  217. package/dist/3d-tiles-attributes-worker.d.ts.map +0 -1
  218. package/dist/3d-tiles-attributes-worker.js +0 -3
  219. package/dist/3d-tiles-attributes-worker.js.map +0 -7
  220. package/dist/3d-tiles-converter/3d-tiles-converter.js +0 -288
  221. package/dist/3d-tiles-converter/helpers/b3dm-converter.js +0 -269
  222. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +0 -23
  223. package/dist/3d-tiles-converter/helpers/texture-atlas.js +0 -52
  224. package/dist/3d-tiles-converter/json-templates/tileset.js +0 -43
  225. package/dist/bundle.js +0 -5
  226. package/dist/constants.js +0 -4
  227. package/dist/converter-cli.js +0 -280
  228. package/dist/deps-installer/deps-installer.js +0 -62
  229. package/dist/es5/3d-tiles-attributes-worker.js +0 -25
  230. package/dist/es5/3d-tiles-attributes-worker.js.map +0 -1
  231. package/dist/es5/i3s-attributes-worker.js +0 -25
  232. package/dist/es5/i3s-attributes-worker.js.map +0 -1
  233. package/dist/es5/i3s-server/bin/www +0 -102
  234. package/dist/es5/workers/3d-tiles-attributes-worker.js +0 -28
  235. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +0 -1
  236. package/dist/es5/workers/i3s-attributes-worker.js +0 -30
  237. package/dist/es5/workers/i3s-attributes-worker.js.map +0 -1
  238. package/dist/esm/3d-tiles-attributes-worker.js +0 -16
  239. package/dist/esm/3d-tiles-attributes-worker.js.map +0 -1
  240. package/dist/esm/i3s-attributes-worker.js +0 -16
  241. package/dist/esm/i3s-attributes-worker.js.map +0 -1
  242. package/dist/esm/i3s-server/bin/www +0 -102
  243. package/dist/esm/workers/3d-tiles-attributes-worker.js +0 -8
  244. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +0 -1
  245. package/dist/esm/workers/i3s-attributes-worker.js +0 -7
  246. package/dist/esm/workers/i3s-attributes-worker.js.map +0 -1
  247. package/dist/i3s-attributes-worker.d.ts +0 -45
  248. package/dist/i3s-attributes-worker.d.ts.map +0 -1
  249. package/dist/i3s-attributes-worker.js +0 -9
  250. package/dist/i3s-attributes-worker.js.map +0 -7
  251. package/dist/i3s-converter/helpers/batch-ids-extensions.js +0 -138
  252. package/dist/i3s-converter/helpers/coordinate-converter.js +0 -123
  253. package/dist/i3s-converter/helpers/create-scene-server-path.js +0 -28
  254. package/dist/i3s-converter/helpers/feature-attributes.js +0 -216
  255. package/dist/i3s-converter/helpers/geometry-attributes.js +0 -202
  256. package/dist/i3s-converter/helpers/geometry-converter.js +0 -1225
  257. package/dist/i3s-converter/helpers/gltf-attributes.js +0 -128
  258. package/dist/i3s-converter/helpers/load-3d-tiles.js +0 -53
  259. package/dist/i3s-converter/helpers/node-debug.js +0 -120
  260. package/dist/i3s-converter/helpers/node-index-document.js +0 -268
  261. package/dist/i3s-converter/helpers/node-pages.js +0 -316
  262. package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +0 -76
  263. package/dist/i3s-converter/helpers/tileset-traversal.js +0 -29
  264. package/dist/i3s-converter/i3s-converter.js +0 -911
  265. package/dist/i3s-converter/json-templates/geometry-definitions.js +0 -87
  266. package/dist/i3s-converter/json-templates/layers.js +0 -139
  267. package/dist/i3s-converter/json-templates/metadata.js +0 -25
  268. package/dist/i3s-converter/json-templates/node.js +0 -89
  269. package/dist/i3s-converter/json-templates/scene-server.js +0 -31
  270. package/dist/i3s-converter/json-templates/shared-resources.js +0 -129
  271. package/dist/i3s-converter/json-templates/store.js +0 -103
  272. package/dist/i3s-converter/types.js +0 -17
  273. package/dist/i3s-server/app.js +0 -22
  274. package/dist/i3s-server/controllers/index-controller.js +0 -23
  275. package/dist/i3s-server/controllers/slpk-controller.js +0 -32
  276. package/dist/i3s-server/routes/index.js +0 -16
  277. package/dist/i3s-server/routes/slpk-router.js +0 -33
  278. package/dist/i3s-server/utils/create-scene-server.js +0 -14
  279. package/dist/index.js +0 -10
  280. package/dist/lib/utils/compress-util.js +0 -257
  281. package/dist/lib/utils/file-utils.js +0 -139
  282. package/dist/lib/utils/geometry-utils.js +0 -18
  283. package/dist/lib/utils/lod-conversion-utils.js +0 -76
  284. package/dist/lib/utils/queue.js +0 -18
  285. package/dist/lib/utils/statistic-utills.js +0 -64
  286. package/dist/lib/utils/write-queue.js +0 -80
  287. package/dist/pgm-loader.js +0 -24
  288. package/dist/workers/3d-tiles-attributes-worker.d.ts +0 -2
  289. package/dist/workers/3d-tiles-attributes-worker.d.ts.map +0 -1
  290. package/dist/workers/3d-tiles-attributes-worker.js +0 -9
  291. package/dist/workers/i3s-attributes-worker.d.ts +0 -2
  292. package/dist/workers/i3s-attributes-worker.d.ts.map +0 -1
  293. package/dist/workers/i3s-attributes-worker.js +0 -5
  294. package/src/3d-tiles-attributes-worker.ts +0 -43
  295. package/src/i3s-attributes-worker.ts +0 -59
  296. package/src/i3s-server/bin/www +0 -102
  297. package/src/i3s-server/controllers/slpk-controller.js +0 -38
  298. package/src/i3s-server/utils/create-scene-server.js +0 -15
  299. package/src/workers/3d-tiles-attributes-worker.ts +0 -6
  300. package/src/workers/i3s-attributes-worker.ts +0 -7
@@ -1,8 +1,16 @@
1
1
  /* eslint-disable no-console */
2
2
  import '@loaders.gl/polyfills';
3
3
  import {join} from 'path';
4
+ import inquirer from 'inquirer';
4
5
  import {I3SConverter, Tiles3DConverter} from '@loaders.gl/tile-converter';
5
6
  import {DepsInstaller} from './deps-installer/deps-installer';
7
+ import {
8
+ getBooleanValue,
9
+ getIntegerValue,
10
+ getStringValue,
11
+ getURLValue,
12
+ validateOptionsWithEqual
13
+ } from './lib/utils/cli-utils';
6
14
 
7
15
  type TileConversionOptions = {
8
16
  /** "I3S" - for I3S to 3DTiles conversion, "3DTILES" for 3DTiles to I3S conversion */
@@ -42,6 +50,8 @@ type TileConversionOptions = {
42
50
  maxDepth?: number;
43
51
  /** 3DTiles->I3S only. Whether the converter generates *.slpk (Scene Layer Package) I3S output file */
44
52
  slpk: boolean;
53
+ /** Feature metadata class from EXT_FEATURE_METADATA or EXT_STRUCTURAL_METADATA extensions */
54
+ metadataClass?: string;
45
55
  };
46
56
 
47
57
  /* During validation we check that particular options are defined so they can't be undefined */
@@ -125,8 +135,9 @@ function printHelp(): void {
125
135
  console.log(
126
136
  '--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]'
127
137
  );
138
+ console.log('--generate-bounding-volumes [Generate obb and mbs bounding volumes from geometry]');
128
139
  console.log(
129
- '--generate-bounding-volumes [Will generate obb and mbs bounding volumes from geometry]'
140
+ '--metadata-class [One of the list of feature metadata classes, detected by converter on "analyze" stage, default: not set]'
130
141
  );
131
142
  console.log('--validate [Enable validation]');
132
143
  process.exit(0); // eslint-disable-line
@@ -168,7 +179,8 @@ async function convert(options: ValidatedTileConversionOptions) {
168
179
  generateTextures: options.generateTextures,
169
180
  generateBoundingVolumes: options.generateBoundingVolumes,
170
181
  validate: options.validate,
171
- instantNodeWriting: options.instantNodeWriting
182
+ instantNodeWriting: options.instantNodeWriting,
183
+ inquirer
172
184
  });
173
185
  break;
174
186
  default:
@@ -213,19 +225,6 @@ function validateOptions(options: TileConversionOptions): ValidatedTileConversio
213
225
  return <ValidatedTileConversionOptions>options;
214
226
  }
215
227
 
216
- function validateOptionsWithEqual(args: string[]): string[] {
217
- return args.reduce((acc: string[], curr) => {
218
- const equalSignIndex = curr.indexOf('=');
219
- const beforeEqual = curr.slice(0, equalSignIndex);
220
- const afterEqual = curr.slice(equalSignIndex + 1, curr.length);
221
- const condition = curr.includes('=') && curr.startsWith('--') && afterEqual;
222
- if (condition) {
223
- return acc.concat(beforeEqual, afterEqual);
224
- }
225
- return acc.concat(curr);
226
- }, []);
227
- }
228
-
229
228
  /**
230
229
  * Parse option from the cli arguments array
231
230
  * @param args
@@ -298,6 +297,8 @@ function parseOptions(args: string[]): TileConversionOptions {
298
297
  case '--generate-bounding-volumes':
299
298
  opts.generateBoundingVolumes = getBooleanValue(index, args);
300
299
  break;
300
+ case '--metadata-class':
301
+ opts.metadataClass = getStringValue(index, args);
301
302
  case '--help':
302
303
  printHelp();
303
304
  break;
@@ -309,62 +310,3 @@ function parseOptions(args: string[]): TileConversionOptions {
309
310
  });
310
311
  return opts;
311
312
  }
312
-
313
- /**
314
- * Get string option value from cli arguments
315
- * @param index - option's name index in the argument's array.
316
- * The value of the option should be next to name of the option.
317
- * @param args - cli arguments array
318
- * @returns - string value of the option
319
- */
320
- function getStringValue(index: number, args: string[]): string {
321
- if (index + 1 >= args.length) {
322
- return '';
323
- }
324
- const value = args[index + 1];
325
- if (value.indexOf('--') === 0) {
326
- return '';
327
- }
328
- return value;
329
- }
330
-
331
- /**
332
- * Modyfy URL path to be compatible with fetch
333
- * @param index - option's name index in the argument's array.
334
- * The value of the option should be next to name of the option.
335
- * @param args - cli arguments array
336
- * @returns - string value of the option
337
- */
338
- function getURLValue(index: number, args: string[]): string {
339
- const value = getStringValue(index, args);
340
- console.log(`Input tileset value: ${value}`);
341
- console.log(`Modified tileset value: ${value.replace(/\\/g, '/')}`);
342
- return value.replace(/\\/g, '/');
343
- }
344
-
345
- /**
346
- * Get integer option value from cli arguments
347
- * @param index - option's name index in the argument's array
348
- * The value of the option should be next to name of the option.
349
- * @param args - cli arguments array
350
- * @returns - number value of the option
351
- */
352
- function getIntegerValue(index: number, args: string[]): number {
353
- const stringValue: string = getStringValue(index, args);
354
- const result: number = Number.parseInt(stringValue);
355
- if (isFinite(result)) {
356
- return result;
357
- }
358
- return NaN;
359
- }
360
-
361
- function getBooleanValue(index: number, args: string[]): boolean {
362
- const stringValue: string = getStringValue(index, args).toLowerCase().trim();
363
- if (['--no-draco', '--split-nodes'].includes(args[index]) && !stringValue) {
364
- return false;
365
- }
366
- if (!stringValue || stringValue === 'true') {
367
- return true;
368
- }
369
- return false;
370
- }
@@ -3,6 +3,8 @@ import {ZipLoader} from '@loaders.gl/zip';
3
3
  import {writeFile} from '../lib/utils/file-utils';
4
4
  import {join} from 'path';
5
5
  import {ChildProcessProxy} from '@loaders.gl/worker-utils';
6
+ import {DRACO_EXTERNAL_LIBRARIES, DRACO_EXTERNAL_LIBRARY_URLS} from '@loaders.gl/draco';
7
+ import {BASIS_EXTERNAL_LIBRARIES} from '@loaders.gl/textures';
6
8
 
7
9
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
8
10
  const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';
@@ -23,7 +25,7 @@ export class DepsInstaller {
23
25
  * This path is '' by default and is not used by tile-converter.
24
26
  * It is used in tests to prevent rewriting actual workers during tests running
25
27
  */
26
- async install(path: string = '', workersPath: string = ''): Promise<void> {
28
+ async install(path: string = ''): Promise<void> {
27
29
  console.log('Installing "EGM2008-5" model...'); // eslint-disable-line no-console
28
30
  const fileMap = await load(PGM_LINK, ZipLoader, {});
29
31
 
@@ -34,38 +36,82 @@ export class DepsInstaller {
34
36
 
35
37
  await writeFile(depsPath, new Uint8Array(fileMap['geoids/egm2008-5.pgm']), 'egm2008-5.pgm');
36
38
 
37
- console.log('Installing "I3S Content Loader worker"'); // eslint-disable-line no-console
38
- await this.installWorker('i3s', 'i3s-content-worker-node.js', workersPath);
39
+ console.log('Installing "I3S Content Loader" worker'); // eslint-disable-line no-console
40
+ await this.installFromNpm('i3s', 'i3s-content-worker-node.js');
39
41
 
40
- console.log('Installing "Draco Loader worker"'); // eslint-disable-line no-console
41
- await this.installWorker('draco', 'draco-worker-node.js', workersPath);
42
+ console.log('Installing "Draco Loader" worker'); // eslint-disable-line no-console
43
+ await this.installFromNpm('draco', 'draco-worker-node.js');
42
44
 
43
- console.log('Installing "Basis Loader worker"'); // eslint-disable-line no-console
44
- await this.installWorker('textures', 'basis-worker-node.js', workersPath);
45
+ console.log('Installing "Draco Writer" worker'); // eslint-disable-line no-console
46
+ await this.installFromNpm('draco', 'draco-writer-worker-node.js');
47
+
48
+ console.log('Installing "Basis Loader" worker'); // eslint-disable-line no-console
49
+ await this.installFromNpm('textures', 'basis-worker-node.js');
50
+
51
+ console.log('Installing "KTX2 Basis Writer" worker'); // eslint-disable-line no-console
52
+ await this.installFromNpm('textures', 'ktx2-basis-writer-worker-node.js');
53
+
54
+ console.log('Installing "Draco decoder" library'); // eslint-disable-line no-console
55
+ await this.installFromUrl(
56
+ DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER],
57
+ 'draco',
58
+ DRACO_EXTERNAL_LIBRARIES.DECODER
59
+ );
60
+ await this.installFromUrl(
61
+ DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM],
62
+ 'draco',
63
+ DRACO_EXTERNAL_LIBRARIES.DECODER_WASM
64
+ );
65
+
66
+ console.log('Installing "Draco encoder" library'); // eslint-disable-line no-console
67
+ await this.installFromUrl(
68
+ DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.ENCODER],
69
+ 'draco',
70
+ DRACO_EXTERNAL_LIBRARIES.ENCODER
71
+ );
72
+
73
+ console.log('Installing "Basis transcoder" library'); // eslint-disable-line no-console
74
+ await this.installFromNpm('textures', BASIS_EXTERNAL_LIBRARIES.TRANSCODER, 'libs');
75
+ await this.installFromNpm('textures', BASIS_EXTERNAL_LIBRARIES.TRANSCODER_WASM, 'libs');
76
+
77
+ console.log('Installing "Basis encoder" library'); // eslint-disable-line no-console
78
+ await this.installFromNpm('textures', BASIS_EXTERNAL_LIBRARIES.ENCODER, 'libs');
79
+ await this.installFromNpm('textures', BASIS_EXTERNAL_LIBRARIES.ENCODER_WASM, 'libs');
45
80
 
46
81
  console.log('Installing "join-images" npm package');
47
82
  const childProcess = new ChildProcessProxy();
48
83
  await childProcess.start({
49
- command: 'npm',
84
+ command: process.platform === 'win32' ? 'npm.cmd' : 'npm',
50
85
  // `npm install sharp join-images` works unstable. It fails because installed `sharp` version
51
86
  // may be different from the version required by `join-images`. Pointing to specific versions
52
87
  // resolve this issue
53
88
  arguments: ['install', 'sharp@0.30.4', 'join-images@1.1.3'],
54
- wait: 0
89
+ wait: 0,
90
+ ignoreStderr: true
55
91
  });
56
92
 
57
93
  console.log('All dependencies were installed succesfully.'); // eslint-disable-line no-console
58
94
  }
59
95
 
60
- private async installWorker(module: string, name: string, extraPath: string) {
96
+ private async installFromNpm(module: string, name: string, extraPath: string = '') {
61
97
  const fileResponse = await fetchFile(
62
- `https://unpkg.com/@loaders.gl/${module}@${VERSION}/dist/${name}`
98
+ `https://unpkg.com/@loaders.gl/${module}@${VERSION}/dist/${extraPath}/${name}`
63
99
  );
64
100
  const fileData = await fileResponse.arrayBuffer();
65
101
  if (!fileData) {
66
102
  return;
67
103
  }
68
- const path = join(process.cwd(), extraPath, 'modules', module, 'dist');
104
+ const path = join(process.cwd(), 'modules', module, 'dist', extraPath);
105
+ await writeFile(path, fileData, name);
106
+ }
107
+
108
+ private async installFromUrl(url: string, module: string, name: string) {
109
+ const fileResponse = await fetchFile(url);
110
+ const fileData = await fileResponse.arrayBuffer();
111
+ if (!fileData) {
112
+ return;
113
+ }
114
+ const path = join(process.cwd(), 'modules', module, 'dist', 'libs');
69
115
  await writeFile(path, fileData, name);
70
116
  }
71
117
  }
@@ -1,30 +1,64 @@
1
1
  import {GLTFAccessorPostprocessed, GLTFMeshPrimitivePostprocessed} from '@loaders.gl/gltf';
2
2
  import type {NumericArray} from '@loaders.gl/loader-utils';
3
3
  import type {
4
- GLTF_EXT_feature_metadata_attribute,
5
- GLTF_EXT_feature_metadata_primitive
4
+ GLTF_EXT_feature_metadata_FeatureIdTexture,
5
+ GLTF_EXT_feature_metadata_GLTF,
6
+ GLTF_EXT_feature_metadata_Primitive
6
7
  } from '@loaders.gl/gltf';
8
+
9
+ import type {GLTF_EXT_mesh_features} from '@loaders.gl/gltf';
10
+
7
11
  import {TypedArray} from '@math.gl/core';
8
- import {TextureImageProperties} from '../../i3s-attributes-worker';
12
+ import {TextureImageProperties} from '../types';
13
+ import {emod} from '@loaders.gl/math';
14
+ import {EXT_MESH_FEATURES, EXT_FEATURE_METADATA} from '@loaders.gl/gltf';
15
+ import {Tiles3DTileContent} from '@loaders.gl/3d-tiles';
9
16
 
10
- const EXT_MESH_FEATURES = 'EXT_mesh_features';
11
- const EXT_FEATURE_METADATA = 'EXT_feature_metadata';
17
+ /**
18
+ * Get featureTexture by a metadata class.
19
+ * Metadata classes come from a structural metadata extesion (EXT_feature_metadata or EXT_structural_metadata).
20
+ * The glTF might contain multiple texel-level metadata textures related to different classes. Having only one metadata class
21
+ * selected to convert to I3S, we have to pick only one texture to convert to per-vertex property.
22
+ * @param tileContent - 3d tile content
23
+ * @param metadataClass - user selected feature metadata class name
24
+ * @returns featureTexture key
25
+ */
26
+ export function getTextureByMetadataClass(
27
+ tileContent: Tiles3DTileContent,
28
+ metadataClass?: string
29
+ ): string | null {
30
+ const extFeatureMetadata = tileContent.gltf?.extensions?.[
31
+ EXT_FEATURE_METADATA
32
+ ] as GLTF_EXT_feature_metadata_GLTF;
33
+ if (!extFeatureMetadata?.featureTextures) {
34
+ return null;
35
+ }
36
+ for (const textureKey in extFeatureMetadata.featureTextures) {
37
+ const texture = extFeatureMetadata.featureTextures[textureKey];
38
+ if (texture.class === metadataClass) {
39
+ return textureKey;
40
+ }
41
+ }
42
+ return null;
43
+ }
12
44
 
13
45
  /**
14
46
  * Getting batchIds from 3DTilesNext extensions.
15
47
  * @param attributes - gltf accessors
16
48
  * @param primitive - gltf primitive data
17
49
  * @param images - gltf texture images
50
+ * @param featureTexture - feature texture key
51
+ * @return array of batch IDs
18
52
  */
19
53
  export function handleBatchIdsExtensions(
20
54
  attributes: {
21
55
  [key: string]: GLTFAccessorPostprocessed;
22
56
  },
23
57
  primitive: GLTFMeshPrimitivePostprocessed,
24
- images: (TextureImageProperties | null)[]
58
+ images: (TextureImageProperties | null)[],
59
+ featureTexture: string | null
25
60
  ): NumericArray {
26
61
  const extensions = primitive?.extensions;
27
-
28
62
  if (!extensions) {
29
63
  return [];
30
64
  }
@@ -34,12 +68,12 @@ export function handleBatchIdsExtensions(
34
68
  case EXT_FEATURE_METADATA:
35
69
  return handleExtFeatureMetadataExtension(
36
70
  attributes,
37
- extensionData as GLTF_EXT_feature_metadata_primitive,
38
- images
71
+ extensionData as GLTF_EXT_feature_metadata_Primitive,
72
+ images,
73
+ featureTexture
39
74
  );
40
75
  case EXT_MESH_FEATURES:
41
- console.warn('EXT_mesh_features extension is not supported yet');
42
- return [];
76
+ return handleExtMeshFeaturesExtension(attributes, extensionData as GLTF_EXT_mesh_features);
43
77
  default:
44
78
  return [];
45
79
  }
@@ -48,19 +82,43 @@ export function handleBatchIdsExtensions(
48
82
  return [];
49
83
  }
50
84
 
85
+ /**
86
+ * Getting batchIds from EXT_mesh_features extensions.
87
+ * @param attributes - gltf accessors
88
+ * @param extMeshFeatures - EXT_mesh_features extension
89
+ * @returns an array of attribute values
90
+ */
91
+ function handleExtMeshFeaturesExtension(
92
+ attributes: {
93
+ [key: string]: GLTFAccessorPostprocessed;
94
+ },
95
+ extMeshFeatures: GLTF_EXT_mesh_features
96
+ ): NumericArray {
97
+ for (let ids of extMeshFeatures.featureIds) {
98
+ if (typeof ids.propertyTable !== 'undefined') {
99
+ // propertyTable is an index that can be 0
100
+ // return the first featureID set that corresponts to property table.
101
+ return ids.data as NumericArray;
102
+ }
103
+ }
104
+ return [];
105
+ }
106
+
51
107
  /**
52
108
  * Get batchIds from EXT_feature_metadata extension.
53
- * Docs - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata
54
- * @param attributes
55
- * @param extFeatureMetadata
56
- * @param textures
109
+ * @see - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata
110
+ * @param attributes - glTF attributes
111
+ * @param extFeatureMetadata - primitive-level EXT_FEATURE_METADATA extension data
112
+ * @param textures - texture images
113
+ * @param featureTexture - feature texture key
57
114
  */
58
115
  function handleExtFeatureMetadataExtension(
59
116
  attributes: {
60
117
  [key: string]: GLTFAccessorPostprocessed;
61
118
  },
62
- extFeatureMetadata: GLTF_EXT_feature_metadata_primitive,
63
- images: (TextureImageProperties | null)[]
119
+ extFeatureMetadata: GLTF_EXT_feature_metadata_Primitive,
120
+ images: (TextureImageProperties | null)[],
121
+ featureTexture: string | null
64
122
  ): NumericArray {
65
123
  // Take only first extension object to get batchIds attribute name.
66
124
  const featureIdAttribute = extFeatureMetadata?.featureIdAttributes?.[0];
@@ -93,10 +151,6 @@ function handleExtFeatureMetadataExtension(
93
151
  return generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images);
94
152
  }
95
153
 
96
- // Take only first extension texture to get batchIds from the root EXT_feature_metadata object.
97
- const featureTexture =
98
- extFeatureMetadata?.featureTextures && extFeatureMetadata?.featureTextures[0];
99
-
100
154
  if (featureTexture) {
101
155
  const batchIdsAttribute = attributes[featureTexture];
102
156
  return batchIdsAttribute.value;
@@ -107,7 +161,7 @@ function handleExtFeatureMetadataExtension(
107
161
 
108
162
  /**
109
163
  * Generates implicit feature ids
110
- * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#implicit-feature-ids
164
+ * @see - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#implicit-feature-ids
111
165
  * @param featuresCount
112
166
  * @param constant
113
167
  * @param devisor
@@ -146,7 +200,7 @@ function generateImplicitFeatureIds(
146
200
  * @param featureIdTextures
147
201
  */
148
202
  function generateBatchIdsFromTexture(
149
- featureIdTexture: GLTF_EXT_feature_metadata_attribute,
203
+ featureIdTexture: GLTF_EXT_feature_metadata_FeatureIdTexture,
150
204
  textureCoordinates: TypedArray,
151
205
  images: (TextureImageProperties | null)[]
152
206
  ) {
@@ -191,12 +245,3 @@ function generateBatchIdsFromTexture(
191
245
 
192
246
  return batchIds;
193
247
  }
194
-
195
- /**
196
- * Handle UVs if they are out of range [0,1].
197
- * @param n
198
- * @param m
199
- */
200
- function emod(n: number): number {
201
- return ((n % 1) + 1) % 1;
202
- }
@@ -103,7 +103,6 @@ export function convertPositionsToVectors(positions: Float32Array): Vector3[] {
103
103
 
104
104
  /**
105
105
  * Convert common coordinate to fullExtent https://github.com/Esri/i3s-spec/blob/master/docs/1.8/fullExtent.cmn.md
106
- * @param
107
106
  * @param boundingVolume
108
107
  * @returns - fullExtent object
109
108
  */
@@ -142,7 +141,7 @@ export function convertBoundingVolumeToI3SFullExtent(
142
141
  /**
143
142
  * Creates oriented boundinb box from mbs.
144
143
  * @param mbs - Minimum Bounding Sphere
145
- * @returns - Oriented BOunding Box
144
+ * @returns - Oriented Bounding Box
146
145
  */
147
146
  export function createObbFromMbs(mbs: Mbs): Obb {
148
147
  const radius = mbs[3];
@@ -9,26 +9,26 @@ import {
9
9
  } from '@loaders.gl/i3s';
10
10
 
11
11
  /**
12
- * Takes attributes from property table based on featureIds.
12
+ * Takes attributes from property table based on featureIdsMap.
13
13
  * If there is no property value for particular featureId (index) the property will be null.
14
14
  * Example:
15
15
  * Initial data:
16
- * OBJECTID: [0, 1, 5]
16
+ * OBJECTID: {0: 0, 3: 33, 4: 333}
17
17
  * component: ['Windows', 'Frames', 'Wall', 'Roof', 'Skylight']
18
18
  * Result:
19
- * OBJECTID: [0, 1, 5]
20
- * component: ['Windows', 'Frames', 'null']
21
- * @param featureIds
19
+ * OBJECTID: [0, 33, 333]
20
+ * component: ['Windows', 'Roof', 'Skylight']
21
+ * @param featureIdsMap
22
22
  * @param propertyTable
23
23
  */
24
24
  export function flattenPropertyTableByFeatureIds(
25
- featureIds: number[],
25
+ featureIdsMap: Record<string, number>,
26
26
  propertyTable: FeatureTableJson
27
27
  ): FeatureTableJson {
28
28
  const resultPropertyTable: FeatureTableJson = {};
29
29
  for (const propertyName in propertyTable) {
30
30
  const properties = propertyTable[propertyName];
31
- resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties, featureIds);
31
+ resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties, featureIdsMap);
32
32
  }
33
33
 
34
34
  return resultPropertyTable;
@@ -37,14 +37,19 @@ export function flattenPropertyTableByFeatureIds(
37
37
  /**
38
38
  * Getting properties by featureId index
39
39
  * @param properties
40
- * @param featureIds
40
+ * @param featureIdsMap
41
41
  */
42
- function getPropertiesByFeatureIds(properties: any[], featureIds: number[]): any[] {
43
- const resultProperties: any = [];
44
-
45
- for (const featureId of featureIds) {
46
- const property = properties[featureId] || null;
47
- resultProperties.push(property);
42
+ function getPropertiesByFeatureIds(
43
+ properties: unknown[],
44
+ featureIdsMap: Record<string, number>
45
+ ): unknown[] {
46
+ const resultProperties: unknown[] = [];
47
+
48
+ if (properties) {
49
+ for (const featureIdKey in featureIdsMap) {
50
+ const property = properties[featureIdKey] || null;
51
+ resultProperties.push(property);
52
+ }
48
53
  }
49
54
 
50
55
  return resultProperties;
@@ -64,7 +69,7 @@ export function checkPropertiesLength(
64
69
  let needFlatten = false;
65
70
 
66
71
  for (const attribute of Object.values(propertyTable)) {
67
- if (featureIds.length !== attribute.length) {
72
+ if (!featureIds || !attribute || featureIds.length !== attribute.length) {
68
73
  needFlatten = true;
69
74
  }
70
75
  }
@@ -83,13 +88,13 @@ const OBJECT_ID_TYPE = 'OBJECTID';
83
88
  /**
84
89
  * Get the attribute type for attributeStorageInfo https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md
85
90
  * @param key - attribute's key
86
- * @param attribute - attribute's type in propertyTable
91
+ * @param attribute - attribute taken from propertyTable
87
92
  */
88
- export function getAttributeType(key: string, attribute: string): string {
93
+ export function getAttributeType(key: string, attribute: unknown): string {
89
94
  if (key === OBJECT_ID_TYPE) {
90
95
  return OBJECT_ID_TYPE;
91
96
  }
92
- if (typeof attribute === STRING_TYPE) {
97
+ if (typeof attribute === STRING_TYPE || typeof attribute === 'bigint') {
93
98
  return STRING_TYPE;
94
99
  } else if (typeof attribute === 'number') {
95
100
  return Number.isInteger(attribute) ? SHORT_INT_TYPE : DOUBLE_TYPE;