@loaders.gl/tile-converter 4.0.0-alpha.4 → 4.0.0-alpha.6

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 (407) 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 +3 -0
  4. package/dist/3d-tiles-attributes-worker.js.map +7 -0
  5. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +90 -0
  6. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -0
  7. package/dist/3d-tiles-converter/3d-tiles-converter.js +273 -231
  8. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +79 -18
  9. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -0
  10. package/dist/3d-tiles-converter/helpers/b3dm-converter.js +269 -236
  11. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +4 -7
  12. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts.map +1 -0
  13. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +22 -9
  14. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts +9 -0
  15. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts.map +1 -0
  16. package/dist/3d-tiles-converter/helpers/texture-atlas.js +47 -28
  17. package/dist/3d-tiles-converter/json-templates/tileset.d.ts +15 -0
  18. package/dist/3d-tiles-converter/json-templates/tileset.d.ts.map +1 -0
  19. package/dist/3d-tiles-converter/json-templates/tileset.js +42 -36
  20. package/dist/bundle.d.ts +2 -0
  21. package/dist/bundle.d.ts.map +1 -0
  22. package/dist/bundle.js +2 -2
  23. package/dist/constants.d.ts +2 -0
  24. package/dist/constants.d.ts.map +1 -0
  25. package/dist/constants.js +4 -0
  26. package/dist/converter-cli.d.ts +2 -0
  27. package/dist/converter-cli.d.ts.map +1 -0
  28. package/dist/converter-cli.js +280 -0
  29. package/dist/converter.min.js +186 -190
  30. package/dist/deps-installer/deps-installer.d.ts +11 -3
  31. package/dist/deps-installer/deps-installer.d.ts.map +1 -0
  32. package/dist/deps-installer/deps-installer.js +60 -23
  33. package/dist/dist.min.js +63496 -0
  34. package/dist/es5/3d-tiles-attributes-worker.js +25 -0
  35. package/dist/es5/3d-tiles-attributes-worker.js.map +1 -0
  36. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +470 -0
  37. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -0
  38. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +301 -0
  39. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -0
  40. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +18 -0
  41. package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -0
  42. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js +33 -0
  43. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -0
  44. package/dist/es5/3d-tiles-converter/json-templates/tileset.js +61 -0
  45. package/dist/es5/3d-tiles-converter/json-templates/tileset.js.map +1 -0
  46. package/dist/es5/bundle.js +6 -0
  47. package/dist/es5/bundle.js.map +1 -0
  48. package/dist/es5/constants.js +9 -0
  49. package/dist/es5/constants.js.map +1 -0
  50. package/dist/es5/converter-cli.js +289 -0
  51. package/dist/es5/converter-cli.js.map +1 -0
  52. package/dist/es5/deps-installer/deps-installer.js +123 -0
  53. package/dist/es5/deps-installer/deps-installer.js.map +1 -0
  54. package/dist/es5/i3s-attributes-worker.js +25 -0
  55. package/dist/es5/i3s-attributes-worker.js.map +1 -0
  56. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +116 -0
  57. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
  58. package/dist/es5/i3s-converter/helpers/coordinate-converter.js +90 -0
  59. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -0
  60. package/dist/es5/i3s-converter/helpers/create-scene-server-path.js +41 -0
  61. package/dist/es5/i3s-converter/helpers/create-scene-server-path.js.map +1 -0
  62. package/dist/es5/i3s-converter/helpers/feature-attributes.js +174 -0
  63. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -0
  64. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +213 -0
  65. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -0
  66. package/dist/es5/i3s-converter/helpers/geometry-converter.js +1173 -0
  67. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -0
  68. package/dist/es5/i3s-converter/helpers/gltf-attributes.js +83 -0
  69. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -0
  70. package/dist/es5/i3s-converter/helpers/node-debug.js +76 -0
  71. package/dist/es5/i3s-converter/helpers/node-debug.js.map +1 -0
  72. package/dist/es5/i3s-converter/helpers/node-index-document.js +492 -0
  73. package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -0
  74. package/dist/es5/i3s-converter/helpers/node-pages.js +519 -0
  75. package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -0
  76. package/dist/es5/i3s-converter/i3s-converter.js +1519 -0
  77. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -0
  78. package/dist/es5/i3s-converter/json-templates/geometry-definitions.js +107 -0
  79. package/dist/es5/i3s-converter/json-templates/geometry-definitions.js.map +1 -0
  80. package/dist/es5/i3s-converter/json-templates/layers.js +163 -0
  81. package/dist/es5/i3s-converter/json-templates/layers.js.map +1 -0
  82. package/dist/es5/i3s-converter/json-templates/metadata.js +31 -0
  83. package/dist/es5/i3s-converter/json-templates/metadata.js.map +1 -0
  84. package/dist/es5/i3s-converter/json-templates/node.js +99 -0
  85. package/dist/es5/i3s-converter/json-templates/node.js.map +1 -0
  86. package/dist/es5/i3s-converter/json-templates/scene-server.js +39 -0
  87. package/dist/es5/i3s-converter/json-templates/scene-server.js.map +1 -0
  88. package/dist/es5/i3s-converter/json-templates/shared-resources.js +173 -0
  89. package/dist/es5/i3s-converter/json-templates/shared-resources.js.map +1 -0
  90. package/dist/es5/i3s-converter/json-templates/store.js +107 -0
  91. package/dist/es5/i3s-converter/json-templates/store.js.map +1 -0
  92. package/dist/es5/i3s-converter/types.js +2 -0
  93. package/dist/es5/i3s-converter/types.js.map +1 -0
  94. package/dist/es5/i3s-server/app.js +18 -0
  95. package/dist/es5/i3s-server/app.js.map +1 -0
  96. package/dist/es5/i3s-server/controllers/index-controller.js +55 -0
  97. package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -0
  98. package/dist/es5/i3s-server/routes/index.js +37 -0
  99. package/dist/es5/i3s-server/routes/index.js.map +1 -0
  100. package/dist/es5/index.js +21 -0
  101. package/dist/es5/index.js.map +1 -0
  102. package/dist/es5/lib/utils/compress-util.js +346 -0
  103. package/dist/es5/lib/utils/compress-util.js.map +1 -0
  104. package/dist/es5/lib/utils/file-utils.js +208 -0
  105. package/dist/es5/lib/utils/file-utils.js.map +1 -0
  106. package/dist/es5/lib/utils/lod-conversion-utils.js +44 -0
  107. package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -0
  108. package/dist/es5/lib/utils/queue.js +47 -0
  109. package/dist/es5/lib/utils/queue.js.map +1 -0
  110. package/dist/es5/lib/utils/statistic-utills.d.ts +25 -0
  111. package/dist/es5/lib/utils/statistic-utills.js +147 -0
  112. package/dist/es5/lib/utils/statistic-utills.js.map +1 -0
  113. package/dist/es5/lib/utils/write-queue.js +214 -0
  114. package/dist/es5/lib/utils/write-queue.js.map +1 -0
  115. package/dist/es5/pgm-loader.js +41 -0
  116. package/dist/es5/pgm-loader.js.map +1 -0
  117. package/dist/es5/workers/3d-tiles-attributes-worker.js +28 -0
  118. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -0
  119. package/dist/es5/workers/i3s-attributes-worker.js +30 -0
  120. package/dist/es5/workers/i3s-attributes-worker.js.map +1 -0
  121. package/dist/esm/3d-tiles-attributes-worker.js +16 -0
  122. package/dist/esm/3d-tiles-attributes-worker.js.map +1 -0
  123. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +248 -0
  124. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -0
  125. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +224 -0
  126. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -0
  127. package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +10 -0
  128. package/dist/esm/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -0
  129. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js +27 -0
  130. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js.map +1 -0
  131. package/dist/esm/3d-tiles-converter/json-templates/tileset.js +37 -0
  132. package/dist/esm/3d-tiles-converter/json-templates/tileset.js.map +1 -0
  133. package/dist/esm/bundle.js +4 -0
  134. package/dist/esm/bundle.js.map +1 -0
  135. package/dist/esm/constants.js +2 -0
  136. package/dist/esm/constants.js.map +1 -0
  137. package/dist/esm/converter-cli.js +232 -0
  138. package/dist/esm/converter-cli.js.map +1 -0
  139. package/dist/esm/deps-installer/deps-installer.js +44 -0
  140. package/dist/esm/deps-installer/deps-installer.js.map +1 -0
  141. package/dist/esm/i3s-attributes-worker.js +16 -0
  142. package/dist/esm/i3s-attributes-worker.js.map +1 -0
  143. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +105 -0
  144. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -0
  145. package/dist/esm/i3s-converter/helpers/coordinate-converter.js +80 -0
  146. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -0
  147. package/dist/esm/i3s-converter/helpers/create-scene-server-path.js +16 -0
  148. package/dist/esm/i3s-converter/helpers/create-scene-server-path.js.map +1 -0
  149. package/dist/esm/i3s-converter/helpers/feature-attributes.js +147 -0
  150. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -0
  151. package/{src → dist/esm}/i3s-converter/helpers/geometry-attributes.js +80 -106
  152. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -0
  153. package/dist/esm/i3s-converter/helpers/geometry-converter.js +887 -0
  154. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -0
  155. package/dist/esm/i3s-converter/helpers/gltf-attributes.js +76 -0
  156. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -0
  157. package/{src → dist/esm}/i3s-converter/helpers/node-debug.js +20 -41
  158. package/dist/esm/i3s-converter/helpers/node-debug.js.map +1 -0
  159. package/dist/esm/i3s-converter/helpers/node-index-document.js +188 -0
  160. package/dist/esm/i3s-converter/helpers/node-index-document.js.map +1 -0
  161. package/dist/esm/i3s-converter/helpers/node-pages.js +206 -0
  162. package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -0
  163. package/dist/esm/i3s-converter/i3s-converter.js +771 -0
  164. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -0
  165. package/dist/esm/i3s-converter/json-templates/geometry-definitions.js +89 -0
  166. package/dist/esm/i3s-converter/json-templates/geometry-definitions.js.map +1 -0
  167. package/dist/esm/i3s-converter/json-templates/layers.js +133 -0
  168. package/dist/esm/i3s-converter/json-templates/layers.js.map +1 -0
  169. package/dist/esm/i3s-converter/json-templates/metadata.js +22 -0
  170. package/dist/esm/i3s-converter/json-templates/metadata.js.map +1 -0
  171. package/dist/esm/i3s-converter/json-templates/node.js +80 -0
  172. package/dist/esm/i3s-converter/json-templates/node.js.map +1 -0
  173. package/dist/esm/i3s-converter/json-templates/scene-server.js +28 -0
  174. package/dist/esm/i3s-converter/json-templates/scene-server.js.map +1 -0
  175. package/dist/esm/i3s-converter/json-templates/shared-resources.js +123 -0
  176. package/dist/esm/i3s-converter/json-templates/shared-resources.js.map +1 -0
  177. package/dist/esm/i3s-converter/json-templates/store.js +98 -0
  178. package/dist/esm/i3s-converter/json-templates/store.js.map +1 -0
  179. package/dist/esm/i3s-converter/types.js +2 -0
  180. package/dist/esm/i3s-converter/types.js.map +1 -0
  181. package/dist/esm/i3s-server/app.js +16 -0
  182. package/dist/esm/i3s-server/app.js.map +1 -0
  183. package/dist/esm/i3s-server/bin/www +102 -0
  184. package/dist/esm/i3s-server/certs/cert.pem +19 -0
  185. package/dist/esm/i3s-server/certs/key.pem +27 -0
  186. package/dist/esm/i3s-server/controllers/index-controller.js +24 -0
  187. package/dist/esm/i3s-server/controllers/index-controller.js.map +1 -0
  188. package/dist/esm/i3s-server/routes/index.js +16 -0
  189. package/dist/esm/i3s-server/routes/index.js.map +1 -0
  190. package/dist/esm/index.js +3 -0
  191. package/dist/esm/index.js.map +1 -0
  192. package/dist/esm/lib/utils/compress-util.js +168 -0
  193. package/dist/esm/lib/utils/compress-util.js.map +1 -0
  194. package/dist/esm/lib/utils/file-utils.js +87 -0
  195. package/dist/esm/lib/utils/file-utils.js.map +1 -0
  196. package/dist/esm/lib/utils/lod-conversion-utils.js +37 -0
  197. package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -0
  198. package/dist/esm/lib/utils/queue.js +15 -0
  199. package/dist/esm/lib/utils/queue.js.map +1 -0
  200. package/dist/esm/lib/utils/statistic-utills.d.ts +25 -0
  201. package/dist/esm/lib/utils/statistic-utills.js +62 -0
  202. package/dist/esm/lib/utils/statistic-utills.js.map +1 -0
  203. package/dist/esm/lib/utils/write-queue.js +85 -0
  204. package/dist/esm/lib/utils/write-queue.js.map +1 -0
  205. package/dist/esm/pgm-loader.js +15 -0
  206. package/dist/esm/pgm-loader.js.map +1 -0
  207. package/dist/esm/workers/3d-tiles-attributes-worker.js +8 -0
  208. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -0
  209. package/dist/esm/workers/i3s-attributes-worker.js +7 -0
  210. package/dist/esm/workers/i3s-attributes-worker.js.map +1 -0
  211. package/dist/i3s-attributes-worker.d.ts +37 -0
  212. package/dist/i3s-attributes-worker.d.ts.map +1 -0
  213. package/dist/i3s-attributes-worker.js +9 -0
  214. package/dist/i3s-attributes-worker.js.map +7 -0
  215. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +11 -0
  216. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -0
  217. package/dist/i3s-converter/helpers/batch-ids-extensions.js +141 -0
  218. package/dist/i3s-converter/helpers/coordinate-converter.d.ts +41 -0
  219. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -0
  220. package/dist/i3s-converter/helpers/coordinate-converter.js +120 -42
  221. package/dist/i3s-converter/helpers/create-scene-server-path.d.ts +9 -0
  222. package/dist/i3s-converter/helpers/create-scene-server-path.d.ts.map +1 -0
  223. package/dist/i3s-converter/helpers/create-scene-server-path.js +27 -15
  224. package/dist/i3s-converter/helpers/feature-attributes.d.ts +56 -0
  225. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -0
  226. package/dist/i3s-converter/helpers/feature-attributes.js +216 -0
  227. package/dist/i3s-converter/helpers/geometry-attributes.d.ts +8 -0
  228. package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -0
  229. package/dist/i3s-converter/helpers/geometry-attributes.js +188 -185
  230. package/dist/i3s-converter/helpers/geometry-converter.d.ts +36 -35
  231. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -0
  232. package/dist/i3s-converter/helpers/geometry-converter.js +1149 -650
  233. package/dist/i3s-converter/helpers/gltf-attributes.d.ts +9 -0
  234. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -0
  235. package/dist/i3s-converter/helpers/gltf-attributes.js +88 -0
  236. package/dist/i3s-converter/helpers/node-debug.d.ts +8 -0
  237. package/dist/i3s-converter/helpers/node-debug.d.ts.map +1 -0
  238. package/dist/i3s-converter/helpers/node-debug.js +106 -74
  239. package/dist/i3s-converter/helpers/node-index-document.d.ts +95 -0
  240. package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -0
  241. package/dist/i3s-converter/helpers/node-index-document.js +250 -0
  242. package/dist/i3s-converter/helpers/node-pages.d.ts +125 -113
  243. package/dist/i3s-converter/helpers/node-pages.d.ts.map +1 -0
  244. package/dist/i3s-converter/helpers/node-pages.js +313 -133
  245. package/dist/i3s-converter/i3s-converter.d.ts +267 -0
  246. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -0
  247. package/dist/i3s-converter/i3s-converter.js +860 -861
  248. package/dist/i3s-converter/json-templates/geometry-definitions.d.ts +7 -0
  249. package/dist/i3s-converter/json-templates/geometry-definitions.d.ts.map +1 -0
  250. package/dist/i3s-converter/json-templates/geometry-definitions.js +87 -0
  251. package/dist/i3s-converter/json-templates/layers.d.ts +70 -0
  252. package/dist/i3s-converter/json-templates/layers.d.ts.map +1 -0
  253. package/dist/i3s-converter/json-templates/layers.js +138 -190
  254. package/dist/i3s-converter/json-templates/metadata.d.ts +22 -0
  255. package/dist/i3s-converter/json-templates/metadata.d.ts.map +1 -0
  256. package/dist/i3s-converter/json-templates/metadata.js +25 -22
  257. package/dist/i3s-converter/json-templates/node.d.ts +61 -0
  258. package/dist/i3s-converter/json-templates/node.d.ts.map +1 -0
  259. package/dist/i3s-converter/json-templates/node.js +88 -79
  260. package/dist/i3s-converter/json-templates/scene-server.d.ts +28 -0
  261. package/dist/i3s-converter/json-templates/scene-server.d.ts.map +1 -0
  262. package/dist/i3s-converter/json-templates/scene-server.js +31 -28
  263. package/dist/i3s-converter/json-templates/shared-resources.d.ts +14 -0
  264. package/dist/i3s-converter/json-templates/shared-resources.d.ts.map +1 -0
  265. package/dist/i3s-converter/json-templates/shared-resources.js +124 -125
  266. package/dist/i3s-converter/json-templates/store.d.ts +95 -0
  267. package/dist/i3s-converter/json-templates/store.d.ts.map +1 -0
  268. package/dist/i3s-converter/json-templates/store.js +100 -95
  269. package/dist/i3s-converter/types.d.ts +145 -0
  270. package/dist/i3s-converter/types.d.ts.map +1 -0
  271. package/dist/i3s-converter/types.js +2 -0
  272. package/dist/i3s-server/app.d.ts +3 -0
  273. package/dist/i3s-server/app.d.ts.map +1 -0
  274. package/dist/i3s-server/app.js +2 -9
  275. package/dist/i3s-server/controllers/index-controller.d.ts +2 -0
  276. package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -0
  277. package/dist/i3s-server/controllers/index-controller.js +16 -24
  278. package/dist/i3s-server/routes/index.d.ts +3 -0
  279. package/dist/i3s-server/routes/index.d.ts.map +1 -0
  280. package/dist/i3s-server/routes/index.js +11 -15
  281. package/dist/index.d.ts +3 -0
  282. package/dist/index.d.ts.map +1 -0
  283. package/dist/index.js +10 -5
  284. package/dist/lib/utils/compress-util.d.ts +45 -0
  285. package/dist/lib/utils/compress-util.d.ts.map +1 -0
  286. package/dist/lib/utils/compress-util.js +238 -160
  287. package/dist/lib/utils/file-utils.d.ts +22 -14
  288. package/dist/lib/utils/file-utils.d.ts.map +1 -0
  289. package/dist/lib/utils/file-utils.js +133 -36
  290. package/dist/lib/utils/lod-conversion-utils.d.ts +21 -12
  291. package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -0
  292. package/dist/lib/utils/lod-conversion-utils.js +72 -39
  293. package/dist/lib/utils/queue.d.ts +7 -0
  294. package/dist/lib/utils/queue.d.ts.map +1 -0
  295. package/dist/lib/utils/queue.js +18 -0
  296. package/dist/lib/utils/statistic-utills.d.ts +3 -25
  297. package/dist/lib/utils/statistic-utills.d.ts.map +1 -0
  298. package/dist/lib/utils/statistic-utills.js +58 -67
  299. package/dist/lib/utils/write-queue.d.ts +39 -0
  300. package/dist/lib/utils/write-queue.d.ts.map +1 -0
  301. package/dist/lib/utils/write-queue.js +80 -0
  302. package/dist/pgm-loader.d.ts +6 -0
  303. package/dist/pgm-loader.d.ts.map +1 -0
  304. package/dist/pgm-loader.js +23 -14
  305. package/dist/workers/3d-tiles-attributes-worker.d.ts +2 -0
  306. package/dist/workers/3d-tiles-attributes-worker.d.ts.map +1 -0
  307. package/dist/workers/3d-tiles-attributes-worker.js +9 -0
  308. package/dist/workers/i3s-attributes-worker.d.ts +2 -0
  309. package/dist/workers/i3s-attributes-worker.d.ts.map +1 -0
  310. package/dist/workers/i3s-attributes-worker.js +5 -0
  311. package/package.json +35 -24
  312. package/src/3d-tiles-attributes-worker.ts +43 -0
  313. package/src/3d-tiles-converter/3d-tiles-converter.ts +124 -59
  314. package/src/3d-tiles-converter/helpers/{b3dm-converter.js → b3dm-converter.ts} +71 -38
  315. package/src/3d-tiles-converter/helpers/{i3s-obb-to-3d-tiles-obb.js → i3s-obb-to-3d-tiles-obb.ts} +16 -1
  316. package/src/3d-tiles-converter/helpers/texture-atlas.ts +4 -4
  317. package/src/3d-tiles-converter/json-templates/{tileset.js → tileset.ts} +9 -9
  318. package/src/constants.ts +2 -0
  319. package/src/converter-cli.ts +370 -0
  320. package/src/deps-installer/deps-installer.ts +71 -0
  321. package/src/i3s-attributes-worker.ts +50 -0
  322. package/src/i3s-converter/helpers/batch-ids-extensions.ts +206 -0
  323. package/src/i3s-converter/helpers/coordinate-converter.ts +87 -27
  324. package/src/i3s-converter/helpers/create-scene-server-path.ts +29 -0
  325. package/src/i3s-converter/helpers/feature-attributes.ts +247 -0
  326. package/src/i3s-converter/helpers/geometry-attributes.ts +267 -0
  327. package/src/i3s-converter/helpers/geometry-converter.ts +1608 -0
  328. package/src/i3s-converter/helpers/gltf-attributes.ts +103 -0
  329. package/src/i3s-converter/helpers/node-debug.ts +146 -0
  330. package/src/i3s-converter/helpers/node-index-document.ts +315 -0
  331. package/src/i3s-converter/helpers/node-pages.ts +344 -0
  332. package/src/i3s-converter/i3s-converter.ts +557 -627
  333. package/src/i3s-converter/json-templates/geometry-definitions.ts +83 -0
  334. package/src/i3s-converter/json-templates/layers.ts +137 -0
  335. package/src/i3s-converter/json-templates/{metadata.js → metadata.ts} +2 -2
  336. package/src/i3s-converter/json-templates/{node.js → node.ts} +12 -12
  337. package/src/i3s-converter/json-templates/{scene-server.js → scene-server.ts} +2 -2
  338. package/src/i3s-converter/json-templates/{shared-resources.js → shared-resources.ts} +17 -17
  339. package/src/i3s-converter/types.ts +165 -0
  340. package/src/index.ts +0 -4
  341. package/src/lib/utils/{compress-util.js → compress-util.ts} +105 -18
  342. package/src/lib/utils/file-utils.ts +139 -0
  343. package/src/lib/utils/{lod-conversion-utils.js → lod-conversion-utils.ts} +27 -5
  344. package/src/lib/utils/queue.ts +17 -0
  345. package/src/lib/utils/write-queue.ts +110 -0
  346. package/src/pgm-loader.ts +3 -3
  347. package/src/workers/3d-tiles-attributes-worker.ts +6 -0
  348. package/src/workers/i3s-attributes-worker.ts +7 -0
  349. package/dist/3d-tiles-converter/3d-tiles-converter.js.map +0 -1
  350. package/dist/3d-tiles-converter/helpers/b3dm-converter.js.map +0 -1
  351. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +0 -1
  352. package/dist/3d-tiles-converter/helpers/texture-atlas.js.map +0 -1
  353. package/dist/3d-tiles-converter/json-templates/tileset.js.map +0 -1
  354. package/dist/bundle.js.map +0 -1
  355. package/dist/deps-installer/deps-installer.js.map +0 -1
  356. package/dist/i3s-converter/helpers/coordinate-converter.js.map +0 -1
  357. package/dist/i3s-converter/helpers/create-scene-server-path.js.map +0 -1
  358. package/dist/i3s-converter/helpers/geometry-attributes.js.map +0 -1
  359. package/dist/i3s-converter/helpers/geometry-converter.js.map +0 -1
  360. package/dist/i3s-converter/helpers/node-debug.js.map +0 -1
  361. package/dist/i3s-converter/helpers/node-pages.js.map +0 -1
  362. package/dist/i3s-converter/i3s-converter.js.map +0 -1
  363. package/dist/i3s-converter/json-templates/layers.js.map +0 -1
  364. package/dist/i3s-converter/json-templates/metadata.js.map +0 -1
  365. package/dist/i3s-converter/json-templates/node.js.map +0 -1
  366. package/dist/i3s-converter/json-templates/scene-server.js.map +0 -1
  367. package/dist/i3s-converter/json-templates/shared-resources.js.map +0 -1
  368. package/dist/i3s-converter/json-templates/store.js.map +0 -1
  369. package/dist/i3s-server/app.js.map +0 -1
  370. package/dist/i3s-server/controllers/index-controller.js.map +0 -1
  371. package/dist/i3s-server/routes/index.js.map +0 -1
  372. package/dist/index.js.map +0 -1
  373. package/dist/lib/geoid-height-model.d.ts +0 -41
  374. package/dist/lib/geoid-height-model.js +0 -140
  375. package/dist/lib/geoid-height-model.js.map +0 -1
  376. package/dist/lib/pgm-parser.d.ts +0 -14
  377. package/dist/lib/pgm-parser.js +0 -183
  378. package/dist/lib/pgm-parser.js.map +0 -1
  379. package/dist/lib/utils/compress-util.js.map +0 -1
  380. package/dist/lib/utils/compress-utils.d.ts +0 -53
  381. package/dist/lib/utils/file-utils.js.map +0 -1
  382. package/dist/lib/utils/lod-conversion-utils.js.map +0 -1
  383. package/dist/lib/utils/statistic-utills.js.map +0 -1
  384. package/dist/pgm-loader.js.map +0 -1
  385. package/src/3d-tiles-converter/helpers/b3dm-converter.d.ts +0 -23
  386. package/src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +0 -16
  387. package/src/deps-installer/deps-installer.d.ts +0 -10
  388. package/src/deps-installer/deps-installer.js +0 -22
  389. package/src/i3s-converter/helpers/create-scene-server-path.js +0 -25
  390. package/src/i3s-converter/helpers/geometry-converter.d.ts +0 -40
  391. package/src/i3s-converter/helpers/geometry-converter.js +0 -915
  392. package/src/i3s-converter/helpers/node-pages.d.ts +0 -144
  393. package/src/i3s-converter/helpers/node-pages.js +0 -208
  394. package/src/i3s-converter/json-templates/layers.js +0 -199
  395. package/src/lib/geoid-height-model.d.ts +0 -41
  396. package/src/lib/geoid-height-model.js +0 -239
  397. package/src/lib/pgm-parser.d.ts +0 -14
  398. package/src/lib/pgm-parser.js +0 -179
  399. package/src/lib/utils/compress-utils.d.ts +0 -53
  400. package/src/lib/utils/file-utils.d.ts +0 -43
  401. package/src/lib/utils/file-utils.js +0 -38
  402. package/src/lib/utils/lod-conversion-utils.d.ts +0 -32
  403. /package/dist/{i3s-server → es5/i3s-server}/bin/www +0 -0
  404. /package/dist/{i3s-server → es5/i3s-server}/certs/cert.pem +0 -0
  405. /package/dist/{i3s-server → es5/i3s-server}/certs/key.pem +0 -0
  406. /package/src/i3s-converter/json-templates/{store.js → store.ts} +0 -0
  407. /package/src/lib/utils/{statistic-utills.js → statistic-utills.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/i3s-server/routes/index.js"],"names":["express","require","router","Router","getFileNameByUrl","get","req","res","next","fileName","path","sendFile","status","send","module","exports"],"mappings":"AAAA,MAAMA,OAAO,GAAGC,OAAO,CAAC,SAAD,CAAvB;;AACA,MAAMC,MAAM,GAAGF,OAAO,CAACG,MAAR,EAAf;;AACA,MAAM;AAACC,EAAAA;AAAD,IAAqBH,OAAO,CAAC,iCAAD,CAAlC;;AAGAC,MAAM,CAACG,GAAP,CAAW,GAAX,EAAgB,gBAAgBC,GAAhB,EAAqBC,GAArB,EAA0BC,IAA1B,EAAgC;AAC9C,QAAMC,QAAQ,GAAG,MAAML,gBAAgB,CAACE,GAAG,CAACI,IAAL,CAAvC;;AACA,MAAID,QAAJ,EAAc;AACZF,IAAAA,GAAG,CAACI,QAAJ,CAAaF,QAAb;AACD,GAFD,MAEO;AACLF,IAAAA,GAAG,CAACK,MAAJ,CAAW,GAAX;AACAL,IAAAA,GAAG,CAACM,IAAJ,CAAS,gBAAT;AACD;AACF,CARD;AAUAC,MAAM,CAACC,OAAP,GAAiBb,MAAjB","sourcesContent":["const express = require('express');\nconst router = express.Router();\nconst {getFileNameByUrl} = require('../controllers/index-controller');\n\n/* GET home page. */\nrouter.get('*', async function (req, res, next) {\n const fileName = await getFileNameByUrl(req.path);\n if (fileName) {\n res.sendFile(fileName);\n } else {\n res.status(404);\n res.send('File not found');\n }\n});\n\nmodule.exports = router;\n"],"file":"index.js"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["default","I3SConverter","NodePages","Tiles3DConverter","DepsInstaller"],"mappings":"AAAA,SAAQA,OAAO,IAAIC,YAAnB,QAAsC,+BAAtC;AACA,SAAQD,OAAO,IAAIE,SAAnB,QAAmC,oCAAnC;AAEA,SAAQF,OAAO,IAAIG,gBAAnB,QAA0C,yCAA1C;AAEA,SAAQC,aAAR,QAA4B,iCAA5B","sourcesContent":["export {default as I3SConverter} from './i3s-converter/i3s-converter';\nexport {default as NodePages} from './i3s-converter/helpers/node-pages';\n\nexport {default as Tiles3DConverter} from './3d-tiles-converter/3d-tiles-converter';\n\nexport {DepsInstaller} from './deps-installer/deps-installer';\n"],"file":"index.js"}
@@ -1,41 +0,0 @@
1
- /**
2
- * class GeoidHeightModel - "Gravity Height Model"
3
- * Calculates difference between mean see level height and WGS84 ellipsoid height
4
- * Input data have to be loaded from "Earth Gravity Model" *.pgm file with "PGMLoader"
5
- * A particular model file can be loaded on https://geographiclib.sourceforge.io/html/geoid.html
6
- *
7
- * The implementation is ported from GeographicLib-1.50.1
8
- */
9
- export class GeoidHeightModel {
10
- /**
11
- * @constructs
12
- * Create a GeoidHeightModel instance.
13
- * @param options - object which includes parameters parsed from *.pgm header
14
- * @param options.data - binary buffer of *.pgm file
15
- */
16
- constructor(options: {
17
- cubic: boolean;
18
- _width: number;
19
- _height: number;
20
- _rlonres: number;
21
- _rlatres: number;
22
- _offset: number;
23
- _scale: number;
24
- _swidth: number;
25
- _datastart: number;
26
- _maxerror: number;
27
- _rmserror: number;
28
- _description: string;
29
- _datetime: string;
30
- data: Uint8Array;
31
- });
32
-
33
- /**
34
- * Calculates difference between mean see level height and WGS84 ellipsoid height
35
- * Code is ported from /GeographicLib-1.50.1/src/Geoid.cpp
36
- * @param lat - latitude
37
- * @param lon - longitude
38
- * @returns height in meters
39
- */
40
- getHeight(lat: number, lon: number): number;
41
- }
@@ -1,140 +0,0 @@
1
- const c0_ = 240;
2
- const c3_ = [9, -18, -88, 0, 96, 90, 0, 0, -60, -20, -9, 18, 8, 0, -96, 30, 0, 0, 60, -20, 9, -88, -18, 90, 96, 0, -20, -60, 0, 0, 186, -42, -42, -150, -96, -150, 60, 60, 60, 60, 54, 162, -78, 30, -24, -90, -60, 60, -60, 60, -9, -32, 18, 30, 24, 0, 20, -60, 0, 0, -9, 8, 18, 30, -96, 0, -20, 60, 0, 0, 54, -78, 162, -90, -24, 30, 60, -60, 60, -60, -54, 78, 78, 90, 144, 90, -60, -60, -60, -60, 9, -8, -18, -30, -24, 0, 20, 60, 0, 0, -9, 18, -32, 0, 24, 30, 0, 0, -60, 20, 9, -18, -8, 0, -24, -30, 0, 0, 60, 20];
3
- const c0n_ = 372;
4
- const c3n_ = [0, 0, -131, 0, 138, 144, 0, 0, -102, -31, 0, 0, 7, 0, -138, 42, 0, 0, 102, -31, 62, 0, -31, 0, 0, -62, 0, 0, 0, 31, 124, 0, -62, 0, 0, -124, 0, 0, 0, 62, 124, 0, -62, 0, 0, -124, 0, 0, 0, 62, 62, 0, -31, 0, 0, -62, 0, 0, 0, 31, 0, 0, 45, 0, -183, -9, 0, 93, 18, 0, 0, 0, 216, 0, 33, 87, 0, -93, 12, -93, 0, 0, 156, 0, 153, 99, 0, -93, -12, -93, 0, 0, -45, 0, -3, 9, 0, 93, -18, 0, 0, 0, -55, 0, 48, 42, 0, 0, -84, 31, 0, 0, -7, 0, -48, -42, 0, 0, 84, 31];
5
- const c0s_ = 372;
6
- const c3s_ = [18, -36, -122, 0, 120, 135, 0, 0, -84, -31, -18, 36, -2, 0, -120, 51, 0, 0, 84, -31, 36, -165, -27, 93, 147, -9, 0, -93, 18, 0, 210, 45, -111, -93, -57, -192, 0, 93, 12, 93, 162, 141, -75, -93, -129, -180, 0, 93, -12, 93, -36, -21, 27, 93, 39, 9, 0, -93, -18, 0, 0, 0, 62, 0, 0, 31, 0, 0, 0, -31, 0, 0, 124, 0, 0, 62, 0, 0, 0, -62, 0, 0, 124, 0, 0, 62, 0, 0, 0, -62, 0, 0, 62, 0, 0, 31, 0, 0, 0, -31, -18, 36, -64, 0, 66, 51, 0, 0, -102, 31, 18, -36, 2, 0, -66, -51, 0, 0, 102, 31];
7
- const stencilsize_ = 12;
8
- const nterms_ = (3 + 1) * (3 + 2) / 2;
9
- const PIXEL_SIZE = 2;
10
- export class GeoidHeightModel {
11
- constructor(options) {
12
- this.options = options;
13
- this._v00 = 0;
14
- this._v01 = 0;
15
- this._v10 = 0;
16
- this._v11 = 0;
17
- this._t = [];
18
- this._ix = this.options._width;
19
- this._iy = this.options._height;
20
- }
21
-
22
- getHeight(lat, lon) {
23
- lat = Math.abs(lat) > 90 ? NaN : lat;
24
-
25
- if (isNaN(lat) || isNaN(lon)) {
26
- return NaN;
27
- }
28
-
29
- const rem = _remainder(lon, 360);
30
-
31
- lon = rem !== -180 ? rem : 180;
32
- let fx = lon * this.options._rlonres;
33
- let fy = -lat * this.options._rlatres;
34
- let ix = Math.floor(fx);
35
- let iy = Math.min(Math.round((this.options._height - 1) / 2 - 1), Math.floor(fy));
36
- fx -= ix;
37
- fy -= iy;
38
- iy += (this.options._height - 1) / 2;
39
- ix += ix < 0 ? this.options._width : ix >= this.options._width ? -this.options._width : 0;
40
- let v00 = 0;
41
- let v01 = 0;
42
- let v10 = 0;
43
- let v11 = 0;
44
- let t = new Array(nterms_);
45
-
46
- if (!(ix === this._ix && iy === this._iy)) {
47
- if (!this.options.cubic) {
48
- v00 = this._rawval(ix, iy);
49
- v01 = this._rawval(ix + 1, iy);
50
- v10 = this._rawval(ix, iy + 1);
51
- v11 = this._rawval(ix + 1, iy + 1);
52
- } else {
53
- const v = [this._rawval(ix, iy - 1), this._rawval(ix + 1, iy - 1), this._rawval(ix - 1, iy), this._rawval(ix, iy), this._rawval(ix + 1, iy), this._rawval(ix + 2, iy), this._rawval(ix - 1, iy + 1), this._rawval(ix, iy + 1), this._rawval(ix + 1, iy + 1), this._rawval(ix + 2, iy + 1), this._rawval(ix, iy + 2), this._rawval(ix + 1, iy + 2)];
54
- let c3x = c3n_;
55
-
56
- if (iy !== 0) {
57
- c3x = iy === this.options._height - 2 ? c3s_ : c3_;
58
- }
59
-
60
- let c0x = c0n_;
61
-
62
- if (iy !== 0) {
63
- c0x = iy === this.options._height - 2 ? c0s_ : c0_;
64
- }
65
-
66
- for (let i = 0; i < nterms_; ++i) {
67
- t[i] = 0;
68
-
69
- for (let j = 0; j < stencilsize_; ++j) {
70
- t[i] += v[j] * c3x[nterms_ * j + i];
71
- }
72
-
73
- t[i] /= c0x;
74
- }
75
- }
76
- } else if (!this.options.cubic) {
77
- v00 = this._v00;
78
- v01 = this._v01;
79
- v10 = this._v10;
80
- v11 = this._v11;
81
- } else {
82
- t = this._t;
83
- }
84
-
85
- if (!this.options.cubic) {
86
- const a = (1 - fx) * v00 + fx * v01;
87
- const b = (1 - fx) * v10 + fx * v11;
88
- const c = (1 - fy) * a + fy * b;
89
- const h = this.options._offset + this.options._scale * c;
90
- this._ix = ix;
91
- this._iy = iy;
92
- this._v00 = v00;
93
- this._v01 = v01;
94
- this._v10 = v10;
95
- this._v11 = v11;
96
- return h;
97
- }
98
-
99
- let h = t[0] + fx * (t[1] + fx * (t[3] + fx * t[6])) + fy * (t[2] + fx * (t[4] + fx * t[7]) + fy * (t[5] + fx * t[8] + fy * t[9]));
100
- h = this.options._offset + this.options._scale * h;
101
- this._ix = ix;
102
- this._iy = iy;
103
- this._t = t;
104
- return h;
105
- }
106
-
107
- _rawval(ix, iy) {
108
- if (ix < 0) {
109
- ix += this.options._width;
110
- } else if (ix >= this.options._width) {
111
- ix -= this.options._width;
112
- }
113
-
114
- if (iy < 0 || iy >= this.options._height) {
115
- iy = iy < 0 ? -iy : 2 * (this.options._height - 1) - iy;
116
- ix += (ix < this.options._width / 2 ? 1 : -1) * this.options._width / 2;
117
- }
118
-
119
- const bufferPosition = this.options._datastart + PIXEL_SIZE * (iy * this.options._swidth + ix);
120
- const a = this.options.data[bufferPosition];
121
- const b = this.options.data[bufferPosition + 1];
122
- const r = a << 8 | b;
123
- return r;
124
- }
125
-
126
- }
127
-
128
- function _remainder(x, y) {
129
- y = Math.abs(y);
130
-
131
- let z = _fmod(x, y);
132
-
133
- if (2 * Math.abs(z) === y) z -= _fmod(x, 2 * y) - z;else if (2 * Math.abs(z) > y) z += z < 0 ? y : -y;
134
- return z;
135
- }
136
-
137
- function _fmod(x, y) {
138
- return x - Math.floor(x / y) * y;
139
- }
140
- //# sourceMappingURL=geoid-height-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/geoid-height-model.js"],"names":["c0_","c3_","c0n_","c3n_","c0s_","c3s_","stencilsize_","nterms_","PIXEL_SIZE","GeoidHeightModel","constructor","options","_v00","_v01","_v10","_v11","_t","_ix","_width","_iy","_height","getHeight","lat","lon","Math","abs","NaN","isNaN","rem","_remainder","fx","_rlonres","fy","_rlatres","ix","floor","iy","min","round","v00","v01","v10","v11","t","Array","cubic","_rawval","v","c3x","c0x","i","j","a","b","c","h","_offset","_scale","bufferPosition","_datastart","_swidth","data","r","x","y","z","_fmod"],"mappings":"AAgBA,MAAMA,GAAG,GAAG,GAAZ;AAGA,MAAMC,GAAG,GAAG,CACV,CADU,EACP,CAAC,EADM,EACF,CAAC,EADC,EACM,CADN,EACU,EADV,EACgB,EADhB,EACsB,CADtB,EAC2B,CAD3B,EAC8B,CAAC,EAD/B,EACmC,CAAC,EADpC,EAEV,CAAC,CAFS,EAEL,EAFK,EAEC,CAFD,EAEO,CAFP,EAEU,CAAC,EAFX,EAEiB,EAFjB,EAEuB,CAFvB,EAE4B,CAF5B,EAEgC,EAFhC,EAEoC,CAAC,EAFrC,EAGV,CAHU,EAGP,CAAC,EAHM,EAGF,CAAC,EAHC,EAGK,EAHL,EAGU,EAHV,EAGiB,CAHjB,EAGoB,CAAC,EAHrB,EAGyB,CAAC,EAH1B,EAGgC,CAHhC,EAGqC,CAHrC,EAIV,GAJU,EAIL,CAAC,EAJI,EAIA,CAAC,EAJD,EAIK,CAAC,GAJN,EAIW,CAAC,EAJZ,EAIgB,CAAC,GAJjB,EAIuB,EAJvB,EAI4B,EAJ5B,EAIiC,EAJjC,EAIsC,E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Location: /GeographicLib-1.50.1/src/Geoid.cpp\n * /GeographicLib-1.50.1/include/GeographicLib/Geoid.hpp\n * /GeographicLib-1.50.1/src/Math.cpp\n *\n * File header:\n * * \\file Geoid.cpp (Geoid.hpp)\n * * \\brief Implementation for GeographicLib::Geoid class\n * *\n * * Copyright (c) Charles Karney (2009-2018) <charles@karney.com> and licensed\n * * under the MIT/X11 License. For more information, see\n * * https://geographiclib.sourceforge.io/\n **********************************************************************/\n\nconst c0_ = 240;\n\n// prettier-ignore\nconst c3_ = [\n 9, -18, -88, 0, 96, 90, 0, 0, -60, -20,\n -9, 18, 8, 0, -96, 30, 0, 0, 60, -20,\n 9, -88, -18, 90, 96, 0, -20, -60, 0, 0,\n 186, -42, -42, -150, -96, -150, 60, 60, 60, 60,\n 54, 162, -78, 30, -24, -90, -60, 60, -60, 60,\n -9, -32, 18, 30, 24, 0, 20, -60, 0, 0,\n -9, 8, 18, 30, -96, 0, -20, 60, 0, 0,\n 54, -78, 162, -90, -24, 30, 60, -60, 60, -60,\n -54, 78, 78, 90, 144, 90, -60, -60, -60, -60,\n 9, -8, -18, -30, -24, 0, 20, 60, 0, 0,\n -9, 18, -32, 0, 24, 30, 0, 0, -60, 20,\n 9, -18, -8, 0, -24, -30, 0, 0, 60, 20\n];\n\nconst c0n_ = 372;\n\n// prettier-ignore\nconst c3n_ = [\n 0, 0, -131, 0, 138, 144, 0, 0, -102, -31,\n 0, 0, 7, 0, -138, 42, 0, 0, 102, -31,\n 62, 0, -31, 0, 0, -62, 0, 0, 0, 31,\n 124, 0, -62, 0, 0, -124, 0, 0, 0, 62,\n 124, 0, -62, 0, 0, -124, 0, 0, 0, 62,\n 62, 0, -31, 0, 0, -62, 0, 0, 0, 31,\n 0, 0, 45, 0, -183, -9, 0, 93, 18, 0,\n 0, 0, 216, 0, 33, 87, 0, -93, 12, -93,\n 0, 0, 156, 0, 153, 99, 0, -93, -12, -93,\n 0, 0, -45, 0, -3, 9, 0, 93, -18, 0,\n 0, 0, -55, 0, 48, 42, 0, 0, -84, 31,\n 0, 0, -7, 0, -48, -42, 0, 0, 84, 31,\n];\n\nconst c0s_ = 372;\n\n// prettier-ignore\nconst c3s_ = [\n 18, -36, -122, 0, 120, 135, 0, 0, -84, -31,\n -18, 36, -2, 0, -120, 51, 0, 0, 84, -31,\n 36, -165, -27, 93, 147, -9, 0, -93, 18, 0,\n 210, 45, -111, -93, -57, -192, 0, 93, 12, 93,\n 162, 141, -75, -93, -129, -180, 0, 93, -12, 93,\n -36, -21, 27, 93, 39, 9, 0, -93, -18, 0,\n 0, 0, 62, 0, 0, 31, 0, 0, 0, -31,\n 0, 0, 124, 0, 0, 62, 0, 0, 0, -62,\n 0, 0, 124, 0, 0, 62, 0, 0, 0, -62,\n 0, 0, 62, 0, 0, 31, 0, 0, 0, -31,\n -18, 36, -64, 0, 66, 51, 0, 0, -102, 31,\n 18, -36, 2, 0, -66, -51, 0, 0, 102, 31,\n];\nconst stencilsize_ = 12;\nconst nterms_ = ((3 + 1) * (3 + 2)) / 2; // for a cubic fit\nconst PIXEL_SIZE = 2;\n\nexport class GeoidHeightModel {\n constructor(options) {\n this.options = options;\n this._v00 = 0;\n this._v01 = 0;\n this._v10 = 0;\n this._v11 = 0;\n this._t = [];\n\n this._ix = this.options._width;\n this._iy = this.options._height;\n }\n\n // eslint-disable-next-line max-statements, complexity\n getHeight(lat, lon) {\n // C++: Math::LatFix(lat)\n lat = Math.abs(lat) > 90 ? NaN : lat;\n\n if (isNaN(lat) || isNaN(lon)) {\n return NaN;\n }\n\n // C++: Math::AngNormalize(lon)\n const rem = _remainder(lon, 360);\n lon = rem !== -180 ? rem : 180;\n\n let fx = lon * this.options._rlonres;\n let fy = -lat * this.options._rlatres;\n let ix = Math.floor(fx);\n let iy = Math.min(Math.round((this.options._height - 1) / 2 - 1), Math.floor(fy));\n fx -= ix;\n fy -= iy;\n iy += (this.options._height - 1) / 2;\n ix += ix < 0 ? this.options._width : ix >= this.options._width ? -this.options._width : 0;\n let v00 = 0;\n let v01 = 0;\n let v10 = 0;\n let v11 = 0;\n let t = new Array(nterms_);\n if (!(ix === this._ix && iy === this._iy)) {\n if (!this.options.cubic) {\n v00 = this._rawval(ix, iy);\n v01 = this._rawval(ix + 1, iy);\n v10 = this._rawval(ix, iy + 1);\n v11 = this._rawval(ix + 1, iy + 1);\n } else {\n const v = [\n this._rawval(ix, iy - 1),\n this._rawval(ix + 1, iy - 1),\n this._rawval(ix - 1, iy),\n this._rawval(ix, iy),\n this._rawval(ix + 1, iy),\n this._rawval(ix + 2, iy),\n this._rawval(ix - 1, iy + 1),\n this._rawval(ix, iy + 1),\n this._rawval(ix + 1, iy + 1),\n this._rawval(ix + 2, iy + 1),\n this._rawval(ix, iy + 2),\n this._rawval(ix + 1, iy + 2)\n ];\n\n let c3x = c3n_;\n if (iy !== 0) {\n c3x = iy === this.options._height - 2 ? c3s_ : c3_;\n }\n let c0x = c0n_;\n if (iy !== 0) {\n c0x = iy === this.options._height - 2 ? c0s_ : c0_;\n }\n for (let i = 0; i < nterms_; ++i) {\n t[i] = 0;\n // eslint-disable-next-line max-depth\n for (let j = 0; j < stencilsize_; ++j) {\n t[i] += v[j] * c3x[nterms_ * j + i];\n }\n t[i] /= c0x;\n }\n }\n } else if (!this.options.cubic) {\n // same cell; used cached coefficients\n v00 = this._v00;\n v01 = this._v01;\n v10 = this._v10;\n v11 = this._v11;\n } else {\n t = this._t;\n }\n\n if (!this.options.cubic) {\n const a = (1 - fx) * v00 + fx * v01;\n const b = (1 - fx) * v10 + fx * v11;\n const c = (1 - fy) * a + fy * b;\n const h = this.options._offset + this.options._scale * c;\n this._ix = ix;\n this._iy = iy;\n this._v00 = v00;\n this._v01 = v01;\n this._v10 = v10;\n this._v11 = v11;\n return h;\n }\n let h =\n t[0] +\n fx * (t[1] + fx * (t[3] + fx * t[6])) +\n fy * (t[2] + fx * (t[4] + fx * t[7]) + fy * (t[5] + fx * t[8] + fy * t[9]));\n h = this.options._offset + this.options._scale * h;\n this._ix = ix;\n this._iy = iy;\n this._t = t;\n return h;\n }\n\n /**\n * Method seeks for particular data in th pgm buffer\n * Code is ported from corresponding method\n * in /GeographicLib-1.50.1/include/GeographicLib/Geoid.hpp\n * @param {number} ix - longituge parameter\n * @param {number} iy - latitude parameter\n * @returns {number} data from pgm binary buffer\n */\n _rawval(ix, iy) {\n if (ix < 0) {\n ix += this.options._width;\n } else if (ix >= this.options._width) {\n ix -= this.options._width;\n }\n if (iy < 0 || iy >= this.options._height) {\n iy = iy < 0 ? -iy : 2 * (this.options._height - 1) - iy;\n ix += ((ix < this.options._width / 2 ? 1 : -1) * this.options._width) / 2;\n }\n const bufferPosition = this.options._datastart + PIXEL_SIZE * (iy * this.options._swidth + ix);\n // initial values to suppress warnings in case get fails\n const a = this.options.data[bufferPosition];\n const b = this.options.data[bufferPosition + 1];\n const r = (a << 8) | b;\n return r;\n }\n}\n\n/**\n * Method calculates remainder of float numbers division\n * Code is ported from corresponding method\n * in /GeographicLib-1.50.1/src/Math.cpp\n * Math::remainder(T x, T y)\n * @param {number} x - numerator\n * @param {number} y - denominator\n * @returns {number} - remainder\n */\nfunction _remainder(x, y) {\n y = Math.abs(y); // The result doesn't depend on the sign of y\n let z = _fmod(x, y);\n if (2 * Math.abs(z) === y) z -= _fmod(x, 2 * y) - z;\n // Implement ties to even\n else if (2 * Math.abs(z) > y) z += z < 0 ? y : -y; // Fold remaining cases to (-y/2, y/2)\n return z;\n}\n\n/**\n * Computes the floating-point remainder of the division operation x/y\n * @param {number} x - numerator\n * @param {number} y - denominator\n * @returns {number} - remainder\n */\nfunction _fmod(x, y) {\n return x - Math.floor(x / y) * y;\n}\n"],"file":"geoid-height-model.js"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Parse header of "Earth Gravity Model" *.pgm file
3
- * The implementation is ported from GeographicLib-1.50.1
4
- * https://geographiclib.sourceforge.io/html/index.html
5
- */
6
-
7
- /**
8
- * Parse "Earth Gravity Model" loaded from a *.pgm file
9
- * https://geographiclib.sourceforge.io/html/geoid.html
10
- * @param {Uint8Array} data - binary buffer of pgm file
11
- * @param {Object} options - loader options
12
- * @returns {GeoidHeightModel} - instance of GeoidHeightModel class
13
- */
14
- export function parsePgm(data, options);
@@ -1,183 +0,0 @@
1
- import { GeoidHeightModel } from './geoid-height-model';
2
- const ENDL = 10;
3
- const PIXEL_MAX = 65535;
4
- export function parsePgm(data, options) {
5
- const getline = _getLineGenerator(data);
6
-
7
- let currentLine = getline.next();
8
-
9
- if (currentLine.done || currentLine.value.line !== 'P5') {
10
- throw new Error('Geoid model file: File not in PGM format');
11
- }
12
-
13
- let _offset = Number.MAX_VALUE;
14
- let _scale = 0;
15
-
16
- let _maxerror = -1;
17
-
18
- let _rmserror = -1;
19
-
20
- let _description = 'NONE';
21
- let _datetime = 'UNKNOWN';
22
- let _width = 0;
23
- let _height = 0;
24
- let _datastart = null;
25
- let _swidth = null;
26
-
27
- do {
28
- currentLine = getline.next();
29
- const s = currentLine.value.line;
30
-
31
- if (!s.length) {
32
- continue;
33
- }
34
-
35
- if (s[0] === '#') {
36
- const sArr = s.split(' ');
37
- const commentId = sArr[0];
38
- const key = sArr[1];
39
-
40
- if (commentId !== '#' || !key) {
41
- continue;
42
- }
43
-
44
- const infoArr = sArr.length > 2 ? sArr.slice(2) : [];
45
-
46
- if (key === 'Description') {
47
- _description = infoArr.join(' ');
48
- } else if (key === 'DateTime') {
49
- _datetime = infoArr.join(' ');
50
- } else if (key === 'Offset') {
51
- if (!sArr[2]) {
52
- throw new Error('Geoid model file: Error reading offset');
53
- }
54
-
55
- _offset = parseInt(sArr[2], 10);
56
- } else if (key === 'Scale') {
57
- if (!sArr[2]) {
58
- throw new Error('Geoid model file: Error reading scale');
59
- }
60
-
61
- _scale = parseFloat(sArr[2]);
62
- } else if (key === (options.cubic ? 'MaxCubicError' : 'MaxBilinearError')) {
63
- if (isFinite(parseFloat(sArr[2]))) {
64
- _maxerror = parseFloat(sArr[2]);
65
- }
66
- } else if (key === (options.cubic ? 'RMSCubicError' : 'RMSBilinearError')) {
67
- if (isFinite(parseFloat(sArr[2]))) {
68
- _rmserror = parseFloat(sArr[2]);
69
- }
70
- }
71
- } else {
72
- let sArr = s.split(' ');
73
- sArr = sArr.filter(testString => testString !== '');
74
- _width = parseInt(sArr[0], 10);
75
- _height = parseInt(sArr[1], 10);
76
-
77
- if (!(_width && _height)) {
78
- throw new Error('Geoid model file: Error reading raster size');
79
- }
80
-
81
- break;
82
- }
83
- } while (!currentLine.done);
84
-
85
- currentLine = getline.next();
86
- const maxval = parseInt(currentLine.value.line, 10);
87
-
88
- if (currentLine.done) {
89
- throw new Error('Geoid model file: Error reading maxval');
90
- }
91
-
92
- if (maxval !== PIXEL_MAX) {
93
- throw new Error('Geoid model file: Incorrect value of maxval');
94
- }
95
-
96
- _datastart = currentLine.value.offset;
97
- _swidth = _width;
98
-
99
- if (_offset === Number.MAX_VALUE) {
100
- throw new Error('Geoid model file: Offset not set');
101
- }
102
-
103
- if (_scale === 0) {
104
- throw new Error('Geoid model file: Scale not set');
105
- }
106
-
107
- if (_scale < 0) {
108
- throw new Error('Geoid model file: Scale must be positive');
109
- }
110
-
111
- if (_height < 2 || _width < 2) {
112
- throw new Error('Geoid model file: Raster size too small');
113
- }
114
-
115
- if (_width & 1) {
116
- throw new Error('Geoid model file: Raster width is odd');
117
- }
118
-
119
- if (!(_height & 1)) {
120
- throw new Error('Geoid model file: Raster height is even');
121
- }
122
-
123
- const _rlonres = _width / 360;
124
-
125
- const _rlatres = (_height - 1) / 180;
126
-
127
- return new GeoidHeightModel({
128
- cubic: options.cubic,
129
- _width,
130
- _height,
131
- _rlonres,
132
- _rlatres,
133
- _offset,
134
- _scale,
135
- _swidth,
136
- _datastart,
137
- _maxerror,
138
- _rmserror,
139
- _description,
140
- _datetime,
141
- data
142
- });
143
- }
144
-
145
- function* _getLineGenerator(data) {
146
- let offset = 0;
147
-
148
- do {
149
- const endLineIndex = data.indexOf(ENDL, offset);
150
-
151
- if (endLineIndex !== -1) {
152
- const line = data.subarray(offset, endLineIndex);
153
- offset = endLineIndex + 1;
154
- yield {
155
- offset,
156
- line: _getStringFromCharArray(line)
157
- };
158
- } else {
159
- const line = data.subarray(offset, data.length);
160
- offset = data.length;
161
- yield {
162
- offset,
163
- line: _getStringFromCharArray(line)
164
- };
165
- }
166
- } while (offset < data.length);
167
-
168
- return {
169
- offset,
170
- line: ''
171
- };
172
- }
173
-
174
- function _getStringFromCharArray(array) {
175
- let s = '';
176
-
177
- for (const char of array) {
178
- s += String.fromCharCode(char);
179
- }
180
-
181
- return s;
182
- }
183
- //# sourceMappingURL=pgm-parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/pgm-parser.js"],"names":["GeoidHeightModel","ENDL","PIXEL_MAX","parsePgm","data","options","getline","_getLineGenerator","currentLine","next","done","value","line","Error","_offset","Number","MAX_VALUE","_scale","_maxerror","_rmserror","_description","_datetime","_width","_height","_datastart","_swidth","s","length","sArr","split","commentId","key","infoArr","slice","join","parseInt","parseFloat","cubic","isFinite","filter","testString","maxval","offset","_rlonres","_rlatres","endLineIndex","indexOf","subarray","_getStringFromCharArray","array","char","String","fromCharCode"],"mappings":"AAcA,SAAQA,gBAAR,QAA+B,sBAA/B;AAEA,MAAMC,IAAI,GAAG,EAAb;AACA,MAAMC,SAAS,GAAG,KAAlB;AAGA,OAAO,SAASC,QAAT,CAAkBC,IAAlB,EAAwBC,OAAxB,EAAiC;AACtC,QAAMC,OAAO,GAAGC,iBAAiB,CAACH,IAAD,CAAjC;;AACA,MAAII,WAAW,GAAGF,OAAO,CAACG,IAAR,EAAlB;;AACA,MAAID,WAAW,CAACE,IAAZ,IAAoBF,WAAW,CAACG,KAAZ,CAAkBC,IAAlB,KAA2B,IAAnD,EAAyD;AACvD,UAAM,IAAIC,KAAJ,CAAU,0CAAV,CAAN;AACD;;AACD,MAAIC,OAAO,GAAGC,MAAM,CAACC,SAArB;AACA,MAAIC,MAAM,GAAG,CAAb;;AACA,MAAIC,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AAOD,SAASoC,uBAAT,CAAiCC,KAAjC,EAAwC;AACtC,MAAIvB,CAAC,GAAG,EAAR;;AACA,OAAK,MAAMwB,IAAX,IAAmBD,KAAnB,EAA0B;AACxBvB,IAAAA,CAAC,IAAIyB,MAAM,CAACC,YAAP,CAAoBF,IAApB,CAAL;AACD;;AACD,SAAOxB,CAAP;AACD","sourcesContent":["/**\n * Parsing code is ported from GeographicLib-1.50.1\n * https://geographiclib.sourceforge.io/html/index.html\n * Location: /GeographicLib-1.50.1/src/Geoid.cpp\n *\n * File header:\n * * \\file Geoid.cpp\n * * \\brief Implementation for GeographicLib::Geoid class\n * *\n * * Copyright (c) Charles Karney (2009-2018) <charles@karney.com> and licensed\n * * under the MIT/X11 License. For more information, see\n * * https://geographiclib.sourceforge.io/\n **********************************************************************/\n\nimport {GeoidHeightModel} from './geoid-height-model';\n\nconst ENDL = 10;\nconst PIXEL_MAX = 65535;\n\n// eslint-disable-next-line\nexport function parsePgm(data, options) {\n const getline = _getLineGenerator(data);\n let currentLine = getline.next();\n if (currentLine.done || currentLine.value.line !== 'P5') {\n throw new Error('Geoid model file: File not in PGM format');\n }\n let _offset = Number.MAX_VALUE;\n let _scale = 0;\n let _maxerror = -1;\n let _rmserror = -1;\n let _description = 'NONE';\n let _datetime = 'UNKNOWN';\n let _width = 0;\n let _height = 0;\n let _datastart = null;\n let _swidth = null;\n do {\n currentLine = getline.next();\n const s = currentLine.value.line;\n if (!s.length) {\n continue; // eslint-disable-line no-continue\n }\n if (s[0] === '#') {\n const sArr = s.split(' ');\n const commentId = sArr[0];\n const key = sArr[1];\n if (commentId !== '#' || !key) {\n continue; // eslint-disable-line no-continue\n }\n const infoArr = sArr.length > 2 ? sArr.slice(2) : [];\n if (key === 'Description') {\n _description = infoArr.join(' ');\n } else if (key === 'DateTime') {\n _datetime = infoArr.join(' ');\n } else if (key === 'Offset') {\n // eslint-disable-next-line max-depth\n if (!sArr[2]) {\n throw new Error('Geoid model file: Error reading offset');\n }\n _offset = parseInt(sArr[2], 10);\n } else if (key === 'Scale') {\n // eslint-disable-next-line max-depth\n if (!sArr[2]) {\n throw new Error('Geoid model file: Error reading scale');\n }\n _scale = parseFloat(sArr[2]);\n } else if (key === (options.cubic ? 'MaxCubicError' : 'MaxBilinearError')) {\n // It's not an error if the error can't be read\n // eslint-disable-next-line max-depth\n if (isFinite(parseFloat(sArr[2]))) {\n _maxerror = parseFloat(sArr[2]);\n }\n } else if (key === (options.cubic ? 'RMSCubicError' : 'RMSBilinearError')) {\n // It's not an error if the error can't be read\n // eslint-disable-next-line max-depth\n if (isFinite(parseFloat(sArr[2]))) {\n _rmserror = parseFloat(sArr[2]);\n }\n }\n } else {\n let sArr = s.split(' ');\n sArr = sArr.filter((testString) => testString !== '');\n _width = parseInt(sArr[0], 10);\n _height = parseInt(sArr[1], 10);\n if (!(_width && _height)) {\n throw new Error('Geoid model file: Error reading raster size');\n }\n break;\n }\n } while (!currentLine.done);\n\n currentLine = getline.next();\n const maxval = parseInt(currentLine.value.line, 10);\n if (currentLine.done) {\n throw new Error('Geoid model file: Error reading maxval');\n }\n if (maxval !== PIXEL_MAX) {\n throw new Error('Geoid model file: Incorrect value of maxval');\n }\n // Add 1 for whitespace after maxval\n _datastart = currentLine.value.offset;\n _swidth = _width;\n\n if (_offset === Number.MAX_VALUE) {\n throw new Error('Geoid model file: Offset not set');\n }\n if (_scale === 0) {\n throw new Error('Geoid model file: Scale not set');\n }\n if (_scale < 0) {\n throw new Error('Geoid model file: Scale must be positive');\n }\n if (_height < 2 || _width < 2) {\n // Coarsest grid spacing is 180deg.\n throw new Error('Geoid model file: Raster size too small');\n }\n if (_width & 1) {\n // This is so that longitude grids can be extended thru the poles.\n throw new Error('Geoid model file: Raster width is odd');\n }\n if (!(_height & 1)) {\n // This is so that latitude grid includes the equator.\n throw new Error('Geoid model file: Raster height is even');\n }\n\n const _rlonres = _width / 360;\n const _rlatres = (_height - 1) / 180;\n return new GeoidHeightModel({\n cubic: options.cubic,\n _width,\n _height,\n _rlonres,\n _rlatres,\n _offset,\n _scale,\n _swidth,\n _datastart,\n _maxerror,\n _rmserror,\n _description,\n _datetime,\n data\n });\n}\n\n/**\n * Yields strings from pgm file (splitted by 10 - new line symbol)\n * @param {Uint8Array} data - binary buffer of pgm file\n * @returns {Generator}\n */\nfunction* _getLineGenerator(data) {\n let offset = 0;\n do {\n const endLineIndex = data.indexOf(ENDL, offset);\n if (endLineIndex !== -1) {\n const line = data.subarray(offset, endLineIndex);\n offset = endLineIndex + 1;\n yield {offset, line: _getStringFromCharArray(line)};\n } else {\n const line = data.subarray(offset, data.length);\n offset = data.length;\n yield {offset, line: _getStringFromCharArray(line)};\n }\n } while (offset < data.length);\n return {offset, line: ''};\n}\n\n/**\n * Converts Uint8Array of char-codes to string\n * @param {Uint8Array} array - binary buffer of pgm file\n * @returns {string}\n */\nfunction _getStringFromCharArray(array) {\n let s = '';\n for (const char of array) {\n s += String.fromCharCode(char);\n }\n return s;\n}\n"],"file":"pgm-parser.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/utils/compress-util.js"],"names":["createGzip","join","promises","fs","createReadStream","createWriteStream","archiver","removeFile","ChildProcessProxy","JSZip","MD5Hash","crypt","getAbsoluteFilePath","compressFileWithGzip","pathFile","compressedPathFile","gzip","input","output","Promise","resolve","reject","on","console","log","error","pipe","compressFilesWithZip","fileMap","outputFile","level","e","archive","zlib","pointer","err","subFileName","subFileData","appendFileToArchive","finalize","compressWithChildProcess","process","platform","compressWithChildProcessWindows","arguments","compressWithChildProcessUnix","inputFolder","inputFiles","fullOutputFile","args","childProcess","start","command","spawn","cwd","wait","sevenZipExe","substr","generateHash128FromZip","inputZipFile","readFile","zip","loadAsync","hashTable","zipFiles","files","relativePath","zipEntry","_data","content","compressedContent","dir","hash","Buffer","from","toLowerCase","push","key","atob","value","byteOffset","sort","prev","next","item","_longToByteArray","write","hexToBytes","concat","close","long","buffer","ArrayBuffer","longNum","Float64Array","Array","Uint8Array","reverse","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AAP,GAAaH,IAAb;AACA,SAAOK,KAAK,CAACrB,IAAN,CAAW,IAAIsB,UAAJ,CAAeL,MAAf,CAAX,EAAmCM,OAAnC,EAAP;AACD;;AAED,OAAO,eAAeC,YAAf,CAA4BpD,WAA5B,EAAyCqD,QAAzC,EAAmDC,OAAnD,EAA4D5C,WAA5D,EAAyE;AAC9E,QAAMhB,wBAAwB,CAACM,WAAD,EAAcsD,OAAd,EAAuB,CAAvB,EAA0BD,QAA1B,EAAoC3C,WAApC,CAA9B;AACAjC,EAAAA,OAAO,CAACC,GAAR,WAAe2E,QAAf,uBAAoCC,OAApC;AACD;;AAED,SAAS9D,mBAAT,CAA6BN,OAA7B,EAAsCI,WAAtC,EAAmDC,WAAnD,EAAgE;AAC9D,SAAO,IAAIlB,OAAJ,CAAaC,OAAD,IAAa;AAC9B,UAAMiF,UAAU,GAAGjG,gBAAgB,CAACiC,WAAD,CAAnC;AACAd,IAAAA,OAAO,CAACC,GAAR,8BAAkCY,WAAlC;AACAiE,IAAAA,UAAU,CAAC/E,EAAX,CAAc,OAAd,EAAuB,MAAM;AAC3BC,MAAAA,OAAO,CAACC,GAAR,+BAAmCY,WAAnC;AACAhB,MAAAA,OAAO,CAAC,IAAD,CAAP;AACD,KAHD;AAIAY,IAAAA,OAAO,CAACsE,MAAR,CAAeD,UAAf,EAA2B;AAACE,MAAAA,IAAI,EAAEnE;AAAP,KAA3B;AACD,GARM,CAAP;AASD","sourcesContent":["import {createGzip} from 'zlib';\nimport {join} from 'path';\nimport {promises as fs, createReadStream, createWriteStream} from 'fs';\nimport archiver from 'archiver';\nimport {removeFile} from './file-utils';\nimport {ChildProcessProxy} from '@loaders.gl/worker-utils';\nimport JSZip from 'jszip';\nimport {MD5Hash} from '@loaders.gl/crypto';\nimport crypt from 'crypt';\nimport {getAbsoluteFilePath} from './file-utils';\n\nexport function compressFileWithGzip(pathFile) {\n const compressedPathFile = `${pathFile}.gz`;\n const gzip = createGzip();\n const input = createReadStream(pathFile);\n const output = createWriteStream(compressedPathFile);\n\n return new Promise((resolve, reject) => {\n input.on('end', () => {\n console.log(`${compressedPathFile} compressed and saved.`); // eslint-disable-line no-undef,no-console\n resolve(compressedPathFile);\n });\n input.on('error', (error) => {\n console.log(`${compressedPathFile}: compression error!`); // eslint-disable-line no-undef,no-console\n reject(error);\n });\n input.pipe(gzip).pipe(output);\n });\n}\n\nexport async function compressFilesWithZip(fileMap, outputFile, level = 0) {\n // Before creating a new file, we need to delete the old file\n try {\n await removeFile(outputFile);\n } catch (e) {\n // Do nothing if old file doesn't exist\n }\n\n const output = createWriteStream(outputFile);\n const archive = archiver('zip', {\n zlib: {level} // Sets the compression level.\n });\n\n return new Promise(async (resolve, reject) => {\n // listen for all archive data to be writte\n // 'close' event is fired only when a file descriptor is involved\n output.on('close', function () {\n console.log(`${outputFile} saved.`); // eslint-disable-line no-undef,no-console\n console.log(`${archive.pointer()} total bytes`); // eslint-disable-line no-undef,no-console\n resolve(null);\n });\n\n // This event is fired when the data source is drained no matter what was the data source.\n // It is not part of this library but rather from the NodeJS Stream API.\n // @see: https://nodejs.org/api/stream.html#stream_event_end\n output.on('end', function () {\n console.log('Data has been drained'); // eslint-disable-line no-undef,no-console\n resolve(null);\n });\n\n // good practice to catch warnings (ie stat failures and other non-blocking errors)\n archive.on('warning', function (err) {\n console.log(err); // eslint-disable-line no-undef,no-console\n reject(err);\n });\n\n // good practice to catch this error explicitly\n archive.on('error', function (err) {\n reject(err);\n });\n\n // pipe archive data to the file\n archive.pipe(output);\n\n for (const subFileName in fileMap) {\n const subFileData = fileMap[subFileName];\n await appendFileToArchive(archive, subFileName, subFileData);\n }\n\n // finalize the archive (ie we are done appending files but streams have to finish yet)\n archive.finalize();\n });\n}\n\nexport async function compressWithChildProcess() {\n // eslint-disable-next-line no-undef\n if (process.platform === 'win32') {\n await compressWithChildProcessWindows(...arguments);\n } else {\n await compressWithChildProcessUnix(...arguments);\n }\n}\n\nasync function compressWithChildProcessUnix(inputFolder, outputFile, level = 0, inputFiles = '.') {\n const fullOutputFile = getAbsoluteFilePath(outputFile);\n const args = [`-${level}`, '-r', fullOutputFile, inputFiles];\n const childProcess = new ChildProcessProxy();\n await childProcess.start({\n command: 'zip',\n arguments: args,\n spawn: {\n cwd: inputFolder\n },\n wait: 0\n });\n}\n\nasync function compressWithChildProcessWindows(\n inputFolder,\n outputFile,\n level = 0,\n inputFiles = join('.', '*'),\n sevenZipExe\n) {\n // Workaround for @listfile issue. In 7z.exe @-leading files are handled as listfiles\n // https://sevenzip.osdn.jp/chm/cmdline/syntax.htm\n if (inputFiles[0] === '@') {\n inputFiles = `*${inputFiles.substr(1)}`;\n }\n\n const fullOutputFile = getAbsoluteFilePath(outputFile);\n const args = ['a', '-tzip', `-mx=${level}`, fullOutputFile, inputFiles];\n const childProcess = new ChildProcessProxy();\n await childProcess.start({\n command: sevenZipExe,\n arguments: args,\n spawn: {\n cwd: `${inputFolder}`\n },\n wait: 0\n });\n}\n\nexport async function generateHash128FromZip(inputZipFile, outputFile) {\n const input = await fs.readFile(inputZipFile);\n const zip = await JSZip.loadAsync(input);\n const hashTable = [];\n const zipFiles = zip.files;\n for (const relativePath in zipFiles) {\n const zipEntry = zipFiles[relativePath];\n // Had to use a workaround because the correct string is getting the wrong data\n // const content = await zipEntry.async('nodebuffer');\n // _data isn't described in the interface, so lint thought it was wrong\n const _data = '_data';\n const content = zipEntry[_data].compressedContent;\n if (zipEntry.dir) continue; // eslint-disable-line no-continue\n // eslint-disable-next-line no-undef\n const hash = await new MD5Hash().hash(Buffer.from(relativePath.toLowerCase()));\n // eslint-disable-next-line no-undef\n hashTable.push({key: atob(hash), value: content.byteOffset});\n }\n\n hashTable.sort((prev, next) => {\n if (prev.key === next.key) {\n return prev.value < next.value ? -1 : 1;\n }\n return prev.key < next.key ? -1 : 1;\n });\n\n const output = createWriteStream(outputFile);\n return new Promise((resolve, reject) => {\n output.on('close', function () {\n console.log(`${outputFile} generated and saved`); // eslint-disable-line\n resolve(null);\n });\n output.on('error', function (err) {\n console.log(err); // eslint-disable-line\n reject(err);\n });\n for (const key in hashTable) {\n const item = hashTable[key];\n const value = _longToByteArray(item.value);\n // TODO: perhaps you need to wait for the 'drain' event if the write returns 'false'\n // eslint-disable-next-line no-undef\n output.write(Buffer.from(crypt.hexToBytes(item.key).concat(value)));\n }\n output.close();\n });\n}\n\nfunction _longToByteArray(long) {\n const buffer = new ArrayBuffer(8); // JS numbers are 8 bytes long, or 64 bits\n const longNum = new Float64Array(buffer); // so equivalent to Float64\n longNum[0] = long;\n return Array.from(new Uint8Array(buffer)).reverse(); // reverse to get little endian\n}\n\nexport async function addFileToZip(inputFolder, fileName, zipFile, sevenZipExe) {\n await compressWithChildProcess(inputFolder, zipFile, 0, fileName, sevenZipExe);\n console.log(`${fileName} added to ${zipFile}.`); // eslint-disable-line\n}\n\nfunction appendFileToArchive(archive, subFileName, subFileData) {\n return new Promise((resolve) => {\n const fileStream = createReadStream(subFileData);\n console.log(`Compression start: ${subFileName}`); // eslint-disable-line no-undef,no-console\n fileStream.on('close', () => {\n console.log(`Compression finish: ${subFileName}`); // eslint-disable-line no-undef,no-console\n resolve(null);\n });\n archive.append(fileStream, {name: subFileName});\n });\n}\n"],"file":"compress-util.js"}
@@ -1,53 +0,0 @@
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 function compressFileWithGzip(pathFile: string): Promise<string>;
8
-
9
- /**
10
- * Compress files from map into slpk file
11
- *
12
- * @param fileMap - map with file paths (key: output path, value: input path)
13
- * @param outputFile - output slpk file
14
- * @param level - compression level
15
- */
16
- export function compressFilesWithZip(
17
- fileMap: object,
18
- outputFile: string,
19
- level: number
20
- ): Promise<void>;
21
-
22
- /**
23
- * Compress files using external tool 'zip'
24
- *
25
- * @param inputFolder - folder to archive
26
- * @param outputFile - output slpk file
27
- * @param level - compression level
28
- */
29
- export function compressWithChildProcess(
30
- inputFolder: string,
31
- outputFile: string,
32
- level: number,
33
- sevenZipExe: string
34
- ): Promise<void>;
35
-
36
- /**
37
- * Generate hash file from zip archive
38
- * https://github.com/Esri/i3s-spec/blob/master/docs/1.7/slpk_hashtable.cmn.md
39
- *
40
- * @param inputZipFile
41
- * @param outputFile
42
- */
43
- export function generateHash128FromZip(inputZipFile, outputFile): Promise<void>;
44
-
45
- /**
46
- * Add file to zip archive
47
- *
48
- * @param inputFile
49
- * @param fileName
50
- * @param zipFile
51
- * @param sevenZipExe
52
- */
53
- export function addFileToZip(inputFile, fileName, zipFile, sevenZipExe);
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/utils/file-utils.js"],"names":["promises","fs","isAbsolute","join","compressFileWithGzip","writeFile","path","data","fileName","mkdir","recursive","pathFile","err","console","log","writeFileForSlpk","compress","pathGzFile","removeFile","removeDir","rmdir","unlink","getAbsoluteFilePath","filePath","process","cwd"],"mappings":"AAAA,SAAQA,QAAQ,IAAIC,EAApB,QAA6B,IAA7B;AACA,SAAQC,UAAR,EAAoBC,IAApB,QAA+B,MAA/B;AACA,SAAQC,oBAAR,QAAmC,iBAAnC;AAEA,OAAO,eAAeC,SAAf,CAAyBC,IAAzB,EAA+BC,IAA/B,EAAqCC,QAAQ,GAAG,YAAhD,EAA8D;AACnE,QAAMP,EAAE,CAACQ,KAAH,CAASH,IAAT,EAAe;AAACI,IAAAA,SAAS,EAAE;AAAZ,GAAf,CAAN;AACA,QAAMC,QAAQ,GAAGR,IAAI,CAACG,IAAD,EAAOE,QAAP,CAArB;;AACA,MAAI;AACF,UAAMP,EAAE,CAACI,SAAH,CAAaM,QAAb,EAAuBJ,IAAvB,CAAN;AACD,GAFD,CAEE,OAAOK,GAAP,EAAY;AACZ,UAAMA,GAAN;AACD;;AACDC,EAAAA,OAAO,CAACC,GAAR,WAAeH,QAAf;AACA,SAAOA,QAAP;AACD;AAED,OAAO,eAAeI,gBAAf,CAAgCT,IAAhC,EAAsCC,IAAtC,EAA4CC,QAAQ,GAAG,YAAvD,EAAqEQ,QAAQ,GAAG,IAAhF,EAAsF;AAC3F,QAAML,QAAQ,GAAG,MAAMN,SAAS,CAACC,IAAD,EAAOC,IAAP,EAAaC,QAAb,CAAhC;;AACA,MAAIQ,QAAJ,EAAc;AACZ,UAAMC,UAAU,GAAG,MAAMb,oBAAoB,CAACO,QAAD,CAA7C;AAEA,UAAMO,UAAU,CAACP,QAAD,CAAhB;AACA,WAAOM,UAAP;AACD;;AACD,SAAON,QAAP;AACD;AAED,OAAO,SAASQ,SAAT,CAAmBb,IAAnB,EAAyB;AAC9B,SAAOL,EAAE,CAACmB,KAAH,CAASd,IAAT,EAAe;AAACI,IAAAA,SAAS,EAAE;AAAZ,GAAf,CAAP;AACD;AAED,OAAO,SAASQ,UAAT,CAAoBZ,IAApB,EAA0B;AAC/B,SAAOL,EAAE,CAACoB,MAAH,CAAUf,IAAV,CAAP;AACD;AAED,OAAO,SAASgB,mBAAT,CAA6BC,QAA7B,EAAuC;AAC5C,SAAOrB,UAAU,CAACqB,QAAD,CAAV,GAAuBA,QAAvB,GAAkCpB,IAAI,CAACqB,OAAO,CAACC,GAAR,EAAD,EAAgBF,QAAhB,CAA7C;AACD","sourcesContent":["import {promises as fs} from 'fs';\nimport {isAbsolute, join} from 'path';\nimport {compressFileWithGzip} from './compress-util';\n\nexport async function writeFile(path, data, fileName = 'index.json') {\n await fs.mkdir(path, {recursive: true});\n const pathFile = join(path, fileName);\n try {\n await fs.writeFile(pathFile, data);\n } catch (err) {\n throw err;\n }\n console.log(`${pathFile} saved.`); // eslint-disable-line\n return pathFile;\n}\n\nexport async function writeFileForSlpk(path, data, fileName = 'index.json', compress = true) {\n const pathFile = await writeFile(path, data, fileName);\n if (compress) {\n const pathGzFile = await compressFileWithGzip(pathFile);\n // After compression, we don't need an uncompressed file\n await removeFile(pathFile);\n return pathGzFile;\n }\n return pathFile;\n}\n\nexport function removeDir(path) {\n return fs.rmdir(path, {recursive: true});\n}\n\nexport function removeFile(path) {\n return fs.unlink(path);\n}\n\nexport function getAbsoluteFilePath(filePath) {\n return isAbsolute(filePath) ? filePath : join(process.cwd(), filePath); // eslint-disable-line no-undef\n}\n"],"file":"file-utils.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/utils/lod-conversion-utils.js"],"names":["DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR","convertGeometricErrorToScreenThreshold","tile","coordinates","lodSelection","boundingVolume","lodMetricValue","maxScreenThreshold","metricType","maxError","mbs","maxScreenThresholdSQ","Math","PI","constructor","name","push","convertScreenThresholdToGeometricError","node","metricData","header","sqMetricData","sqrt"],"mappings":"AACA,MAAMA,kCAAkC,GAAG,EAA3C;AAeA,OAAO,SAASC,sCAAT,CAAgDC,IAAhD,EAAsDC,WAAtD,EAAmE;AACxE,QAAMC,YAAY,GAAG,EAArB;AACA,QAAMC,cAAc,GAAGH,IAAI,CAACG,cAA5B;AACA,QAAMC,cAAc,GAAGJ,IAAI,CAACI,cAAL,IAAuB,GAA9C;AACA,QAAMC,kBAAkB,GAAG;AACzBC,IAAAA,UAAU,EAAE,oBADa;AAEzBC,IAAAA,QAAQ,EAAGN,WAAW,CAACO,GAAZ,CAAgB,CAAhB,IAAqB,CAArB,GAAyBV,kCAA1B,GAAgEM;AAFjD,GAA3B;AAIA,QAAMK,oBAAoB,GAAG;AAC3BH,IAAAA,UAAU,EAAE,sBADe;AAE3BC,IAAAA,QAAQ,EAAEG,IAAI,CAACC,EAAL,GAAU,IAAV,GAAiBN,kBAAkB,CAACE,QAApC,GAA+CF,kBAAkB,CAACE;AAFjD,GAA7B;;AAKA,MAAIJ,cAAc,CAACS,WAAf,CAA2BC,IAA3B,KAAoC,qBAAxC,EAA+D;AAC7DX,IAAAA,YAAY,CAACY,IAAb,CAAkBL,oBAAlB;AACAP,IAAAA,YAAY,CAACY,IAAb,CAAkBT,kBAAlB;AACD,GAHD,MAGO;AACLH,IAAAA,YAAY,CAACY,IAAb,CAAkBT,kBAAlB;AACAH,IAAAA,YAAY,CAACY,IAAb,CAAkBL,oBAAlB;AACD;;AAED,SAAOP,YAAP;AACD;AAED,OAAO,SAASa,sCAAT,CAAgDC,IAAhD,EAAsD;AAC3D,QAAMC,UAAU,GAAGD,IAAI,CAACE,MAAL,CAAYhB,YAAZ,CAAyBG,kBAAzB,IAA+C,EAAlE;AACA,MAAIE,QAAQ,GAAGU,UAAU,CAACV,QAA1B;;AACA,MAAI,CAACA,QAAL,EAAe;AACb,UAAMY,YAAY,GAAGH,IAAI,CAACE,MAAL,CAAYhB,YAAZ,CAAyBO,oBAA9C;;AACA,QAAIU,YAAJ,EAAkB;AAChBZ,MAAAA,QAAQ,GAAGG,IAAI,CAACU,IAAL,CAAUD,YAAY,CAACZ,QAAb,IAAyBG,IAAI,CAACC,EAAL,GAAU,IAAnC,CAAV,CAAX;AACD;AACF;;AAED,MAAI,CAACJ,QAAL,EAAe;AACbA,IAAAA,QAAQ,GAAGT,kCAAX;AACD;;AAED,SAAQkB,IAAI,CAACE,MAAL,CAAYV,GAAZ,CAAgB,CAAhB,IAAqB,CAArB,GAAyBV,kCAA1B,GAAgES,QAAvE;AACD","sourcesContent":["// https://cesium.com/docs/cesiumjs-ref-doc/Cesium3DTileset.html\nconst DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR = 16;\n/**\n * Do conversion from geometric error to screen threshold\n * @param {Object} tile\n * @param {Object} coordinates\n * In 3DTiles we have HLOD logic and parent tile also has bigger lodMetric value then its children.\n * In I3s we have reverse logic related to maxError. Parent has lower maxError than its child.\n * In nodes where are no children tile.lodMetricValue is 0. This is because of logic of HLOD in 3DTiles\n * 3DTiles spec:\n * https://github.com/CesiumGS/3d-tiles/tree/master/specification#geometric-error\n * I3S spec:\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.7/lodSelection.cmn.md\n * To avoid infinity values when we do calculations of maxError we shold replace 0 with value which allows us\n * to make child maxError bigger than his parent maxError.\n */\nexport function convertGeometricErrorToScreenThreshold(tile, coordinates) {\n const lodSelection = [];\n const boundingVolume = tile.boundingVolume;\n const lodMetricValue = tile.lodMetricValue || 0.1;\n const maxScreenThreshold = {\n metricType: 'maxScreenThreshold',\n maxError: (coordinates.mbs[3] * 2 * DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR) / lodMetricValue\n };\n const maxScreenThresholdSQ = {\n metricType: 'maxScreenThresholdSQ',\n maxError: Math.PI * 0.25 * maxScreenThreshold.maxError * maxScreenThreshold.maxError\n };\n\n if (boundingVolume.constructor.name === 'OrientedBoundingBox') {\n lodSelection.push(maxScreenThresholdSQ);\n lodSelection.push(maxScreenThreshold);\n } else {\n lodSelection.push(maxScreenThreshold);\n lodSelection.push(maxScreenThresholdSQ);\n }\n\n return lodSelection;\n}\n\nexport function convertScreenThresholdToGeometricError(node) {\n const metricData = node.header.lodSelection.maxScreenThreshold || {};\n let maxError = metricData.maxError;\n if (!maxError) {\n const sqMetricData = node.header.lodSelection.maxScreenThresholdSQ;\n if (sqMetricData) {\n maxError = Math.sqrt(sqMetricData.maxError / (Math.PI * 0.25));\n }\n }\n\n if (!maxError) {\n maxError = DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR;\n }\n\n return (node.header.mbs[3] * 2 * DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR) / maxError;\n}\n"],"file":"lod-conversion-utils.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/utils/statistic-utills.js"],"names":["join","promises","fs","getAbsoluteFilePath","timeConverter","time","nanoSecondsInMillisecond","timeInSeconds","hours","Math","floor","minutes","seconds","milliseconds","result","calculateFilesSize","params","slpk","outputPath","tilesetName","fullOutputPath","slpkPath","stat","size","directoryPath","totalSize","getTotalFilesSize","error","console","log","dirPath","totalFileSize","files","readdir","file","fileStat","isDirectory"],"mappings":"AAAA,SAAQA,IAAR,QAAmB,MAAnB;AACA,SAAQC,QAAQ,IAAIC,EAApB,QAA6B,IAA7B;AACA,SAAQC,mBAAR,QAAkC,cAAlC;AAEA,OAAO,SAASC,aAAT,CAA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CAACC,IAAZ;AACD;;AAED,UAAMC,aAAa,GAAGxB,IAAI,CAACoB,cAAD,EAAiBD,WAAjB,CAA1B;AACA,UAAMM,SAAS,GAAG,MAAMC,iBAAiB,CAACF,aAAD,CAAzC;AACA,WAAOC,SAAP;AACD,GAVD,CAUE,OAAOE,KAAP,EAAc;AACdC,IAAAA,OAAO,CAACC,GAAR,CAAY,8BAAZ,EAA4CF,KAA5C;AACA,WAAO,IAAP;AACD;AACF;;AAED,eAAeD,iBAAf,CAAiCI,OAAjC,EAA0C;AACxC,MAAIC,aAAa,GAAG,CAApB;AAEA,QAAMC,KAAK,GAAG,MAAM9B,EAAE,CAAC+B,OAAH,CAAWH,OAAX,CAApB;;AAEA,OAAK,MAAMI,IAAX,IAAmBF,KAAnB,EAA0B;AACxB,UAAMG,QAAQ,GAAG,MAAMjC,EAAE,CAACoB,IAAH,CAAQtB,IAAI,CAAC8B,OAAD,EAAUI,IAAV,CAAZ,CAAvB;;AACA,QAAIC,QAAQ,CAACC,WAAT,EAAJ,EAA4B;AAC1BL,MAAAA,aAAa,IAAI,MAAML,iBAAiB,CAAC1B,IAAI,CAAC8B,OAAD,EAAUI,IAAV,CAAL,CAAxC;AACD,KAFD,MAEO;AACLH,MAAAA,aAAa,IAAII,QAAQ,CAACZ,IAA1B;AACD;AACF;;AACD,SAAOQ,aAAP;AACD","sourcesContent":["import {join} from 'path';\nimport {promises as fs} from 'fs';\nimport {getAbsoluteFilePath} from './file-utils';\n\nexport function timeConverter(time) {\n const nanoSecondsInMillisecond = 1e6;\n let timeInSeconds = time[0];\n const hours = Math.floor(timeInSeconds / 3600);\n timeInSeconds = timeInSeconds - hours * 3600;\n const minutes = Math.floor(timeInSeconds / 60);\n timeInSeconds = timeInSeconds - minutes * 60;\n const seconds = Math.floor(timeInSeconds);\n const milliseconds = time[1] / nanoSecondsInMillisecond;\n let result = '';\n\n if (hours) {\n result += `${hours}h `;\n }\n\n if (minutes) {\n result += `${minutes}m `;\n }\n\n if (seconds) {\n result += `${seconds}s`;\n }\n\n if (!result) {\n result += `${milliseconds}ms`;\n }\n\n return result;\n}\n\nexport async function calculateFilesSize(params) {\n const {slpk, outputPath, tilesetName} = params;\n const fullOutputPath = getAbsoluteFilePath(outputPath);\n\n try {\n if (slpk) {\n const slpkPath = join(fullOutputPath, `${tilesetName}.slpk`);\n const stat = await fs.stat(slpkPath);\n return stat.size;\n }\n\n const directoryPath = join(fullOutputPath, tilesetName);\n const totalSize = await getTotalFilesSize(directoryPath);\n return totalSize;\n } catch (error) {\n console.log('Calculate file sizes error: ', error); // eslint-disable-line\n return null;\n }\n}\n\nasync function getTotalFilesSize(dirPath) {\n let totalFileSize = 0;\n\n const files = await fs.readdir(dirPath);\n\n for (const file of files) {\n const fileStat = await fs.stat(join(dirPath, file));\n if (fileStat.isDirectory()) {\n totalFileSize += await getTotalFilesSize(join(dirPath, file));\n } else {\n totalFileSize += fileStat.size;\n }\n }\n return totalFileSize;\n}\n"],"file":"statistic-utills.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/pgm-loader.ts"],"names":["VERSION","parsePgm","PGMLoader","name","id","module","version","mimeTypes","parse","arrayBuffer","options","Uint8Array","extensions","cubic"],"mappings":"AAIA,MAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAEA,SAAQC,QAAR,QAAuB,kBAAvB;AAKA,OAAO,MAAMC,SAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,qCADmC;AAEzCC,EAAAA,EAAE,EAAE,KAFqC;AAGzCC,EAAAA,MAAM,EAAE,gBAHiC;AAIzCC,EAAAA,OAAO,EAAEN,OAJgC;AAKzCO,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAL8B;AAMzCC,EAAAA,KAAK,EAAE,CAACC,WAAD,EAAcC,OAAd,KAA0BT,QAAQ,CAAC,IAAIU,UAAJ,CAAeF,WAAf,CAAD,EAA8BC,OAA9B,CANA;AAOzCE,EAAAA,UAAU,EAAE,CAAC,KAAD,CAP6B;AAQzCF,EAAAA,OAAO,EAAE;AAEPG,IAAAA,KAAK,EAAE;AAFA;AARgC,CAApC","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nimport {parsePgm} from './lib/pgm-parser';\n\n/**\n * Loader for PGM - Netpbm grayscale image format\n */\nexport const PGMLoader: LoaderWithParser = {\n name: 'PGM - Netpbm grayscale image format',\n id: 'pgm',\n module: 'tile-converter',\n version: VERSION,\n mimeTypes: ['image/x-portable-graymap'],\n parse: (arrayBuffer, options) => parsePgm(new Uint8Array(arrayBuffer), options),\n extensions: ['pgm'],\n options: {\n // TODO - use pgm namespace\n cubic: false\n }\n};\n"],"file":"pgm-loader.js"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Converts content of an I3S node to *.b3dm's file content
3
- */
4
- export default class B3dmConverter {
5
- rtcCenter: Float32Array;
6
- i3sTile: any;
7
-
8
- constructor();
9
-
10
- /**
11
- * The starter of content conversion
12
- * @param i3sTile - Tile3D instance for I3S node
13
- * @returns - encoded content
14
- */
15
- convert(i3sTile: Object, attributes?: any): ArrayBuffer;
16
-
17
- /**
18
- * Build and encode gltf
19
- * @param i3sTile - Tile3D instance for I3S node
20
- * @returns - encoded glb content
21
- */
22
- buildGltf(i3sTile): ArrayBuffer;
23
- }
@@ -1,16 +0,0 @@
1
- import {GeoidHeightModel} from '@loaders.gl/tile-converter/lib/geoid-height-model';
2
-
3
- /**
4
- * Convert quaternion-based OBB to half-axes-based OBB
5
- * @param i3SObb quaternion based OBB
6
- * @param geoidHeightModel the Earth Gravity Model instance
7
- * @returns number[12] 3DTiles OBB https://github.com/CesiumGS/3d-tiles/tree/master/specification#box
8
- */
9
- export function i3sObbTo3dTilesObb(
10
- i3SObb: {
11
- center: number[];
12
- halfSize: number[];
13
- quaternion: number[];
14
- },
15
- geoidHeightModel: GeoidHeightModel
16
- ): number[];
@@ -1,10 +0,0 @@
1
- /**
2
- * Install external dependencies for converter:
3
- * * PGM file (implemented);
4
- * * Draco library (not implemented);
5
- * * 7z archiver (not implemented);
6
- */
7
- export class DepsInstaller {
8
- // Run installation
9
- install(path?: string): Promise<void>;
10
- }