@loaders.gl/tile-converter 4.0.0-alpha.9 → 4.0.0-beta.2

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 +32715 -32567
  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 +113 -39
  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 +38 -12
  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 +27 -21
  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 +56 -11
  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 -63
  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
@@ -25,6 +25,7 @@ var _batchIdsExtensions = require("./batch-ids-extensions");
25
25
  var _featureAttributes = require("./feature-attributes");
26
26
  var _math = require("@loaders.gl/math");
27
27
  var _geometryUtils = require("../../lib/utils/geometry-utils");
28
+ var _gltf = require("@loaders.gl/gltf");
28
29
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
30
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
30
31
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -42,16 +43,14 @@ var SHORT_INT_TYPE = 'Int32';
42
43
  var DOUBLE_TYPE = 'Float64';
43
44
  var OBJECT_ID_TYPE = 'Oid32';
44
45
  var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ['CUSTOM_ATTRIBUTE_2', '_BATCHID', 'BATCHID'];
45
- var EXT_FEATURE_METADATA = 'EXT_feature_metadata';
46
- var EXT_MESH_FEATURES = 'EXT_mesh_features';
47
46
  var scratchVector = new _core.Vector3();
48
- function convertB3dmToI3sGeometry(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12) {
47
+ function convertB3dmToI3sGeometry(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12, _x13) {
49
48
  return _convertB3dmToI3sGeometry.apply(this, arguments);
50
49
  }
51
50
  function _convertB3dmToI3sGeometry() {
52
- _convertB3dmToI3sGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(tileContent, tileTransform, tileBoundingVolume, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, shouldMergeMaterials, geoidHeightModel, workerSource) {
51
+ _convertB3dmToI3sGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(tileContent, tileTransform, tileBoundingVolume, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, shouldMergeMaterials, geoidHeightModel, libraries, metadataClass) {
53
52
  var _tileContent$gltf4;
54
- var useCartesianPositions, materialAndTextureList, dataForAttributesConversion, convertedAttributesMap, result, _iterator6, _step6, materialAndTexture, originarMaterialId, convertedAttributes, material, texture, nodeId;
53
+ var useCartesianPositions, materialAndTextureList, dataForAttributesConversion, featureTexture, convertedAttributesMap, result, _iterator6, _step6, materialAndTexture, originarMaterialId, convertedAttributes, material, texture, nodeId;
55
54
  return _regenerator.default.wrap(function _callee$(_context) {
56
55
  while (1) switch (_context.prev = _context.next) {
57
56
  case 0:
@@ -61,44 +60,45 @@ function _convertB3dmToI3sGeometry() {
61
60
  case 3:
62
61
  materialAndTextureList = _context.sent;
63
62
  dataForAttributesConversion = (0, _gltfAttributes.prepareDataForAttributesConversion)(tileContent, tileTransform, tileBoundingVolume);
64
- _context.next = 7;
65
- return convertAttributes(dataForAttributesConversion, materialAndTextureList, useCartesianPositions);
66
- case 7:
63
+ featureTexture = (0, _batchIdsExtensions.getTextureByMetadataClass)(tileContent, metadataClass);
64
+ _context.next = 8;
65
+ return convertAttributes(dataForAttributesConversion, materialAndTextureList, useCartesianPositions, featureTexture);
66
+ case 8:
67
67
  convertedAttributesMap = _context.sent;
68
68
  if (generateBoundingVolumes) {
69
69
  _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeightModel);
70
70
  }
71
71
  result = [];
72
72
  _iterator6 = _createForOfIteratorHelper(materialAndTextureList);
73
- _context.prev = 11;
73
+ _context.prev = 12;
74
74
  _iterator6.s();
75
- case 13:
75
+ case 14:
76
76
  if ((_step6 = _iterator6.n()).done) {
77
- _context.next = 32;
77
+ _context.next = 33;
78
78
  break;
79
79
  }
80
80
  materialAndTexture = _step6.value;
81
81
  originarMaterialId = materialAndTexture.mergedMaterials[0].originalMaterialId;
82
82
  if (convertedAttributesMap.has(originarMaterialId)) {
83
- _context.next = 18;
83
+ _context.next = 19;
84
84
  break;
85
85
  }
86
- return _context.abrupt("continue", 30);
87
- case 18:
86
+ return _context.abrupt("continue", 31);
87
+ case 19:
88
88
  convertedAttributes = convertedAttributesMap.get(originarMaterialId);
89
89
  if (convertedAttributes) {
90
- _context.next = 21;
90
+ _context.next = 22;
91
91
  break;
92
92
  }
93
- return _context.abrupt("continue", 30);
94
- case 21:
93
+ return _context.abrupt("continue", 31);
94
+ case 22:
95
95
  material = materialAndTexture.material, texture = materialAndTexture.texture;
96
- _context.next = 24;
96
+ _context.next = 25;
97
97
  return addNodeToNodePage();
98
- case 24:
98
+ case 25:
99
99
  nodeId = _context.sent;
100
100
  _context.t0 = result;
101
- _context.next = 28;
101
+ _context.next = 29;
102
102
  return _makeNodeResources({
103
103
  convertedAttributes: convertedAttributes,
104
104
  material: material,
@@ -109,38 +109,38 @@ function _convertB3dmToI3sGeometry() {
109
109
  propertyTable: propertyTable,
110
110
  attributeStorageInfo: attributeStorageInfo,
111
111
  draco: draco,
112
- workerSource: workerSource
112
+ libraries: libraries
113
113
  });
114
- case 28:
114
+ case 29:
115
115
  _context.t1 = _context.sent;
116
116
  _context.t0.push.call(_context.t0, _context.t1);
117
- case 30:
118
- _context.next = 13;
117
+ case 31:
118
+ _context.next = 14;
119
119
  break;
120
- case 32:
121
- _context.next = 37;
120
+ case 33:
121
+ _context.next = 38;
122
122
  break;
123
- case 34:
124
- _context.prev = 34;
125
- _context.t2 = _context["catch"](11);
123
+ case 35:
124
+ _context.prev = 35;
125
+ _context.t2 = _context["catch"](12);
126
126
  _iterator6.e(_context.t2);
127
- case 37:
128
- _context.prev = 37;
127
+ case 38:
128
+ _context.prev = 38;
129
129
  _iterator6.f();
130
- return _context.finish(37);
131
- case 40:
130
+ return _context.finish(38);
131
+ case 41:
132
132
  if (result.length) {
133
- _context.next = 42;
133
+ _context.next = 43;
134
134
  break;
135
135
  }
136
136
  return _context.abrupt("return", null);
137
- case 42:
138
- return _context.abrupt("return", result);
139
137
  case 43:
138
+ return _context.abrupt("return", result);
139
+ case 44:
140
140
  case "end":
141
141
  return _context.stop();
142
142
  }
143
- }, _callee, null, [[11, 34, 37, 40]]);
143
+ }, _callee, null, [[12, 35, 38, 41]]);
144
144
  }));
