@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.
- package/dist/3d-tiles-attributes-worker.d.ts +28 -0
- package/dist/3d-tiles-attributes-worker.d.ts.map +1 -0
- package/dist/3d-tiles-attributes-worker.js +4 -0
- package/dist/3d-tiles-attributes-worker.js.map +7 -0
- package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +82 -0
- package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -0
- package/dist/3d-tiles-converter/3d-tiles-converter.js +268 -0
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +84 -0
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -0
- package/dist/3d-tiles-converter/helpers/b3dm-converter.js +278 -0
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +13 -0
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts.map +1 -0
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +23 -0
- package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts +9 -0
- package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts.map +1 -0
- package/dist/3d-tiles-converter/helpers/texture-atlas.js +52 -0
- package/dist/3d-tiles-converter/json-templates/tileset.d.ts +15 -0
- package/dist/3d-tiles-converter/json-templates/tileset.d.ts.map +1 -0
- package/dist/3d-tiles-converter/json-templates/tileset.js +43 -0
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +5 -0
- package/dist/converter-cli.d.ts +2 -0
- package/dist/converter-cli.d.ts.map +1 -0
- package/dist/converter-cli.js +232 -0
- package/dist/converter.min.js +68 -68
- package/dist/deps-installer/deps-installer.d.ts +14 -0
- package/dist/deps-installer/deps-installer.d.ts.map +1 -0
- package/dist/deps-installer/deps-installer.js +31 -0
- package/dist/dist.min.js +1151 -1264
- package/dist/es5/3d-tiles-attributes-worker.js +29 -0
- package/dist/es5/3d-tiles-attributes-worker.js.map +1 -0
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +104 -44
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +34 -43
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/es5/converter-cli.js +306 -0
- package/dist/es5/converter-cli.js.map +1 -0
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +29 -0
- package/dist/es5/i3s-attributes-worker.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js +19 -11
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +2 -2
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +271 -182
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js +71 -0
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/node-pages.js +47 -99
- package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +311 -245
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/index.js +0 -16
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/utils/compress-util.js +14 -17
- package/dist/es5/lib/utils/compress-util.js.map +1 -1
- package/dist/es5/lib/utils/file-utils.js +39 -14
- package/dist/es5/lib/utils/file-utils.js.map +1 -1
- package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/es5/lib/utils/queue.js +61 -0
- package/dist/es5/lib/utils/queue.js.map +1 -0
- package/dist/es5/lib/utils/statistic-utills.js.map +1 -1
- package/dist/es5/lib/utils/write-queue.js +225 -0
- package/dist/es5/lib/utils/write-queue.js.map +1 -0
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/es5/pgm-loader.js.map +1 -1
- package/dist/es5/workers/3d-tiles-attributes-worker.js +37 -0
- package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -0
- package/dist/es5/workers/i3s-attributes-worker.js +40 -0
- package/dist/es5/workers/i3s-attributes-worker.js.map +1 -0
- package/dist/esm/3d-tiles-attributes-worker.js +16 -0
- package/dist/esm/3d-tiles-attributes-worker.js.map +1 -0
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +32 -5
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +23 -23
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/esm/converter-cli.js +230 -0
- package/dist/esm/converter-cli.js.map +1 -0
- package/dist/esm/deps-installer/deps-installer.js.map +1 -1
- package/dist/esm/i3s-attributes-worker.js +16 -0
- package/dist/esm/i3s-attributes-worker.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js +19 -11
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js +2 -2
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +121 -62
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js +54 -0
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/node-pages.js +12 -4
- package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +155 -50
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/utils/compress-util.js +6 -8
- package/dist/esm/lib/utils/compress-util.js.map +1 -1
- package/dist/esm/lib/utils/file-utils.js +11 -1
- package/dist/esm/lib/utils/file-utils.js.map +1 -1
- package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/esm/lib/utils/queue.js +19 -0
- package/dist/esm/lib/utils/queue.js.map +1 -0
- package/dist/esm/lib/utils/statistic-utills.js.map +1 -1
- package/dist/esm/lib/utils/write-queue.js +88 -0
- package/dist/esm/lib/utils/write-queue.js.map +1 -0
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/esm/pgm-loader.js.map +1 -1
- package/dist/esm/workers/3d-tiles-attributes-worker.js +5 -0
- package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -0
- package/dist/esm/workers/i3s-attributes-worker.js +4 -0
- package/dist/esm/workers/i3s-attributes-worker.js.map +1 -0
- package/dist/i3s-attributes-worker.d.ts +33 -0
- package/dist/i3s-attributes-worker.d.ts.map +1 -0
- package/dist/i3s-attributes-worker.js +10 -0
- package/dist/i3s-attributes-worker.js.map +7 -0
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts +41 -0
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/coordinate-converter.js +122 -0
- package/dist/i3s-converter/helpers/create-scene-server-path.d.ts +9 -0
- package/dist/i3s-converter/helpers/create-scene-server-path.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/create-scene-server-path.js +28 -0
- package/dist/i3s-converter/helpers/geometry-attributes.d.ts +8 -0
- package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/geometry-attributes.js +177 -0
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +29 -0
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/geometry-converter.js +901 -0
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts +9 -0
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/gltf-attributes.js +56 -0
- package/dist/i3s-converter/helpers/node-debug.d.ts +8 -0
- package/dist/i3s-converter/helpers/node-debug.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/node-debug.js +114 -0
- package/dist/i3s-converter/helpers/node-pages.d.ts +117 -0
- package/dist/i3s-converter/helpers/node-pages.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/node-pages.js +208 -0
- package/dist/i3s-converter/i3s-converter.d.ts +323 -0
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -0
- package/dist/i3s-converter/i3s-converter.js +1074 -0
- package/dist/i3s-converter/json-templates/layers.d.ts +95 -0
- package/dist/i3s-converter/json-templates/layers.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/layers.js +199 -0
- package/dist/i3s-converter/json-templates/metadata.d.ts +22 -0
- package/dist/i3s-converter/json-templates/metadata.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/metadata.js +25 -0
- package/dist/i3s-converter/json-templates/node.d.ts +61 -0
- package/dist/i3s-converter/json-templates/node.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/node.js +89 -0
- package/dist/i3s-converter/json-templates/scene-server.d.ts +28 -0
- package/dist/i3s-converter/json-templates/scene-server.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/scene-server.js +31 -0
- package/dist/i3s-converter/json-templates/shared-resources.d.ts +14 -0
- package/dist/i3s-converter/json-templates/shared-resources.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/shared-resources.js +129 -0
- package/dist/i3s-converter/json-templates/store.d.ts +95 -0
- package/dist/i3s-converter/json-templates/store.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/store.js +103 -0
- package/dist/i3s-converter/types.d.ts +114 -0
- package/dist/i3s-converter/types.d.ts.map +1 -0
- package/dist/i3s-converter/types.js +2 -0
- package/dist/i3s-server/app.d.ts +3 -0
- package/dist/i3s-server/app.d.ts.map +1 -0
- package/dist/i3s-server/app.js +14 -0
- package/dist/i3s-server/controllers/index-controller.d.ts +2 -0
- package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -0
- package/dist/i3s-server/controllers/index-controller.js +23 -0
- package/dist/i3s-server/routes/index.d.ts +3 -0
- package/dist/i3s-server/routes/index.d.ts.map +1 -0
- package/dist/i3s-server/routes/index.js +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/lib/utils/compress-util.d.ts +45 -0
- package/dist/lib/utils/compress-util.d.ts.map +1 -0
- package/dist/lib/utils/compress-util.js +257 -0
- package/dist/{esm/lib → lib}/utils/file-utils.d.ts +6 -14
- package/dist/lib/utils/file-utils.d.ts.map +1 -0
- package/dist/lib/utils/file-utils.js +81 -0
- package/dist/lib/utils/lod-conversion-utils.d.ts +41 -0
- package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -0
- package/dist/lib/utils/lod-conversion-utils.js +76 -0
- package/dist/lib/utils/queue.d.ts +7 -0
- package/dist/lib/utils/queue.d.ts.map +1 -0
- package/dist/lib/utils/queue.js +18 -0
- package/dist/lib/utils/statistic-utills.d.ts +3 -0
- package/dist/lib/utils/statistic-utills.d.ts.map +1 -0
- package/dist/lib/utils/statistic-utills.js +64 -0
- package/dist/lib/utils/write-queue.d.ts +22 -0
- package/dist/lib/utils/write-queue.d.ts.map +1 -0
- package/dist/lib/utils/write-queue.js +62 -0
- package/dist/pgm-loader.d.ts +6 -0
- package/dist/pgm-loader.d.ts.map +1 -0
- package/dist/pgm-loader.js +23 -0
- package/dist/workers/3d-tiles-attributes-worker.d.ts +2 -0
- package/dist/workers/3d-tiles-attributes-worker.d.ts.map +1 -0
- package/dist/workers/3d-tiles-attributes-worker.js +9 -0
- package/dist/workers/i3s-attributes-worker.d.ts +2 -0
- package/dist/workers/i3s-attributes-worker.d.ts.map +1 -0
- package/dist/workers/i3s-attributes-worker.js +5 -0
- package/package.json +19 -18
- package/src/3d-tiles-attributes-worker.ts +43 -0
- package/src/3d-tiles-converter/3d-tiles-converter.ts +49 -6
- package/src/3d-tiles-converter/helpers/b3dm-converter.ts +21 -18
- package/src/converter-cli.ts +310 -0
- package/src/deps-installer/{deps-installer.js → deps-installer.ts} +11 -1
- package/src/i3s-attributes-worker.ts +46 -0
- package/src/i3s-converter/helpers/coordinate-converter.ts +29 -24
- package/src/i3s-converter/helpers/geometry-attributes.ts +4 -3
- package/src/i3s-converter/helpers/{geometry-converter.js → geometry-converter.ts} +425 -179
- package/src/i3s-converter/helpers/gltf-attributes.ts +68 -0
- package/src/i3s-converter/helpers/node-pages.ts +25 -17
- package/src/i3s-converter/i3s-converter.ts +154 -87
- package/src/i3s-converter/types.ts +90 -8
- package/src/index.ts +0 -4
- package/src/lib/utils/{compress-util.js → compress-util.ts} +105 -18
- package/src/lib/utils/file-utils.ts +84 -0
- package/src/lib/utils/{lod-conversion-utils.js → lod-conversion-utils.ts} +27 -5
- package/src/lib/utils/queue.ts +17 -0
- package/src/lib/utils/{statistic-utills.js → statistic-utills.ts} +0 -0
- package/src/lib/utils/write-queue.ts +75 -0
- package/src/workers/3d-tiles-attributes-worker.ts +6 -0
- package/src/workers/i3s-attributes-worker.ts +6 -0
- package/dist/es5/deps-installer/deps-installer.d.ts +0 -10
- package/dist/es5/i3s-converter/helpers/geometry-converter.d.ts +0 -44
- package/dist/es5/lib/utils/compress-util.d.ts +0 -53
- package/dist/es5/lib/utils/file-utils.d.ts +0 -43
- package/dist/es5/lib/utils/lod-conversion-utils.d.ts +0 -32
- package/dist/esm/deps-installer/deps-installer.d.ts +0 -10
- package/dist/esm/i3s-converter/helpers/geometry-converter.d.ts +0 -44
- package/dist/esm/lib/utils/compress-util.d.ts +0 -53
- package/dist/esm/lib/utils/lod-conversion-utils.d.ts +0 -32
- package/src/deps-installer/deps-installer.d.ts +0 -10
- package/src/i3s-converter/helpers/geometry-converter.d.ts +0 -44
- package/src/lib/utils/compress-util.d.ts +0 -53
- package/src/lib/utils/file-utils.d.ts +0 -43
- package/src/lib/utils/file-utils.js +0 -38
- package/src/lib/utils/lod-conversion-utils.d.ts +0 -32
|
@@ -1,42 +1,124 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
BoundingVolumes,
|
|
3
|
+
I3SMaterialDefinition,
|
|
4
|
+
MaterialDefinitionInfo,
|
|
5
|
+
TextureDefinitionInfo
|
|
6
|
+
} from '@loaders.gl/i3s';
|
|
7
|
+
import {ImageDataType} from '@loaders.gl/images';
|
|
2
8
|
|
|
9
|
+
/** Converted resources for specific node */
|
|
3
10
|
export type I3SConvertedResources = {
|
|
11
|
+
/** Non-compressed geometry buffer that have structure met
|
|
12
|
+
* https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
|
|
13
|
+
* (Geometry buffer)
|
|
14
|
+
*/
|
|
4
15
|
geometry: ArrayBuffer | null;
|
|
5
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Draco compressed geometry
|
|
18
|
+
*/
|
|
19
|
+
compressedGeometry?: Promise<ArrayBuffer> | null;
|
|
20
|
+
/**
|
|
21
|
+
* Texture image content
|
|
22
|
+
*/
|
|
6
23
|
texture: any | null;
|
|
7
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Shared resources built from GLTF material
|
|
26
|
+
*/
|
|
27
|
+
sharedResources: SharedResourcesArrays | null;
|
|
28
|
+
/**
|
|
29
|
+
* Material definition of the node
|
|
30
|
+
*/
|
|
8
31
|
meshMaterial?: I3SMaterialDefinition | null;
|
|
32
|
+
/**
|
|
33
|
+
* Number of vertices in the node
|
|
34
|
+
*/
|
|
9
35
|
vertexCount: number | null;
|
|
10
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Feature attributes contents
|
|
38
|
+
*/
|
|
39
|
+
attributes: ArrayBuffer[] | null;
|
|
40
|
+
/**
|
|
41
|
+
* Number of features in the node
|
|
42
|
+
*/
|
|
11
43
|
featureCount: number | null;
|
|
12
|
-
|
|
44
|
+
/**
|
|
45
|
+
* MBS and/or OBB bounding volumes of the node
|
|
46
|
+
*/
|
|
13
47
|
boundingVolumes: BoundingVolumes | null;
|
|
14
48
|
};
|
|
15
49
|
|
|
16
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Geometry and feature attributes converted from GLTF primitives
|
|
52
|
+
*/
|
|
53
|
+
export type ConvertedAttributes = {
|
|
54
|
+
/** POSITION attribute value */
|
|
17
55
|
positions: Float32Array;
|
|
56
|
+
/** NORMAL attribute value */
|
|
18
57
|
normals: Float32Array;
|
|
58
|
+
/** TEXCOORD_0 attribute value */
|
|
19
59
|
texCoords: Float32Array;
|
|
60
|
+
/** COLOR_0 attribute value */
|
|
20
61
|
colors: Uint8Array;
|
|
62
|
+
/** Feature indices grouped by ...
|
|
63
|
+
* converted from "batch ids" of GLTF
|
|
64
|
+
*/
|
|
65
|
+
featureIndicesGroups?: number[][];
|
|
66
|
+
/** Feature indices converted from "batch ids" */
|
|
21
67
|
featureIndices: number[];
|
|
22
|
-
|
|
23
|
-
|
|
68
|
+
/**
|
|
69
|
+
* MBS and/or OBB bounding volumes of the node
|
|
70
|
+
*/
|
|
71
|
+
boundingVolumes: null | BoundingVolumes;
|
|
24
72
|
};
|
|
25
73
|
|
|
74
|
+
/** Postprocessed geometry and feature attributes
|
|
75
|
+
* https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
|
|
76
|
+
*/
|
|
26
77
|
export type GeometryAttributes = {
|
|
78
|
+
/** POSITION attribute value */
|
|
27
79
|
positions: Float32Array;
|
|
80
|
+
/** NORMAL attribute value */
|
|
28
81
|
normals: Float32Array;
|
|
82
|
+
/** TEXCOORD_0 attribute value */
|
|
29
83
|
texCoords: Float32Array;
|
|
84
|
+
/** COLOR_0 attribute value */
|
|
30
85
|
colors: Uint8Array;
|
|
86
|
+
/** faceRanges attribute value */
|
|
31
87
|
faceRange: Uint32Array;
|
|
88
|
+
/** feature Ids attribute value */
|
|
32
89
|
featureIds: number[];
|
|
90
|
+
/** number of features in the node */
|
|
33
91
|
featureCount: number;
|
|
34
92
|
};
|
|
35
93
|
|
|
94
|
+
/** Geometry attributes specific for the particular feature */
|
|
36
95
|
export type GroupedByFeatureIdAttributes = {
|
|
96
|
+
/** Feature Id */
|
|
37
97
|
featureId: number;
|
|
98
|
+
/** POSITION attribute value */
|
|
38
99
|
positions: Float32Array;
|
|
100
|
+
/** NORMAL attribute value */
|
|
39
101
|
normals: Float32Array;
|
|
102
|
+
/** COLOR_0 attribute value */
|
|
40
103
|
colors: Uint8Array;
|
|
104
|
+
/** TEXCOORD_0 attribute value */
|
|
41
105
|
texCoords: Float32Array;
|
|
42
106
|
};
|
|
107
|
+
|
|
108
|
+
/** Shared resources made from GLTF material */
|
|
109
|
+
export type SharedResourcesArrays = {
|
|
110
|
+
/** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */
|
|
111
|
+
materialDefinitionInfos?: MaterialDefinitionInfo[];
|
|
112
|
+
/** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/
|
|
113
|
+
textureDefinitionInfos?: TextureDefinitionInfo[];
|
|
114
|
+
/** node id to make unique SharedResource ids */
|
|
115
|
+
nodePath?: string;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/** I3S material definition and texture content taken from GLTF material */
|
|
119
|
+
export type I3SMaterialWithTexture = {
|
|
120
|
+
/** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */
|
|
121
|
+
material: I3SMaterialDefinition;
|
|
122
|
+
/** Texture content (image) */
|
|
123
|
+
texture?: ImageDataType;
|
|
124
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
export {default as I3SConverter} from './i3s-converter/i3s-converter';
|
|
2
|
-
export {default as NodePages} from './i3s-converter/helpers/node-pages';
|
|
3
|
-
|
|
4
2
|
export {default as Tiles3DConverter} from './3d-tiles-converter/3d-tiles-converter';
|
|
5
|
-
|
|
6
|
-
export {DepsInstaller} from './deps-installer/deps-installer';
|
|
@@ -9,7 +9,13 @@ import {MD5Hash} from '@loaders.gl/crypto';
|
|
|
9
9
|
import crypt from 'crypt';
|
|
10
10
|
import {getAbsoluteFilePath} from './file-utils';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Compress file to gzip file
|
|
14
|
+
*
|
|
15
|
+
* @param pathFile - the path to the file
|
|
16
|
+
* @return the path to the gzip file
|
|
17
|
+
*/
|
|
18
|
+
export function compressFileWithGzip(pathFile: string): Promise<string> {
|
|
13
19
|
const compressedPathFile = `${pathFile}.gz`;
|
|
14
20
|
const gzip = createGzip();
|
|
15
21
|
const input = createReadStream(pathFile);
|
|
@@ -28,7 +34,18 @@ export function compressFileWithGzip(pathFile) {
|
|
|
28
34
|
});
|
|
29
35
|
}
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Compress files from map into slpk file
|
|
39
|
+
*
|
|
40
|
+
* @param fileMap - map with file paths (key: output path, value: input path)
|
|
41
|
+
* @param outputFile - output slpk file
|
|
42
|
+
* @param level - compression level
|
|
43
|
+
*/
|
|
44
|
+
export async function compressFilesWithZip(
|
|
45
|
+
fileMap: {[key: string]: string},
|
|
46
|
+
outputFile: string,
|
|
47
|
+
level: number = 0
|
|
48
|
+
) {
|
|
32
49
|
// Before creating a new file, we need to delete the old file
|
|
33
50
|
try {
|
|
34
51
|
await removeFile(outputFile);
|
|
@@ -82,16 +99,44 @@ export async function compressFilesWithZip(fileMap, outputFile, level = 0) {
|
|
|
82
99
|
});
|
|
83
100
|
}
|
|
84
101
|
|
|
85
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Compress files using external tool 'zip'/'7z'
|
|
104
|
+
*
|
|
105
|
+
* @param inputFolder - folder to archive - for cwd option
|
|
106
|
+
* @param outputFile - output slpk file
|
|
107
|
+
* @param level - compression level
|
|
108
|
+
* @param inputFiles - input files path to pass to the executable as option
|
|
109
|
+
* @param sevenZipExe - path to 7z.exe executable
|
|
110
|
+
*/
|
|
111
|
+
export async function compressWithChildProcess(
|
|
112
|
+
inputFolder: string,
|
|
113
|
+
outputFile: string,
|
|
114
|
+
level: number,
|
|
115
|
+
inputFiles: string,
|
|
116
|
+
sevenZipExe: string
|
|
117
|
+
) {
|
|
86
118
|
// eslint-disable-next-line no-undef
|
|
87
119
|
if (process.platform === 'win32') {
|
|
88
|
-
await compressWithChildProcessWindows(
|
|
120
|
+
await compressWithChildProcessWindows(inputFolder, outputFile, level, inputFiles, sevenZipExe);
|
|
89
121
|
} else {
|
|
90
|
-
await compressWithChildProcessUnix(
|
|
122
|
+
await compressWithChildProcessUnix(inputFolder, outputFile, level, inputFiles);
|
|
91
123
|
}
|
|
92
124
|
}
|
|
93
125
|
|
|
94
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Compress files using external linux tool 'zip'
|
|
128
|
+
*
|
|
129
|
+
* @param inputFolder - folder to archive - for cwd option
|
|
130
|
+
* @param outputFile - output slpk file
|
|
131
|
+
* @param level - compression level
|
|
132
|
+
* @param inputFiles - input files path to pass to the executable as option
|
|
133
|
+
*/
|
|
134
|
+
async function compressWithChildProcessUnix(
|
|
135
|
+
inputFolder: string,
|
|
136
|
+
outputFile: string,
|
|
137
|
+
level: number = 0,
|
|
138
|
+
inputFiles: string = '.'
|
|
139
|
+
) {
|
|
95
140
|
const fullOutputFile = getAbsoluteFilePath(outputFile);
|
|
96
141
|
const args = [`-${level}`, '-r', fullOutputFile, inputFiles];
|
|
97
142
|
const childProcess = new ChildProcessProxy();
|
|
@@ -105,12 +150,21 @@ async function compressWithChildProcessUnix(inputFolder, outputFile, level = 0,
|
|
|
105
150
|
});
|
|
106
151
|
}
|
|
107
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Compress files using windows external tool '7z'
|
|
155
|
+
*
|
|
156
|
+
* @param inputFolder - folder to archive - for cwd option
|
|
157
|
+
* @param outputFile - output slpk file
|
|
158
|
+
* @param level - compression level
|
|
159
|
+
* @param inputFiles - input files path to pass to the executable as option
|
|
160
|
+
* @param sevenZipExe - path to 7z.exe executable
|
|
161
|
+
*/
|
|
108
162
|
async function compressWithChildProcessWindows(
|
|
109
|
-
inputFolder,
|
|
110
|
-
outputFile,
|
|
111
|
-
level = 0,
|
|
112
|
-
inputFiles = join('.', '*'),
|
|
113
|
-
sevenZipExe
|
|
163
|
+
inputFolder: string,
|
|
164
|
+
outputFile: string,
|
|
165
|
+
level: number = 0,
|
|
166
|
+
inputFiles: string = join('.', '*'),
|
|
167
|
+
sevenZipExe: string
|
|
114
168
|
) {
|
|
115
169
|
// Workaround for @listfile issue. In 7z.exe @-leading files are handled as listfiles
|
|
116
170
|
// https://sevenzip.osdn.jp/chm/cmdline/syntax.htm
|
|
@@ -131,10 +185,17 @@ async function compressWithChildProcessWindows(
|
|
|
131
185
|
});
|
|
132
186
|
}
|
|
133
187
|
|
|
134
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Generate hash file from zip archive
|
|
190
|
+
* https://github.com/Esri/i3s-spec/blob/master/docs/1.7/slpk_hashtable.cmn.md
|
|
191
|
+
*
|
|
192
|
+
* @param inputZipFile
|
|
193
|
+
* @param outputFile
|
|
194
|
+
*/
|
|
195
|
+
export async function generateHash128FromZip(inputZipFile: string, outputFile: string) {
|
|
135
196
|
const input = await fs.readFile(inputZipFile);
|
|
136
197
|
const zip = await JSZip.loadAsync(input);
|
|
137
|
-
const hashTable = [];
|
|
198
|
+
const hashTable: {key: string; value: string}[] = [];
|
|
138
199
|
const zipFiles = zip.files;
|
|
139
200
|
for (const relativePath in zipFiles) {
|
|
140
201
|
const zipEntry = zipFiles[relativePath];
|
|
@@ -169,7 +230,7 @@ export async function generateHash128FromZip(inputZipFile, outputFile) {
|
|
|
169
230
|
});
|
|
170
231
|
for (const key in hashTable) {
|
|
171
232
|
const item = hashTable[key];
|
|
172
|
-
const value =
|
|
233
|
+
const value = longToByteArray(item.value);
|
|
173
234
|
// TODO: perhaps you need to wait for the 'drain' event if the write returns 'false'
|
|
174
235
|
// eslint-disable-next-line no-undef
|
|
175
236
|
output.write(Buffer.from(crypt.hexToBytes(item.key).concat(value)));
|
|
@@ -178,19 +239,45 @@ export async function generateHash128FromZip(inputZipFile, outputFile) {
|
|
|
178
239
|
});
|
|
179
240
|
}
|
|
180
241
|
|
|
181
|
-
|
|
242
|
+
/**
|
|
243
|
+
* Encode 64 bit value to byte array
|
|
244
|
+
*
|
|
245
|
+
* @param long - stringified number
|
|
246
|
+
* @returns
|
|
247
|
+
*/
|
|
248
|
+
function longToByteArray(long: string): number[] {
|
|
182
249
|
const buffer = new ArrayBuffer(8); // JS numbers are 8 bytes long, or 64 bits
|
|
183
250
|
const longNum = new Float64Array(buffer); // so equivalent to Float64
|
|
184
|
-
longNum[0] = long;
|
|
251
|
+
longNum[0] = parseInt(long);
|
|
185
252
|
return Array.from(new Uint8Array(buffer)).reverse(); // reverse to get little endian
|
|
186
253
|
}
|
|
187
254
|
|
|
188
|
-
|
|
255
|
+
/**
|
|
256
|
+
* Add file to zip archive
|
|
257
|
+
*
|
|
258
|
+
* @param inputFile
|
|
259
|
+
* @param fileName
|
|
260
|
+
* @param zipFile
|
|
261
|
+
* @param sevenZipExe
|
|
262
|
+
*/
|
|
263
|
+
export async function addFileToZip(
|
|
264
|
+
inputFolder: string,
|
|
265
|
+
fileName: string,
|
|
266
|
+
zipFile: string,
|
|
267
|
+
sevenZipExe: string
|
|
268
|
+
) {
|
|
189
269
|
await compressWithChildProcess(inputFolder, zipFile, 0, fileName, sevenZipExe);
|
|
190
270
|
console.log(`${fileName} added to ${zipFile}.`); // eslint-disable-line
|
|
191
271
|
}
|
|
192
272
|
|
|
193
|
-
|
|
273
|
+
/**
|
|
274
|
+
*
|
|
275
|
+
* @param archive zip archive instance
|
|
276
|
+
* @param subFileName file path inside archive
|
|
277
|
+
* @param subFileData source file path
|
|
278
|
+
* @returns
|
|
279
|
+
*/
|
|
280
|
+
function appendFileToArchive(archive: any, subFileName: string, subFileData: string) {
|
|
194
281
|
return new Promise((resolve) => {
|
|
195
282
|
const fileStream = createReadStream(subFileData);
|
|
196
283
|
console.log(`Compression start: ${subFileName}`); // eslint-disable-line no-undef,no-console
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {promises as fs} from 'fs';
|
|
2
|
+
import {isAbsolute, join} from 'path';
|
|
3
|
+
import {compressFileWithGzip} from './compress-util';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Write a file with data and name fileName to path
|
|
7
|
+
*
|
|
8
|
+
* @param path - output path
|
|
9
|
+
* @param data - file content
|
|
10
|
+
* @param fileName - name of output file (default: index.json)
|
|
11
|
+
*/
|
|
12
|
+
export async function writeFile(
|
|
13
|
+
path: string,
|
|
14
|
+
data: string | Uint8Array | ArrayBuffer | Promise<ArrayBuffer>,
|
|
15
|
+
fileName: string = 'index.json'
|
|
16
|
+
): Promise<string> {
|
|
17
|
+
let toWriteData: string | Uint8Array;
|
|
18
|
+
if (data instanceof Promise) {
|
|
19
|
+
toWriteData = new Uint8Array(await data);
|
|
20
|
+
} else if (data instanceof ArrayBuffer) {
|
|
21
|
+
toWriteData = new Uint8Array(data as ArrayBuffer);
|
|
22
|
+
} else {
|
|
23
|
+
toWriteData = data;
|
|
24
|
+
}
|
|
25
|
+
await fs.mkdir(path, {recursive: true});
|
|
26
|
+
const pathFile = join(path, fileName);
|
|
27
|
+
try {
|
|
28
|
+
await fs.writeFile(pathFile, toWriteData);
|
|
29
|
+
} catch (err) {
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
console.log(`${pathFile} saved.`); // eslint-disable-line
|
|
33
|
+
return pathFile;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Write a file with data and name fileName to path - specific one for further packaging into slpk
|
|
38
|
+
*
|
|
39
|
+
* @param path - output path
|
|
40
|
+
* @param data - file content
|
|
41
|
+
* @param fileName - name of output file (default: index.json)
|
|
42
|
+
* @param compress - if need to compress file with gzip (default: true)
|
|
43
|
+
*/
|
|
44
|
+
export async function writeFileForSlpk(
|
|
45
|
+
path: string,
|
|
46
|
+
data: string | Uint8Array | ArrayBuffer | Promise<ArrayBuffer>,
|
|
47
|
+
fileName: string = 'index.json',
|
|
48
|
+
compress: boolean = true
|
|
49
|
+
): Promise<string> {
|
|
50
|
+
const pathFile = await writeFile(path, data, fileName);
|
|
51
|
+
if (compress) {
|
|
52
|
+
const pathGzFile = await compressFileWithGzip(pathFile);
|
|
53
|
+
// After compression, we don't need an uncompressed file
|
|
54
|
+
await removeFile(pathFile);
|
|
55
|
+
return pathGzFile;
|
|
56
|
+
}
|
|
57
|
+
return pathFile;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Remove dir with path
|
|
62
|
+
*
|
|
63
|
+
* @param path
|
|
64
|
+
*/
|
|
65
|
+
export function removeDir(path: string) {
|
|
66
|
+
return fs.rmdir(path, {recursive: true});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Remove file with path
|
|
71
|
+
*
|
|
72
|
+
* @param path
|
|
73
|
+
*/
|
|
74
|
+
export function removeFile(path: string) {
|
|
75
|
+
return fs.unlink(path);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Generates absolute file path
|
|
80
|
+
* @param filePath
|
|
81
|
+
*/
|
|
82
|
+
export function getAbsoluteFilePath(filePath: string) {
|
|
83
|
+
return isAbsolute(filePath) ? filePath : join(process.cwd(), filePath); // eslint-disable-line no-undef
|
|
84
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import {BoundingVolumes} from '@loaders.gl/i3s';
|
|
2
|
+
import {Tile3D} from '@loaders.gl/tiles';
|
|
3
|
+
|
|
1
4
|
// https://cesium.com/docs/cesiumjs-ref-doc/Cesium3DTileset.html
|
|
2
5
|
const DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR = 16;
|
|
3
6
|
/**
|
|
4
7
|
* Do conversion from geometric error to screen threshold
|
|
5
|
-
*
|
|
6
|
-
* @param {Object} coordinates
|
|
8
|
+
*
|
|
7
9
|
* In 3DTiles we have HLOD logic and parent tile also has bigger lodMetric value then its children.
|
|
8
10
|
* In I3s we have reverse logic related to maxError. Parent has lower maxError than its child.
|
|
9
11
|
* In nodes where are no children tile.lodMetricValue is 0. This is because of logic of HLOD in 3DTiles
|
|
@@ -13,9 +15,24 @@ const DEFAULT_MAXIMUM_SCREEN_SPACE_ERROR = 16;
|
|
|
13
15
|
* https://github.com/Esri/i3s-spec/blob/master/docs/1.7/lodSelection.cmn.md
|
|
14
16
|
* To avoid infinity values when we do calculations of maxError we shold replace 0 with value which allows us
|
|
15
17
|
* to make child maxError bigger than his parent maxError.
|
|
18
|
+
*
|
|
19
|
+
* @param tile - 3d-tiles tile Object
|
|
20
|
+
* @param coordinates - node converted coordinates
|
|
21
|
+
* @returns An array of LOD metrics in format compatible with i3s 3DNodeIndexDocument.lodSelection
|
|
22
|
+
* @example
|
|
23
|
+
* [
|
|
24
|
+
{
|
|
25
|
+
"metricType": "maxScreenThresholdSQ",
|
|
26
|
+
"maxError": 870638.071285568
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"metricType": "maxScreenThreshold",
|
|
30
|
+
"maxError": 1052.8679031638949
|
|
31
|
+
}
|
|
32
|
+
]
|
|
16
33
|
*/
|
|
17
|
-
export function convertGeometricErrorToScreenThreshold(tile, coordinates) {
|
|
18
|
-
const lodSelection = [];
|
|
34
|
+
export function convertGeometricErrorToScreenThreshold(tile: Tile3D, coordinates: BoundingVolumes) {
|
|
35
|
+
const lodSelection: {metricType: string; maxError: number}[] = [];
|
|
19
36
|
const boundingVolume = tile.boundingVolume;
|
|
20
37
|
const lodMetricValue = tile.lodMetricValue || 0.1;
|
|
21
38
|
const maxScreenThreshold = {
|
|
@@ -38,7 +55,12 @@ export function convertGeometricErrorToScreenThreshold(tile, coordinates) {
|
|
|
38
55
|
return lodSelection;
|
|
39
56
|
}
|
|
40
57
|
|
|
41
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Convert LOD metric from "Screen Threshold" to "Screen Space Error"
|
|
60
|
+
* @param node - i3s node data
|
|
61
|
+
* @returns lod metric in 3d-tiles format
|
|
62
|
+
*/
|
|
63
|
+
export function convertScreenThresholdToGeometricError(node: Tile3D): number {
|
|
42
64
|
const metricData = node.header.lodSelection.maxScreenThreshold || {};
|
|
43
65
|
let maxError = metricData.maxError;
|
|
44
66
|
if (!maxError) {
|
|
File without changes
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {Queue} from './queue';
|
|
2
|
+
|
|
3
|
+
export type WriteQueueItem = {
|
|
4
|
+
archiveKey?: string;
|
|
5
|
+
writePromise: Promise<string>;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default class WriteQueue<T extends WriteQueueItem> extends Queue<T> {
|
|
9
|
+
private intervalId?: NodeJS.Timeout;
|
|
10
|
+
public writePromise: Promise<void> | null = null;
|
|
11
|
+
public fileMap: {[key: string]: string} = {};
|
|
12
|
+
public listeningInterval: number;
|
|
13
|
+
public writeConcurrency: number;
|
|
14
|
+
|
|
15
|
+
constructor(listeningInterval: number = 2000, writeConcurrency: number = 400) {
|
|
16
|
+
super();
|
|
17
|
+
this.listeningInterval = listeningInterval;
|
|
18
|
+
this.writeConcurrency = writeConcurrency;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
startListening() {
|
|
22
|
+
this.intervalId = setInterval(this.startWrite.bind(this), this.listeningInterval);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
stopListening() {
|
|
26
|
+
if (this.intervalId) {
|
|
27
|
+
clearInterval(this.intervalId);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async startWrite(): Promise<void> {
|
|
32
|
+
if (this.writePromise) {
|
|
33
|
+
await this.writePromise;
|
|
34
|
+
this.writePromise = null;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.writePromise = this.doWrite();
|
|
38
|
+
await this.writePromise;
|
|
39
|
+
this.writePromise = null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async finalize(): Promise<void> {
|
|
43
|
+
this.stopListening();
|
|
44
|
+
await this.startWrite();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private async doWrite(): Promise<void> {
|
|
48
|
+
while (this.length) {
|
|
49
|
+
const promises: Promise<string>[] = [];
|
|
50
|
+
const archiveKeys: (string | undefined)[] = [];
|
|
51
|
+
for (let i = 0; i < this.writeConcurrency; i++) {
|
|
52
|
+
const item = this.dequeue();
|
|
53
|
+
if (!item) {
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
const {archiveKey, writePromise} = item as WriteQueueItem;
|
|
57
|
+
archiveKeys.push(archiveKey);
|
|
58
|
+
promises.push(writePromise);
|
|
59
|
+
}
|
|
60
|
+
const writeResults = await Promise.all(promises);
|
|
61
|
+
this.updateFileMap(archiveKeys, writeResults);
|
|
62
|
+
}
|
|
63
|
+
this.writePromise = null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private updateFileMap(archiveKeys: (string | undefined)[], writeResults: string[]) {
|
|
67
|
+
for (let i = 0; i < archiveKeys.length; i++) {
|
|
68
|
+
const archiveKey = archiveKeys[i];
|
|
69
|
+
if (!archiveKey) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
this.fileMap[archiveKey] = writeResults[i];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {createWorker} from '@loaders.gl/worker-utils';
|
|
2
|
+
import B3dmConverter from '../3d-tiles-converter/helpers/b3dm-converter';
|
|
3
|
+
|
|
4
|
+
const b3dmConverter = new B3dmConverter();
|
|
5
|
+
|
|
6
|
+
createWorker(async (data, options = {}) => b3dmConverter.convert(data, options.attributes));
|
|
@@ -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
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {Vector3, Matrix4} from '@math.gl/core';
|
|
2
|
-
import {GeoidHeightModel} from '../../lib/geoid-height-model';
|
|
3
|
-
/**
|
|
4
|
-
* Convert binary data from b3dm file to i3s resources
|
|
5
|
-
*
|
|
6
|
-
* @param tileContent - 3d tile content
|
|
7
|
-
* @param options - converter options
|
|
8
|
-
* @returns A promise that resolves to object with `geometry`, compressedGeometry`, `texture` and `sharedResources` appropriate
|
|
9
|
-
* for use I3S tiles.
|
|
10
|
-
*/
|
|
11
|
-
export default function convertB3dmToI3sGeometry(
|
|
12
|
-
tileContent: {
|
|
13
|
-
batchTableJson: {
|
|
14
|
-
id: [];
|
|
15
|
-
};
|
|
16
|
-
cartographicOrigin: Vector3;
|
|
17
|
-
cartesianModelMatrix: Matrix4;
|
|
18
|
-
gltf: {
|
|
19
|
-
scene: {
|
|
20
|
-
nodes: [];
|
|
21
|
-
};
|
|
22
|
-
images: [];
|
|
23
|
-
materials: [];
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
nodeId: number,
|
|
27
|
-
featuresHashArray: any,
|
|
28
|
-
attributeStorageInfo: any,
|
|
29
|
-
draco: boolean,
|
|
30
|
-
generateBoundingVolumes: boolean,
|
|
31
|
-
geoidHeightModel: GeoidHeightModel
|
|
32
|
-
): Promise<
|
|
33
|
-
{
|
|
34
|
-
geometry: ArrayBuffer;
|
|
35
|
-
compressedGeometry: ArrayBuffer;
|
|
36
|
-
texture: any;
|
|
37
|
-
sharedResources: any;
|
|
38
|
-
meshMaterial: any;
|
|
39
|
-
vertexCount: number;
|
|
40
|
-
attributes: any;
|
|
41
|
-
featureCount: number;
|
|
42
|
-
boundingVolumes: any;
|
|
43
|
-
}[]
|
|
44
|
-
>;
|
|
@@ -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);
|