@loaders.gl/tile-converter 3.1.8 → 3.2.0-alpha.3

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 (238) hide show
  1. package/dist/3d-tiles-attributes-worker.d.ts +28 -0
  2. package/dist/3d-tiles-attributes-worker.d.ts.map +1 -0
  3. package/dist/3d-tiles-attributes-worker.js +4 -0
  4. package/dist/3d-tiles-attributes-worker.js.map +7 -0
  5. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +82 -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 +268 -0
  8. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +84 -0
  9. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -0
  10. package/dist/3d-tiles-converter/helpers/b3dm-converter.js +278 -0
  11. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +13 -0
  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 +23 -0
  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 +52 -0
  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 +43 -0
  20. package/dist/bundle.d.ts +2 -0
  21. package/dist/bundle.d.ts.map +1 -0
  22. package/dist/bundle.js +5 -0
  23. package/dist/converter-cli.d.ts +2 -0
  24. package/dist/converter-cli.d.ts.map +1 -0
  25. package/dist/converter-cli.js +232 -0
  26. package/dist/converter.min.js +68 -68
  27. package/dist/deps-installer/deps-installer.d.ts +14 -0
  28. package/dist/deps-installer/deps-installer.d.ts.map +1 -0
  29. package/dist/deps-installer/deps-installer.js +31 -0
  30. package/dist/dist.min.js +1151 -1264
  31. package/dist/es5/3d-tiles-attributes-worker.js +29 -0
  32. package/dist/es5/3d-tiles-attributes-worker.js.map +1 -0
  33. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +104 -44
  34. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  35. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +34 -43
  36. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  37. package/dist/es5/converter-cli.js +306 -0
  38. package/dist/es5/converter-cli.js.map +1 -0
  39. package/dist/es5/deps-installer/deps-installer.js.map +1 -1
  40. package/dist/es5/i3s-attributes-worker.js +29 -0
  41. package/dist/es5/i3s-attributes-worker.js.map +1 -0
  42. package/dist/es5/i3s-converter/helpers/coordinate-converter.js +19 -11
  43. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  44. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +2 -2
  45. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  46. package/dist/es5/i3s-converter/helpers/geometry-converter.js +271 -182
  47. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  48. package/dist/es5/i3s-converter/helpers/gltf-attributes.js +71 -0
  49. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -0
  50. package/dist/es5/i3s-converter/helpers/node-pages.js +47 -99
  51. package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
  52. package/dist/es5/i3s-converter/i3s-converter.js +311 -245
  53. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  54. package/dist/es5/index.js +0 -16
  55. package/dist/es5/index.js.map +1 -1
  56. package/dist/es5/lib/utils/compress-util.js +14 -17
  57. package/dist/es5/lib/utils/compress-util.js.map +1 -1
  58. package/dist/es5/lib/utils/file-utils.js +39 -14
  59. package/dist/es5/lib/utils/file-utils.js.map +1 -1
  60. package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
  61. package/dist/es5/lib/utils/queue.js +61 -0
  62. package/dist/es5/lib/utils/queue.js.map +1 -0
  63. package/dist/es5/lib/utils/statistic-utills.js.map +1 -1
  64. package/dist/es5/lib/utils/write-queue.js +225 -0
  65. package/dist/es5/lib/utils/write-queue.js.map +1 -0
  66. package/dist/es5/pgm-loader.js +1 -1
  67. package/dist/es5/pgm-loader.js.map +1 -1
  68. package/dist/es5/workers/3d-tiles-attributes-worker.js +37 -0
  69. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -0
  70. package/dist/es5/workers/i3s-attributes-worker.js +40 -0
  71. package/dist/es5/workers/i3s-attributes-worker.js.map +1 -0
  72. package/dist/esm/3d-tiles-attributes-worker.js +16 -0
  73. package/dist/esm/3d-tiles-attributes-worker.js.map +1 -0
  74. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +32 -5
  75. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  76. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +23 -23
  77. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  78. package/dist/esm/converter-cli.js +230 -0
  79. package/dist/esm/converter-cli.js.map +1 -0
  80. package/dist/esm/deps-installer/deps-installer.js.map +1 -1
  81. package/dist/esm/i3s-attributes-worker.js +16 -0
  82. package/dist/esm/i3s-attributes-worker.js.map +1 -0
  83. package/dist/esm/i3s-converter/helpers/coordinate-converter.js +19 -11
  84. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  85. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +2 -2
  86. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  87. package/dist/esm/i3s-converter/helpers/geometry-converter.js +121 -62
  88. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  89. package/dist/esm/i3s-converter/helpers/gltf-attributes.js +54 -0
  90. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -0
  91. package/dist/esm/i3s-converter/helpers/node-pages.js +12 -4
  92. package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
  93. package/dist/esm/i3s-converter/i3s-converter.js +155 -50
  94. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  95. package/dist/esm/index.js +0 -2
  96. package/dist/esm/index.js.map +1 -1
  97. package/dist/esm/lib/utils/compress-util.js +6 -8
  98. package/dist/esm/lib/utils/compress-util.js.map +1 -1
  99. package/dist/esm/lib/utils/file-utils.js +11 -1
  100. package/dist/esm/lib/utils/file-utils.js.map +1 -1
  101. package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
  102. package/dist/esm/lib/utils/queue.js +19 -0
  103. package/dist/esm/lib/utils/queue.js.map +1 -0
  104. package/dist/esm/lib/utils/statistic-utills.js.map +1 -1
  105. package/dist/esm/lib/utils/write-queue.js +88 -0
  106. package/dist/esm/lib/utils/write-queue.js.map +1 -0
  107. package/dist/esm/pgm-loader.js +1 -1
  108. package/dist/esm/pgm-loader.js.map +1 -1
  109. package/dist/esm/workers/3d-tiles-attributes-worker.js +5 -0
  110. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -0
  111. package/dist/esm/workers/i3s-attributes-worker.js +4 -0
  112. package/dist/esm/workers/i3s-attributes-worker.js.map +1 -0
  113. package/dist/i3s-attributes-worker.d.ts +33 -0
  114. package/dist/i3s-attributes-worker.d.ts.map +1 -0
  115. package/dist/i3s-attributes-worker.js +10 -0
  116. package/dist/i3s-attributes-worker.js.map +7 -0
  117. package/dist/i3s-converter/helpers/coordinate-converter.d.ts +41 -0
  118. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -0
  119. package/dist/i3s-converter/helpers/coordinate-converter.js +122 -0
  120. package/dist/i3s-converter/helpers/create-scene-server-path.d.ts +9 -0
  121. package/dist/i3s-converter/helpers/create-scene-server-path.d.ts.map +1 -0
  122. package/dist/i3s-converter/helpers/create-scene-server-path.js +28 -0
  123. package/dist/i3s-converter/helpers/geometry-attributes.d.ts +8 -0
  124. package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -0
  125. package/dist/i3s-converter/helpers/geometry-attributes.js +177 -0
  126. package/dist/i3s-converter/helpers/geometry-converter.d.ts +29 -0
  127. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -0
  128. package/dist/i3s-converter/helpers/geometry-converter.js +901 -0
  129. package/dist/i3s-converter/helpers/gltf-attributes.d.ts +9 -0
  130. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -0
  131. package/dist/i3s-converter/helpers/gltf-attributes.js +56 -0
  132. package/dist/i3s-converter/helpers/node-debug.d.ts +8 -0
  133. package/dist/i3s-converter/helpers/node-debug.d.ts.map +1 -0
  134. package/dist/i3s-converter/helpers/node-debug.js +114 -0
  135. package/dist/i3s-converter/helpers/node-pages.d.ts +117 -0
  136. package/dist/i3s-converter/helpers/node-pages.d.ts.map +1 -0
  137. package/dist/i3s-converter/helpers/node-pages.js +208 -0
  138. package/dist/i3s-converter/i3s-converter.d.ts +323 -0
  139. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -0
  140. package/dist/i3s-converter/i3s-converter.js +1074 -0
  141. package/dist/i3s-converter/json-templates/layers.d.ts +95 -0
  142. package/dist/i3s-converter/json-templates/layers.d.ts.map +1 -0
  143. package/dist/i3s-converter/json-templates/layers.js +199 -0
  144. package/dist/i3s-converter/json-templates/metadata.d.ts +22 -0
  145. package/dist/i3s-converter/json-templates/metadata.d.ts.map +1 -0
  146. package/dist/i3s-converter/json-templates/metadata.js +25 -0
  147. package/dist/i3s-converter/json-templates/node.d.ts +61 -0
  148. package/dist/i3s-converter/json-templates/node.d.ts.map +1 -0
  149. package/dist/i3s-converter/json-templates/node.js +89 -0
  150. package/dist/i3s-converter/json-templates/scene-server.d.ts +28 -0
  151. package/dist/i3s-converter/json-templates/scene-server.d.ts.map +1 -0
  152. package/dist/i3s-converter/json-templates/scene-server.js +31 -0
  153. package/dist/i3s-converter/json-templates/shared-resources.d.ts +14 -0
  154. package/dist/i3s-converter/json-templates/shared-resources.d.ts.map +1 -0
  155. package/dist/i3s-converter/json-templates/shared-resources.js +129 -0
  156. package/dist/i3s-converter/json-templates/store.d.ts +95 -0
  157. package/dist/i3s-converter/json-templates/store.d.ts.map +1 -0
  158. package/dist/i3s-converter/json-templates/store.js +103 -0
  159. package/dist/i3s-converter/types.d.ts +114 -0
  160. package/dist/i3s-converter/types.d.ts.map +1 -0
  161. package/dist/i3s-converter/types.js +2 -0
  162. package/dist/i3s-server/app.d.ts +3 -0
  163. package/dist/i3s-server/app.d.ts.map +1 -0
  164. package/dist/i3s-server/app.js +14 -0
  165. package/dist/i3s-server/controllers/index-controller.d.ts +2 -0
  166. package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -0
  167. package/dist/i3s-server/controllers/index-controller.js +23 -0
  168. package/dist/i3s-server/routes/index.d.ts +3 -0
  169. package/dist/i3s-server/routes/index.d.ts.map +1 -0
  170. package/dist/i3s-server/routes/index.js +16 -0
  171. package/dist/index.d.ts +3 -0
  172. package/dist/index.d.ts.map +1 -0
  173. package/dist/index.js +10 -0
  174. package/dist/lib/utils/compress-util.d.ts +45 -0
  175. package/dist/lib/utils/compress-util.d.ts.map +1 -0
  176. package/dist/lib/utils/compress-util.js +257 -0
  177. package/dist/{esm/lib → lib}/utils/file-utils.d.ts +6 -14
  178. package/dist/lib/utils/file-utils.d.ts.map +1 -0
  179. package/dist/lib/utils/file-utils.js +81 -0
  180. package/dist/lib/utils/lod-conversion-utils.d.ts +41 -0
  181. package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -0
  182. package/dist/lib/utils/lod-conversion-utils.js +76 -0
  183. package/dist/lib/utils/queue.d.ts +7 -0
  184. package/dist/lib/utils/queue.d.ts.map +1 -0
  185. package/dist/lib/utils/queue.js +18 -0
  186. package/dist/lib/utils/statistic-utills.d.ts +3 -0
  187. package/dist/lib/utils/statistic-utills.d.ts.map +1 -0
  188. package/dist/lib/utils/statistic-utills.js +64 -0
  189. package/dist/lib/utils/write-queue.d.ts +22 -0
  190. package/dist/lib/utils/write-queue.d.ts.map +1 -0
  191. package/dist/lib/utils/write-queue.js +62 -0
  192. package/dist/pgm-loader.d.ts +6 -0
  193. package/dist/pgm-loader.d.ts.map +1 -0
  194. package/dist/pgm-loader.js +23 -0
  195. package/dist/workers/3d-tiles-attributes-worker.d.ts +2 -0
  196. package/dist/workers/3d-tiles-attributes-worker.d.ts.map +1 -0
  197. package/dist/workers/3d-tiles-attributes-worker.js +9 -0
  198. package/dist/workers/i3s-attributes-worker.d.ts +2 -0
  199. package/dist/workers/i3s-attributes-worker.d.ts.map +1 -0
  200. package/dist/workers/i3s-attributes-worker.js +5 -0
  201. package/package.json +19 -18
  202. package/src/3d-tiles-attributes-worker.ts +43 -0
  203. package/src/3d-tiles-converter/3d-tiles-converter.ts +49 -6
  204. package/src/3d-tiles-converter/helpers/b3dm-converter.ts +21 -18
  205. package/src/converter-cli.ts +310 -0
  206. package/src/deps-installer/{deps-installer.js → deps-installer.ts} +11 -1
  207. package/src/i3s-attributes-worker.ts +46 -0
  208. package/src/i3s-converter/helpers/coordinate-converter.ts +29 -24
  209. package/src/i3s-converter/helpers/geometry-attributes.ts +4 -3
  210. package/src/i3s-converter/helpers/{geometry-converter.js → geometry-converter.ts} +425 -179
  211. package/src/i3s-converter/helpers/gltf-attributes.ts +68 -0
  212. package/src/i3s-converter/helpers/node-pages.ts +25 -17
  213. package/src/i3s-converter/i3s-converter.ts +154 -87
  214. package/src/i3s-converter/types.ts +90 -8
  215. package/src/index.ts +0 -4
  216. package/src/lib/utils/{compress-util.js → compress-util.ts} +105 -18
  217. package/src/lib/utils/file-utils.ts +84 -0
  218. package/src/lib/utils/{lod-conversion-utils.js → lod-conversion-utils.ts} +27 -5
  219. package/src/lib/utils/queue.ts +17 -0
  220. package/src/lib/utils/{statistic-utills.js → statistic-utills.ts} +0 -0
  221. package/src/lib/utils/write-queue.ts +75 -0
  222. package/src/workers/3d-tiles-attributes-worker.ts +6 -0
  223. package/src/workers/i3s-attributes-worker.ts +6 -0
  224. package/dist/es5/deps-installer/deps-installer.d.ts +0 -10
  225. package/dist/es5/i3s-converter/helpers/geometry-converter.d.ts +0 -44
  226. package/dist/es5/lib/utils/compress-util.d.ts +0 -53
  227. package/dist/es5/lib/utils/file-utils.d.ts +0 -43
  228. package/dist/es5/lib/utils/lod-conversion-utils.d.ts +0 -32
  229. package/dist/esm/deps-installer/deps-installer.d.ts +0 -10
  230. package/dist/esm/i3s-converter/helpers/geometry-converter.d.ts +0 -44
  231. package/dist/esm/lib/utils/compress-util.d.ts +0 -53
  232. package/dist/esm/lib/utils/lod-conversion-utils.d.ts +0 -32
  233. package/src/deps-installer/deps-installer.d.ts +0 -10
  234. package/src/i3s-converter/helpers/geometry-converter.d.ts +0 -44
  235. package/src/lib/utils/compress-util.d.ts +0 -53
  236. package/src/lib/utils/file-utils.d.ts +0 -43
  237. package/src/lib/utils/file-utils.js +0 -38
  238. package/src/lib/utils/lod-conversion-utils.d.ts +0 -32
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SHARED_RESOURCES = void 0;
7
+ const json_map_transform_1 = __importDefault(require("json-map-transform"));
8
+ const MATERIAL_DEFINITION_INFO_PARAMS = () => ({
9
+ renderMode: {
10
+ path: 'renderMode',
11
+ default: 'solid'
12
+ },
13
+ shininess: {
14
+ path: 'shininess',
15
+ default: 1
16
+ },
17
+ reflectivity: {
18
+ path: 'reflectivity',
19
+ default: 0
20
+ },
21
+ ambient: {
22
+ path: 'ambient',
23
+ default: [1, 1, 1, 1]
24
+ },
25
+ diffuse: {
26
+ path: 'diffuse',
27
+ default: [1, 1, 1, 1]
28
+ },
29
+ specular: {
30
+ path: 'specular',
31
+ default: [0, 0, 0, 0]
32
+ },
33
+ useVertexColorAlpha: {
34
+ path: 'useVertexColorAlpha',
35
+ default: false
36
+ },
37
+ vertexRegions: {
38
+ path: 'vertexRegions',
39
+ default: false
40
+ },
41
+ vertexColors: {
42
+ path: 'vertexColors',
43
+ default: true
44
+ }
45
+ });
46
+ const MATERIAL_DEFINITION_INFO = () => ({
47
+ name: {
48
+ path: 'name',
49
+ default: 'standard'
50
+ },
51
+ type: {
52
+ path: 'type',
53
+ default: 'standard'
54
+ },
55
+ params: {
56
+ path: 'params',
57
+ transform: (val, thisObject, originalObject) => (0, json_map_transform_1.default)(originalObject, MATERIAL_DEFINITION_INFO_PARAMS())
58
+ }
59
+ });
60
+ const TEXTURE_DEFINITION_IMAGE = () => ({
61
+ id: {
62
+ path: 'id'
63
+ },
64
+ size: {
65
+ path: 'size'
66
+ },
67
+ href: {
68
+ path: 'href',
69
+ default: ['../textures/0']
70
+ },
71
+ length: {
72
+ path: 'length'
73
+ }
74
+ });
75
+ const TEXTURE_DEFINITION_INFO = () => ({
76
+ encoding: {
77
+ path: 'encoding'
78
+ },
79
+ wrap: {
80
+ path: 'wrap',
81
+ default: ['none']
82
+ },
83
+ atlas: {
84
+ path: 'atlas',
85
+ default: false
86
+ },
87
+ uvSet: {
88
+ path: 'uvSet',
89
+ default: 'uv0'
90
+ },
91
+ channels: {
92
+ path: 'channels',
93
+ default: 'rgb'
94
+ },
95
+ images: {
96
+ path: 'images',
97
+ transform: (val, thisObject, originalObject) => val.map((image) => (0, json_map_transform_1.default)(image, TEXTURE_DEFINITION_IMAGE()))
98
+ }
99
+ });
100
+ const SHARED_RESOURCES = () => ({
101
+ materialDefinitions: {
102
+ path: 'materialDefinitionInfos',
103
+ transform: transfromMaterialDefinitions
104
+ },
105
+ textureDefinitions: {
106
+ path: 'textureDefinitionInfos',
107
+ transform: transfromTextureDefinitions
108
+ }
109
+ });
110
+ exports.SHARED_RESOURCES = SHARED_RESOURCES;
111
+ function transfromMaterialDefinitions(materialDefinitionInfos, thisObject, originalObject) {
112
+ const result = {};
113
+ for (const [index, materialDefinitionInfo] of materialDefinitionInfos.entries()) {
114
+ result[`Mat${originalObject.nodePath}${index}`] = (0, json_map_transform_1.default)(materialDefinitionInfo, MATERIAL_DEFINITION_INFO());
115
+ }
116
+ return result;
117
+ }
118
+ function transfromTextureDefinitions(textureDefinitionInfos, thisObject, originalObject) {
119
+ if (!textureDefinitionInfos) {
120
+ return null;
121
+ }
122
+ const result = {};
123
+ for (const [index, textureDefinitionInfo] of textureDefinitionInfos.entries()) {
124
+ const imageIndex = `${originalObject.nodePath}${index}`;
125
+ textureDefinitionInfo.imageIndex = imageIndex;
126
+ result[imageIndex] = (0, json_map_transform_1.default)(textureDefinitionInfo, TEXTURE_DEFINITION_INFO());
127
+ }
128
+ return result;
129
+ }
@@ -0,0 +1,95 @@
1
+ export declare const STORE: {
2
+ id: {
3
+ path: string;
4
+ transform: (val: any) => any;
5
+ };
6
+ profile: {
7
+ path: string;
8
+ default: string;
9
+ };
10
+ version: {
11
+ path: string;
12
+ default: string;
13
+ };
14
+ resourcePattern: {
15
+ path: string;
16
+ default: string[];
17
+ };
18
+ rootNode: {
19
+ path: string;
20
+ default: string;
21
+ };
22
+ extent: {
23
+ path: string;
24
+ };
25
+ indexCRS: {
26
+ path: string;
27
+ default: string;
28
+ };
29
+ vertexCRS: {
30
+ path: string;
31
+ default: string;
32
+ };
33
+ normalReferenceFrame: {
34
+ path: string;
35
+ default: string;
36
+ };
37
+ attributeEncoding: {
38
+ path: string;
39
+ default: string;
40
+ };
41
+ textureEncoding: {
42
+ path: string;
43
+ default: string[];
44
+ };
45
+ lodType: {
46
+ path: string;
47
+ default: string;
48
+ };
49
+ lodModel: {
50
+ path: string;
51
+ default: string;
52
+ };
53
+ defaultGeometrySchema: {
54
+ path: string;
55
+ default: {
56
+ geometryType: string;
57
+ header: {
58
+ property: string;
59
+ type: string;
60
+ }[];
61
+ topology: string;
62
+ ordering: string[];
63
+ vertexAttributes: {
64
+ position: {
65
+ valueType: string;
66
+ valuesPerElement: number;
67
+ };
68
+ normal: {
69
+ valueType: string;
70
+ valuesPerElement: number;
71
+ };
72
+ uv0: {
73
+ valueType: string;
74
+ valuesPerElement: number;
75
+ };
76
+ color: {
77
+ valueType: string;
78
+ valuesPerElement: number;
79
+ };
80
+ };
81
+ featureAttributeOrder: string[];
82
+ featureAttributes: {
83
+ id: {
84
+ valueType: string;
85
+ valuesPerElement: number;
86
+ };
87
+ faceRange: {
88
+ valueType: string;
89
+ valuesPerElement: number;
90
+ };
91
+ };
92
+ };
93
+ };
94
+ };
95
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/json-templates/store.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGjB,CAAC"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STORE = void 0;
4
+ exports.STORE = {
5
+ id: {
6
+ path: 'id',
7
+ transform: (val) => val.toUpperCase()
8
+ },
9
+ profile: {
10
+ path: 'profile',
11
+ default: 'meshpyramids'
12
+ },
13
+ version: {
14
+ path: 'version',
15
+ default: '1.8'
16
+ },
17
+ resourcePattern: {
18
+ path: 'resourcePattern',
19
+ default: ['3dNodeIndexDocument', 'Attributes', 'SharedResource', 'Geometry']
20
+ },
21
+ rootNode: {
22
+ path: 'rootNode',
23
+ default: './nodes/root'
24
+ },
25
+ extent: {
26
+ path: 'extent'
27
+ },
28
+ indexCRS: {
29
+ path: 'indexCRS',
30
+ default: 'http://www.opengis.net/def/crs/EPSG/0/4326'
31
+ },
32
+ vertexCRS: {
33
+ path: 'vertexCRS',
34
+ default: 'http://www.opengis.net/def/crs/EPSG/0/4326'
35
+ },
36
+ normalReferenceFrame: {
37
+ path: 'normalReferenceFrame',
38
+ default: 'east-north-up'
39
+ },
40
+ attributeEncoding: {
41
+ path: 'attributeEncoding',
42
+ default: 'application/octet-stream; version=1.6'
43
+ },
44
+ textureEncoding: {
45
+ path: 'textureEncoding',
46
+ default: ['image/jpeg', 'image/ktx2']
47
+ },
48
+ lodType: {
49
+ path: 'lodType',
50
+ default: 'MeshPyramid'
51
+ },
52
+ lodModel: {
53
+ path: 'lodModel',
54
+ default: 'node-switching'
55
+ },
56
+ defaultGeometrySchema: {
57
+ path: 'defaultGeometrySchema',
58
+ default: {
59
+ geometryType: 'triangles',
60
+ header: [
61
+ {
62
+ property: 'vertexCount',
63
+ type: 'UInt32'
64
+ },
65
+ {
66
+ property: 'featureCount',
67
+ type: 'UInt32'
68
+ }
69
+ ],
70
+ topology: 'PerAttributeArray',
71
+ ordering: ['position', 'normal', 'uv0', 'color'],
72
+ vertexAttributes: {
73
+ position: {
74
+ valueType: 'Float32',
75
+ valuesPerElement: 3
76
+ },
77
+ normal: {
78
+ valueType: 'Float32',
79
+ valuesPerElement: 3
80
+ },
81
+ uv0: {
82
+ valueType: 'Float32',
83
+ valuesPerElement: 2
84
+ },
85
+ color: {
86
+ valueType: 'UInt8',
87
+ valuesPerElement: 4
88
+ }
89
+ },
90
+ featureAttributeOrder: ['id', 'faceRange'],
91
+ featureAttributes: {
92
+ id: {
93
+ valueType: 'UInt64',
94
+ valuesPerElement: 1
95
+ },
96
+ faceRange: {
97
+ valueType: 'UInt32',
98
+ valuesPerElement: 2
99
+ }
100
+ }
101
+ }
102
+ }
103
+ };
@@ -0,0 +1,114 @@
1
+ import { BoundingVolumes, I3SMaterialDefinition, MaterialDefinitionInfo, TextureDefinitionInfo } from '@loaders.gl/i3s';
2
+ import { ImageDataType } from '@loaders.gl/images';
3
+ /** Converted resources for specific node */
4
+ export declare type I3SConvertedResources = {
5
+ /** Non-compressed geometry buffer that have structure met
6
+ * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
7
+ * (Geometry buffer)
8
+ */
9
+ geometry: ArrayBuffer | null;
10
+ /**
11
+ * Draco compressed geometry
12
+ */
13
+ compressedGeometry?: Promise<ArrayBuffer> | null;
14
+ /**
15
+ * Texture image content
16
+ */
17
+ texture: any | null;
18
+ /**
19
+ * Shared resources built from GLTF material
20
+ */
21
+ sharedResources: SharedResourcesArrays | null;
22
+ /**
23
+ * Material definition of the node
24
+ */
25
+ meshMaterial?: I3SMaterialDefinition | null;
26
+ /**
27
+ * Number of vertices in the node
28
+ */
29
+ vertexCount: number | null;
30
+ /**
31
+ * Feature attributes contents
32
+ */
33
+ attributes: ArrayBuffer[] | null;
34
+ /**
35
+ * Number of features in the node
36
+ */
37
+ featureCount: number | null;
38
+ /**
39
+ * MBS and/or OBB bounding volumes of the node
40
+ */
41
+ boundingVolumes: BoundingVolumes | null;
42
+ };
43
+ /**
44
+ * Geometry and feature attributes converted from GLTF primitives
45
+ */
46
+ export declare type ConvertedAttributes = {
47
+ /** POSITION attribute value */
48
+ positions: Float32Array;
49
+ /** NORMAL attribute value */
50
+ normals: Float32Array;
51
+ /** TEXCOORD_0 attribute value */
52
+ texCoords: Float32Array;
53
+ /** COLOR_0 attribute value */
54
+ colors: Uint8Array;
55
+ /** Feature indices grouped by ...
56
+ * converted from "batch ids" of GLTF
57
+ */
58
+ featureIndicesGroups?: number[][];
59
+ /** Feature indices converted from "batch ids" */
60
+ featureIndices: number[];
61
+ /**
62
+ * MBS and/or OBB bounding volumes of the node
63
+ */
64
+ boundingVolumes: null | BoundingVolumes;
65
+ };
66
+ /** Postprocessed geometry and feature attributes
67
+ * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
68
+ */
69
+ export declare type GeometryAttributes = {
70
+ /** POSITION attribute value */
71
+ positions: Float32Array;
72
+ /** NORMAL attribute value */
73
+ normals: Float32Array;
74
+ /** TEXCOORD_0 attribute value */
75
+ texCoords: Float32Array;
76
+ /** COLOR_0 attribute value */
77
+ colors: Uint8Array;
78
+ /** faceRanges attribute value */
79
+ faceRange: Uint32Array;
80
+ /** feature Ids attribute value */
81
+ featureIds: number[];
82
+ /** number of features in the node */
83
+ featureCount: number;
84
+ };
85
+ /** Geometry attributes specific for the particular feature */
86
+ export declare type GroupedByFeatureIdAttributes = {
87
+ /** Feature Id */
88
+ featureId: number;
89
+ /** POSITION attribute value */
90
+ positions: Float32Array;
91
+ /** NORMAL attribute value */
92
+ normals: Float32Array;
93
+ /** COLOR_0 attribute value */
94
+ colors: Uint8Array;
95
+ /** TEXCOORD_0 attribute value */
96
+ texCoords: Float32Array;
97
+ };
98
+ /** Shared resources made from GLTF material */
99
+ export declare type SharedResourcesArrays = {
100
+ /** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */
101
+ materialDefinitionInfos?: MaterialDefinitionInfo[];
102
+ /** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/
103
+ textureDefinitionInfos?: TextureDefinitionInfo[];
104
+ /** node id to make unique SharedResource ids */
105
+ nodePath?: string;
106
+ };
107
+ /** I3S material definition and texture content taken from GLTF material */
108
+ export declare type I3SMaterialWithTexture = {
109
+ /** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */
110
+ material: I3SMaterialDefinition;
111
+ /** Texture content (image) */
112
+ texture?: ImageDataType;
113
+ };
114
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEjD,4CAA4C;AAC5C,oBAAY,qBAAqB,GAAG;IAClC;;;OAGG;IACH,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IACjD;;OAEG;IACH,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACpB;;OAEG;IACH,eAAe,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC9C;;OAEG;IACH,YAAY,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC5C;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;OAEG;IACH,UAAU,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACjC;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;OAEG;IACH,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,oBAAY,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,6BAA6B;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,8BAA8B;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IAClC,iDAAiD;IACjD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,eAAe,EAAE,IAAI,GAAG,eAAe,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,+BAA+B;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,6BAA6B;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,8BAA8B;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,kCAAkC;IAClC,SAAS,EAAE,WAAW,CAAC;IACvB,kCAAkC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,8DAA8D;AAC9D,oBAAY,4BAA4B,GAAG;IACzC,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,6BAA6B;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,8BAA8B;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,iCAAiC;IACjC,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,+CAA+C;AAC/C,oBAAY,qBAAqB,GAAG;IAClC,oHAAoH;IACpH,uBAAuB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACnD,kHAAkH;IAClH,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjD,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,2EAA2E;AAC3E,oBAAY,sBAAsB,GAAG;IACnC,2GAA2G;IAC3G,QAAQ,EAAE,qBAAqB,CAAC;IAChC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export = app;
2
+ declare const app: any;
3
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/i3s-server/app.js"],"names":[],"mappings":";AAOA,uBAAsB"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ const express = require('express');
3
+ const path = require('path');
4
+ const logger = require('morgan');
5
+ const cors = require('cors');
6
+ const indexRouter = require('./routes/index');
7
+ const app = express();
8
+ app.use(logger('dev'));
9
+ app.use(express.json());
10
+ app.use(express.urlencoded({ extended: false }));
11
+ app.use(express.static(path.join(__dirname, 'public')));
12
+ app.use(cors());
13
+ app.use('/', indexRouter);
14
+ module.exports = app;
@@ -0,0 +1,2 @@
1
+ export function getFileNameByUrl(url: any): Promise<string | null>;
2
+ //# sourceMappingURL=index-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-controller.d.ts","sourceRoot":"","sources":["../../../src/i3s-server/controllers/index-controller.js"],"names":[],"mappings":"AAQA,mEAYC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+ const { promises } = fs;
5
+ const I3S_LAYER_PATH = process.env.I3sLayerPath || ''; // eslint-disable-line no-process-env, no-undef
6
+ const FULL_LAYER_PATH = path.join(process.cwd(), I3S_LAYER_PATH); // eslint-disable-line no-undef
7
+ async function getFileNameByUrl(url) {
8
+ const extensions = ['json', 'bin', 'jpg', 'jpeg', 'png', 'bin.dds', 'ktx2'];
9
+ for (const ext of extensions) {
10
+ const fileName = `${FULL_LAYER_PATH}${url}/index.${ext}`;
11
+ try {
12
+ await promises.access(fileName);
13
+ return fileName;
14
+ }
15
+ catch {
16
+ continue; // eslint-disable-line no-continue
17
+ }
18
+ }
19
+ return null;
20
+ }
21
+ module.exports = {
22
+ getFileNameByUrl
23
+ };
@@ -0,0 +1,3 @@
1
+ export = router;
2
+ declare const router: any;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i3s-server/routes/index.js"],"names":[],"mappings":";AACA,0BAAgC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ const express = require('express');
3
+ const router = express.Router();
4
+ const { getFileNameByUrl } = require('../controllers/index-controller');
5
+ /* GET home page. */
6
+ router.get('*', async function (req, res, next) {
7
+ const fileName = await getFileNameByUrl(req.path);
8
+ if (fileName) {
9
+ res.sendFile(fileName);
10
+ }
11
+ else {
12
+ res.status(404);
13
+ res.send('File not found');
14
+ }
15
+ });
16
+ module.exports = router;
@@ -0,0 +1,3 @@
1
+ export { default as I3SConverter } from './i3s-converter/i3s-converter';
2
+ export { default as Tiles3DConverter } from './3d-tiles-converter/3d-tiles-converter';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,yCAAyC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Tiles3DConverter = exports.I3SConverter = void 0;
7
+ var i3s_converter_1 = require("./i3s-converter/i3s-converter");
8
+ Object.defineProperty(exports, "I3SConverter", { enumerable: true, get: function () { return __importDefault(i3s_converter_1).default; } });
9
+ var _3d_tiles_converter_1 = require("./3d-tiles-converter/3d-tiles-converter");
10
+ Object.defineProperty(exports, "Tiles3DConverter", { enumerable: true, get: function () { return __importDefault(_3d_tiles_converter_1).default; } });
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Compress file to gzip file
3
+ *
4
+ * @param pathFile - the path to the file
5
+ * @return the path to the gzip file
6
+ */
7
+ export declare function compressFileWithGzip(pathFile: string): Promise<string>;
8
+ /**
9
+ * Compress files from map into slpk file
10
+ *
11
+ * @param fileMap - map with file paths (key: output path, value: input path)
12
+ * @param outputFile - output slpk file
13
+ * @param level - compression level
14
+ */
15
+ export declare function compressFilesWithZip(fileMap: {
16
+ [key: string]: string;
17
+ }, outputFile: string, level?: number): Promise<unknown>;
18
+ /**
19
+ * Compress files using external tool 'zip'/'7z'
20
+ *
21
+ * @param inputFolder - folder to archive - for cwd option
22
+ * @param outputFile - output slpk file
23
+ * @param level - compression level
24
+ * @param inputFiles - input files path to pass to the executable as option
25
+ * @param sevenZipExe - path to 7z.exe executable
26
+ */
27
+ export declare function compressWithChildProcess(inputFolder: string, outputFile: string, level: number, inputFiles: string, sevenZipExe: string): Promise<void>;
28
+ /**
29
+ * Generate hash file from zip archive
30
+ * https://github.com/Esri/i3s-spec/blob/master/docs/1.7/slpk_hashtable.cmn.md
31
+ *
32
+ * @param inputZipFile
33
+ * @param outputFile
34
+ */
35
+ export declare function generateHash128FromZip(inputZipFile: string, outputFile: string): Promise<unknown>;
36
+ /**
37
+ * Add file to zip archive
38
+ *
39
+ * @param inputFile
40
+ * @param fileName
41
+ * @param zipFile
42
+ * @param sevenZipExe
43
+ */
44
+ export declare function addFileToZip(inputFolder: string, fileName: string, zipFile: string, sevenZipExe: string): Promise<void>;
45
+ //# sourceMappingURL=compress-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress-util.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/compress-util.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBtE;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,EAChC,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,MAAU,oBAqDlB;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,iBAQpB;AAgED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBA6CpF;AAeD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,iBAIpB"}