145
145
  return _convertB3dmToI3sGeometry.apply(this, arguments);
146
146
  }
@@ -167,22 +167,23 @@ function _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeigh
167
167
  _iterator.f();
168
168
  }
169
169
  }
170
- function _makeNodeResources(_x13) {
170
+ function _makeNodeResources(_x14) {
171
171
  return _makeNodeResources2.apply(this, arguments);
172
172
  }
173
173
  function _makeNodeResources2() {
174
174
  _makeNodeResources2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(_ref) {
175
175
  var _tileContent$gltf5;
176
- var convertedAttributes, material, texture, tileContent, nodeId, featuresHashArray, propertyTable, attributeStorageInfo, draco, workerSource, boundingVolumes, vertexCount, _generateAttributes, faceRange, featureIds, positions, normals, colors, uvRegions, texCoords, featureCount, header, typedFeatureIds, fileBuffer, compressedGeometry, attributes;
176
+ var convertedAttributes, material, texture, tileContent, nodeId, featuresHashArray, propertyTable, attributeStorageInfo, draco, libraries, boundingVolumes, vertexCount, _generateAttributes, faceRange, featureIds, positions, normals, colors, uvRegions, texCoords, featureCount, featureIdsMap, header, typedFeatureIds, fileBuffer, compressedGeometry, attributes;
177
177
  return _regenerator.default.wrap(function _callee2$(_context2) {
178
178
  while (1) switch (_context2.prev = _context2.next) {
179
179
  case 0:
180
- convertedAttributes = _ref.convertedAttributes, material = _ref.material, texture = _ref.texture, tileContent = _ref.tileContent, nodeId = _ref.nodeId, featuresHashArray = _ref.featuresHashArray, propertyTable = _ref.propertyTable, attributeStorageInfo = _ref.attributeStorageInfo, draco = _ref.draco, workerSource = _ref.workerSource;
180
+ convertedAttributes = _ref.convertedAttributes, material = _ref.material, texture = _ref.texture, tileContent = _ref.tileContent, nodeId = _ref.nodeId, featuresHashArray = _ref.featuresHashArray, propertyTable = _ref.propertyTable, attributeStorageInfo = _ref.attributeStorageInfo, draco = _ref.draco, libraries = _ref.libraries;
181
181
  boundingVolumes = convertedAttributes.boundingVolumes;
182
182
  vertexCount = convertedAttributes.positions.length / VALUES_PER_VERTEX;
183
183
  _generateAttributes = (0, _geometryAttributes.generateAttributes)(convertedAttributes), faceRange = _generateAttributes.faceRange, featureIds = _generateAttributes.featureIds, positions = _generateAttributes.positions, normals = _generateAttributes.normals, colors = _generateAttributes.colors, uvRegions = _generateAttributes.uvRegions, texCoords = _generateAttributes.texCoords, featureCount = _generateAttributes.featureCount;
184
- if (tileContent.batchTableJson) {
185
- makeFeatureIdsUnique(featureIds, convertedAttributes.featureIndices, featuresHashArray, tileContent.batchTableJson);
184
+ featureIdsMap = {};
185
+ if (propertyTable) {
186
+ featureIdsMap = makeFeatureIdsUnique(featureIds, convertedAttributes.featureIndices, featuresHashArray, propertyTable);
186
187
  }
187
188
  header = new Uint32Array(2);
188
189
  typedFeatureIds = generateBigUint64Array(featureIds);
@@ -196,10 +197,10 @@ function _makeNodeResources2() {
196
197
  uvRegions: uvRegions,
197
198
  featureIds: featureIds,
198
199
  faceRange: faceRange
199
- }, workerSource.draco) : null;
200
+ }, libraries) : null;
200
201
  attributes = [];
201
202
  if (attributeStorageInfo && propertyTable) {
202
- attributes = convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo);
203
+ attributes = convertPropertyTableToAttributeBuffers(featureIds, featureIdsMap, propertyTable, attributeStorageInfo);
203
204
  }
204
205
  return _context2.abrupt("return", {
205
206
  nodeId: nodeId,
@@ -214,7 +215,7 @@ function _makeNodeResources2() {
214
215
  featureCount: featureCount,
215
216
  boundingVolumes: boundingVolumes
216
217
  });
217
- case 13:
218
+ case 14:
218
219
  case "end":
219
220
  return _context2.stop();
220
221
  }
@@ -222,11 +223,11 @@ function _makeNodeResources2() {
222
223
  }));
223
224
  return _makeNodeResources2.apply(this, arguments);
224
225
  }
225
- function convertAttributes(_x14, _x15, _x16) {
226
+ function convertAttributes(_x15, _x16, _x17, _x18) {
226
227
  return _convertAttributes.apply(this, arguments);
227
228
  }
228
229
  function _convertAttributes() {
229
- _convertAttributes = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(attributesData, materialAndTextureList, useCartesianPositions) {
230
+ _convertAttributes = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(attributesData, materialAndTextureList, useCartesianPositions, featureTexture) {
230
231
  var nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, _iterator7, _step7, materialAndTexture, attributes, _iterator9, _step9, mergedMaterial, _iterator8, _step8, attrKey, _attributes;
231
232
  return _regenerator.default.wrap(function _callee3$(_context3) {
232
233
  while (1) switch (_context3.prev = _context3.next) {
@@ -265,7 +266,7 @@ function _convertAttributes() {
265
266
  } finally {
266
267
  _iterator7.f();
267
268
  }
268
- convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions);
269
+ convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, undefined, featureTexture);
269
270
  _iterator8 = _createForOfIteratorHelper(attributesMap.keys());
270
271
  _context3.prev = 6;
271
272
  _iterator8.s();
@@ -321,13 +322,14 @@ function _convertAttributes() {
321
322
  }
322
323
  function convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions) {
323
324
  var matrix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
325
+ var featureTexture = arguments.length > 7 ? arguments[7] : undefined;
324
326
  if (nodes) {
325
327
  var _iterator2 = _createForOfIteratorHelper(nodes),
326
328
  _step2;
327
329
  try {
328
330
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
329
331
  var node = _step2.value;
330
- convertNode(node, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix);
332
+ convertNode(node, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix, featureTexture);
331
333
  }
332
334
  } catch (err) {
333
335
  _iterator2.e(err);
@@ -358,16 +360,18 @@ function getCompositeTransformationMatrix(node, matrix) {
358
360
  }
359
361
  function convertNode(node, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions) {
360
362
  var matrix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
363
+ var featureTexture = arguments.length > 7 ? arguments[7] : undefined;
361
364
  var transformationMatrix = getCompositeTransformationMatrix(node, matrix);
362
365
  var mesh = node.mesh;
363
366
  if (mesh) {
364
- convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
367
+ convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix, featureTexture);
365
368
  }
366
- convertNodes(node.children || [], images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
369
+ convertNodes(node.children || [], images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix, featureTexture);
367
370
  }
368
371
  function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap) {
369
372
  var useCartesianPositions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
370
373
  var matrix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
374
+ var featureTexture = arguments.length > 7 ? arguments[7] : undefined;
371
375
  var _iterator3 = _createForOfIteratorHelper(mesh.primitives),
372
376
  _step3;
373
377
  try {
@@ -417,7 +421,7 @@ function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, att
417
421
  outputAttributes.uvRegions = (0, _loaderUtils.concatenateTypedArrays)(outputAttributes.uvRegions, createUvRegion(materialUvRegion, indices));
418
422
  }
419
423
  outputAttributes.featureIndicesGroups = outputAttributes.featureIndicesGroups || [];
420
- outputAttributes.featureIndicesGroups.push(flattenBatchIds(getBatchIds(attributes, primitive, images), indices));
424
+ outputAttributes.featureIndicesGroups.push(flattenBatchIds(getBatchIds(attributes, primitive, images, featureTexture), indices));
421
425
  };
422
426
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
423
427
  var _ret = _loop();
@@ -550,8 +554,8 @@ function flattenBatchIds(batchedIds, indices) {
550
554
  }
551
555
  return newBatchIds;
552
556
  }
553
- function getBatchIds(attributes, primitive, images) {
554
- var batchIds = (0, _batchIdsExtensions.handleBatchIdsExtensions)(attributes, primitive, images);
557
+ function getBatchIds(attributes, primitive, images, featureTexture) {
558
+ var batchIds = (0, _batchIdsExtensions.handleBatchIdsExtensions)(attributes, primitive, images, featureTexture);
555
559
  if (batchIds.length) {
556
560
  return batchIds;
557
561
  }
@@ -610,7 +614,7 @@ function _convertMaterials() {
610
614
  }));
611
615
  return _convertMaterials.apply(this, arguments);
612
616
  }
613
- function mergeAllMaterials(_x17) {
617
+ function mergeAllMaterials(_x19) {
614
618
  return _mergeAllMaterials.apply(this, arguments);
615
619
  }
616
620
  function _mergeAllMaterials() {
@@ -708,7 +712,7 @@ function _mergeAllMaterials() {
708
712
  }));
709
713
  return _mergeAllMaterials.apply(this, arguments);
710
714
  }
711
- function mergeMaterials(_x18, _x19) {
715
+ function mergeMaterials(_x20, _x21) {
712
716
  return _mergeMaterials.apply(this, arguments);
713
717
  }
714
718
  function _mergeMaterials() {
@@ -932,6 +936,7 @@ function makeFeatureIdsUnique(featureIds, featureIndices, featuresHashArray, bat
932
936
  var replaceMap = getFeaturesReplaceMap(featureIds, batchTable, featuresHashArray);
933
937
  replaceIndicesByUnique(featureIndices, replaceMap);
934
938
  replaceIndicesByUnique(featureIds, replaceMap);
939
+ return replaceMap;
935
940
  }
936
941
  function getFeaturesReplaceMap(featureIds, batchTable, featuresHashArray) {
937
942
  var featureMap = {};
@@ -962,18 +967,20 @@ function replaceIndicesByUnique(indicesArray, featureMap) {
962
967
  indicesArray[index] = featureMap[indicesArray[index]];
963
968
  }
964
969
  }
965
- function convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo) {
970
+ function convertPropertyTableToAttributeBuffers(featureIds, featureIdsMap, propertyTable, attributeStorageInfo) {
966
971
  var attributeBuffers = [];
967
972
  var needFlattenPropertyTable = (0, _featureAttributes.checkPropertiesLength)(featureIds, propertyTable);
968
- var properties = needFlattenPropertyTable ? (0, _featureAttributes.flattenPropertyTableByFeatureIds)(featureIds, propertyTable) : propertyTable;
973
+ var properties = needFlattenPropertyTable ? (0, _featureAttributes.flattenPropertyTableByFeatureIds)(featureIdsMap, propertyTable) : propertyTable;
969
974
  var propertyTableWithObjectIds = _objectSpread({
970
975
  OBJECTID: featureIds
971
976
  }, properties);
972
977
  for (var propertyName in propertyTableWithObjectIds) {
973
978
  var type = getAttributeType(propertyName, attributeStorageInfo);
974
- var value = propertyTableWithObjectIds[propertyName];
975
- var attributeBuffer = generateAttributeBuffer(type, value);
976
- attributeBuffers.push(attributeBuffer);
979
+ if (type) {
980
+ var value = propertyTableWithObjectIds[propertyName];
981
+ var attributeBuffer = generateAttributeBuffer(type, value);
982
+ attributeBuffers.push(attributeBuffer);
983
+ }
977
984
  }
978
985
  return attributeBuffers;
979
986
  }
@@ -999,6 +1006,14 @@ function getAttributeType(key, attributeStorageInfo) {
999
1006
  var attribute = attributeStorageInfo.find(function (attr) {
1000
1007
  return attr.name === key;
1001
1008
  });
1009
+ if (!attribute) {
1010
+ console.error("attribute is null, key=".concat(key, ", attributeStorageInfo=").concat(JSON.stringify(attributeStorageInfo, null, 2)));
1011
+ return '';
1012
+ }
1013
+ if (!attribute.attributeValues) {
1014
+ console.error("attributeValues is null, attribute=".concat(attribute));
1015
+ return '';
1016
+ }
1002
1017
  return attribute.attributeValues.valueType;
1003
1018
  }
1004
1019
  function generateShortIntegerAttributeBuffer(featureIds) {
@@ -1035,11 +1050,11 @@ function generateBigUint64Array(featureIds) {
1035
1050
  }
1036
1051
  return typedFeatureIds;
1037
1052
  }
1038
- function generateCompressedGeometry(_x20, _x21, _x22, _x23) {
1053
+ function generateCompressedGeometry(_x22, _x23, _x24, _x25) {
1039
1054
  return _generateCompressedGeometry.apply(this, arguments);
1040
1055
  }
1041
1056
  function _generateCompressedGeometry() {
1042
- _generateCompressedGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(vertexCount, convertedAttributes, attributes, dracoWorkerSoure) {
1057
+ _generateCompressedGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(vertexCount, convertedAttributes, attributes, libraries) {
1043
1058
  var positions, normals, texCoords, colors, uvRegions, featureIds, faceRange, indices, index, featureIndices, featureIndex, compressedAttributes, attributesMetadata;
1044
1059
  return _regenerator.default.wrap(function _callee7$(_context7) {
1045
1060
  while (1) switch (_context7.prev = _context7.next) {
@@ -1075,15 +1090,18 @@ function _generateCompressedGeometry() {
1075
1090
  return _context7.abrupt("return", (0, _core2.encode)({
1076
1091
  attributes: compressedAttributes,
1077
1092
  indices: indices
1078
- }, _draco.DracoWriterWorker, _objectSpread(_objectSpread({}, _draco.DracoWriterWorker.options), {}, {
1079
- source: dracoWorkerSoure,
1093
+ }, _draco.DracoWriterWorker, _objectSpread(_objectSpread({}, _draco.DracoWriterWorker.options), {}, (0, _defineProperty2.default)({
1080
1094
  reuseWorkers: true,
1081
1095
  _nodeWorkers: true,
1096
+ modules: libraries,
1097
+ useLocalLibraries: true,
1082
1098
  draco: {
1083
1099
  method: 'MESH_SEQUENTIAL_ENCODING',
1084
1100
  attributesMetadata: attributesMetadata
1085
1101
  }
1086
- })));
1102
+ }, 'draco-writer', {
1103
+ workerUrl: './modules/draco/dist/draco-writer-worker-node.js'
1104
+ }))));
1087
1105
  case 10:
1088
1106
  case "end":
1089
1107
  return _context7.stop();
@@ -1104,11 +1122,12 @@ function generateFeatureIndexAttribute(featureIndex, faceRange) {
1104
1122
  }
1105
1123
  return orderedFeatureIndices;
1106
1124
  }
1107
- function getPropertyTable(tileContent) {
1125
+ function getPropertyTable(tileContent, metadataClass) {
1108
1126
  if (!tileContent) {
1109
1127
  return null;
1110
1128
  }
1111
- var batchTableJson = tileContent === null || tileContent === void 0 ? void 0 : tileContent.batchTableJson;
1129
+ var propertyTable;
1130
+ var batchTableJson = tileContent.batchTableJson;
1112
1131
  if (batchTableJson) {
1113
1132
  return batchTableJson;
1114
1133
  }
@@ -1116,14 +1135,15 @@ function getPropertyTable(tileContent) {
1116
1135
  extensionName = _getPropertyTableExte.extensionName,
1117
1136
  extension = _getPropertyTableExte.extension;
1118
1137
  switch (extensionName) {
1119
- case EXT_MESH_FEATURES:
1138
+ case _gltf.EXT_STRUCTURAL_METADATA:
1120
1139
  {
1121
- console.warn('The I3S converter does not yet support the EXT_mesh_features extension');
1122
- return null;
1140
+ propertyTable = (0, _gltf.getPropertyTableFromExtStructuralMetadata)(extension, metadataClass);
1141
+ return propertyTable;
1123
1142
  }
1124
- case EXT_FEATURE_METADATA:
1143
+ case _gltf.EXT_FEATURE_METADATA:
1125
1144
  {
1126
- return getPropertyTableFromExtFeatureMetadata(extension);
1145
+ propertyTable = (0, _gltf.getPropertyTableFromExtFeatureMetadata)(extension, metadataClass);
1146
+ return propertyTable;
1127
1147
  }
1128
1148
  default:
1129
1149
  return null;
@@ -1131,7 +1151,7 @@ function getPropertyTable(tileContent) {
1131
1151
  }
1132
1152
  function getPropertyTableExtension(tileContent) {
1133
1153
  var _tileContent$gltf, _tileContent$gltf2, _tileContent$gltf2$ex, _tileContent$gltf3;
1134
- var extensionsWithPropertyTables = [EXT_FEATURE_METADATA, EXT_MESH_FEATURES];
1154
+ var extensionsWithPropertyTables = [_gltf.EXT_FEATURE_METADATA, _gltf.EXT_STRUCTURAL_METADATA];
1135
1155
  var extensionsUsed = tileContent === null || tileContent === void 0 ? void 0 : (_tileContent$gltf = tileContent.gltf) === null || _tileContent$gltf === void 0 ? void 0 : _tileContent$gltf.extensionsUsed;
1136
1156
  if (!extensionsUsed) {
1137
1157
  return {
@@ -1155,38 +1175,16 @@ function getPropertyTableExtension(tileContent) {
1155
1175
  } finally {
1156
1176
  _iterator5.f();
1157
1177
  }
1178
+ if (!extensionName) {
1179
+ return {
1180
+ extensionName: null,
1181
+ extension: null
1182
+ };
1183
+ }
1158
1184
  var extension = tileContent === null || tileContent === void 0 ? void 0 : (_tileContent$gltf2 = tileContent.gltf) === null || _tileContent$gltf2 === void 0 ? void 0 : (_tileContent$gltf2$ex = _tileContent$gltf2.extensions) === null || _tileContent$gltf2$ex === void 0 ? void 0 : _tileContent$gltf2$ex[extensionName];
1159
1185
  return {
1160
1186
  extensionName: extensionName,
1161
1187
  extension: extension
1162
1188
  };
1163
1189
  }
1164
- function getPropertyTableFromExtFeatureMetadata(extension) {
1165
- if (extension !== null && extension !== void 0 && extension.featureTables) {
1166
- var _Object$keys;
1167
- var firstFeatureTableName = (_Object$keys = Object.keys(extension.featureTables)) === null || _Object$keys === void 0 ? void 0 : _Object$keys[0];
1168
- if (firstFeatureTableName) {
1169
- var featureTable = extension === null || extension === void 0 ? void 0 : extension.featureTables[firstFeatureTableName];
1170
- var propertyTable = {};
1171
- for (var propertyName in featureTable.properties) {
1172
- propertyTable[propertyName] = featureTable.properties[propertyName].data;
1173
- }
1174
- return propertyTable;
1175
- }
1176
- }
1177
- if (extension !== null && extension !== void 0 && extension.featureTextures) {
1178
- var _Object$keys2;
1179
- var firstTextureName = (_Object$keys2 = Object.keys(extension.featureTextures)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2[0];
1180
- if (firstTextureName) {
1181
- var _featureTable = extension === null || extension === void 0 ? void 0 : extension.featureTextures[firstTextureName];
1182
- var _propertyTable = {};
1183
- for (var _propertyName in _featureTable.properties) {
1184
- _propertyTable[_propertyName] = _featureTable.properties[_propertyName].data;
1185
- }
1186
- return _propertyTable;
1187
- }
1188
- }
1189
- console.warn("The I3S converter couldn't handle EXT_feature_metadata extension: There is neither featureTables, no featureTextures in the extension.");
1190
- return null;
1191
- }
1192
1190
  //# sourceMappingURL=geometry-converter.js.map