@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,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Write a file with data and name fileName to path
|
|
3
|
-
*
|
|
4
|
-
* @param path - output path
|
|
5
|
-
* @param data - file content
|
|
6
|
-
* @param fileName - name of output file (default: index.json)
|
|
7
|
-
*/
|
|
8
|
-
export function writeFile(path: string, data: string | Uint8Array | ArrayBuffer, fileName?: string);
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Write a file with data and name fileName to path - specific one for further packaging into slpk
|
|
12
|
-
*
|
|
13
|
-
* @param path - output path
|
|
14
|
-
* @param data - file content
|
|
15
|
-
* @param fileName - name of output file (default: index.json)
|
|
16
|
-
* @param compress - if need to compress file with gzip (default: true)
|
|
17
|
-
*/
|
|
18
|
-
export function writeFileForSlpk(
|
|
19
|
-
path: string,
|
|
20
|
-
data: string | Uint8Array | ArrayBuffer,
|
|
21
|
-
fileName?: string,
|
|
22
|
-
compress?: boolean
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Remove dir with path
|
|
27
|
-
*
|
|
28
|
-
* @param path
|
|
29
|
-
*/
|
|
30
|
-
export function removeDir(path: string): Promise<void>;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Remove file with path
|
|
34
|
-
*
|
|
35
|
-
* @param path
|
|
36
|
-
*/
|
|
37
|
-
export function removeFile(path: string): Promise<void>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Generates absolute file path
|
|
41
|
-
* @param filePath
|
|
42
|
-
*/
|
|
43
|
-
export function getAbsoluteFilePath(filePath: string): string;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert LOD metric from "Screen Space Error" to "Screen Threshold"
|
|
3
|
-
*
|
|
4
|
-
* @param tile - 3d-tiles tile Object
|
|
5
|
-
* @param coordinates - node converted coordinates
|
|
6
|
-
* @returns An array of LOD metrics in format compatible with i3s 3DNodeIndexDocument.lodSelection
|
|
7
|
-
* @example
|
|
8
|
-
* [
|
|
9
|
-
{
|
|
10
|
-
"metricType": "maxScreenThresholdSQ",
|
|
11
|
-
"maxError": 870638.071285568
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"metricType": "maxScreenThreshold",
|
|
15
|
-
"maxError": 1052.8679031638949
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
*/
|
|
19
|
-
export function convertGeometricErrorToScreenThreshold(
|
|
20
|
-
tile: Object,
|
|
21
|
-
coordinates: {
|
|
22
|
-
mbs?: number[];
|
|
23
|
-
}
|
|
24
|
-
): Array<{metricType: string; maxError: number}>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Convert LOD metric from "Screen Threshold" to "Screen Space Error"
|
|
28
|
-
* @param node - i3s node data
|
|
29
|
-
* @returns lod metric in 3d-tiles format
|
|
30
|
-
* @todo implement this function
|
|
31
|
-
*/
|
|
32
|
-
export function convertScreenThresholdToGeometricError(node: Object): 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
|
-
}
|
|
@@ -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);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert LOD metric from "Screen Space Error" to "Screen Threshold"
|
|
3
|
-
*
|
|
4
|
-
* @param tile - 3d-tiles tile Object
|
|
5
|
-
* @param coordinates - node converted coordinates
|
|
6
|
-
* @returns An array of LOD metrics in format compatible with i3s 3DNodeIndexDocument.lodSelection
|
|
7
|
-
* @example
|
|
8
|
-
* [
|
|
9
|
-
{
|
|
10
|
-
"metricType": "maxScreenThresholdSQ",
|
|
11
|
-
"maxError": 870638.071285568
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"metricType": "maxScreenThreshold",
|
|
15
|
-
"maxError": 1052.8679031638949
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
*/
|
|
19
|
-
export function convertGeometricErrorToScreenThreshold(
|
|
20
|
-
tile: Object,
|
|
21
|
-
coordinates: {
|
|
22
|
-
mbs?: number[];
|
|
23
|
-
}
|
|
24
|
-
): Array<{metricType: string; maxError: number}>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Convert LOD metric from "Screen Threshold" to "Screen Space Error"
|
|
28
|
-
* @param node - i3s node data
|
|
29
|
-
* @returns lod metric in 3d-tiles format
|
|
30
|
-
* @todo implement this function
|
|
31
|
-
*/
|
|
32
|
-
export function convertScreenThresholdToGeometricError(node: Object): 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
|
-
}
|
|
@@ -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);
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Write a file with data and name fileName to path
|
|
3
|
-
*
|
|
4
|
-
* @param path - output path
|
|
5
|
-
* @param data - file content
|
|
6
|
-
* @param fileName - name of output file (default: index.json)
|
|
7
|
-
*/
|
|
8
|
-
export function writeFile(path: string, data: string | Uint8Array | ArrayBuffer, fileName?: string);
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Write a file with data and name fileName to path - specific one for further packaging into slpk
|
|
12
|
-
*
|
|
13
|
-
* @param path - output path
|
|
14
|
-
* @param data - file content
|
|
15
|
-
* @param fileName - name of output file (default: index.json)
|
|
16
|
-
* @param compress - if need to compress file with gzip (default: true)
|
|
17
|
-
*/
|
|
18
|
-
export function writeFileForSlpk(
|
|
19
|
-
path: string,
|
|
20
|
-
data: string | Uint8Array | ArrayBuffer,
|
|
21
|
-
fileName?: string,
|
|
22
|
-
compress?: boolean
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Remove dir with path
|
|
27
|
-
*
|
|
28
|
-
* @param path
|
|
29
|
-
*/
|
|
30
|
-
export function removeDir(path: string): Promise<void>;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Remove file with path
|
|
34
|
-
*
|
|
35
|
-
* @param path
|
|
36
|
-
*/
|
|
37
|
-
export function removeFile(path: string): Promise<void>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Generates absolute file path
|
|
41
|
-
* @param filePath
|
|
42
|
-
*/
|
|
43
|
-
export function getAbsoluteFilePath(filePath: string): string;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {promises as fs} from 'fs';
|
|
2
|
-
import {isAbsolute, join} from 'path';
|
|
3
|
-
import {compressFileWithGzip} from './compress-util';
|
|
4
|
-
|
|
5
|
-
export async function writeFile(path, data, fileName = 'index.json') {
|
|
6
|
-
await fs.mkdir(path, {recursive: true});
|
|
7
|
-
const pathFile = join(path, fileName);
|
|
8
|
-
try {
|
|
9
|
-
await fs.writeFile(pathFile, data);
|
|
10
|
-
} catch (err) {
|
|
11
|
-
throw err;
|
|
12
|
-
}
|
|
13
|
-
console.log(`${pathFile} saved.`); // eslint-disable-line
|
|
14
|
-
return pathFile;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export async function writeFileForSlpk(path, data, fileName = 'index.json', compress = true) {
|
|
18
|
-
const pathFile = await writeFile(path, data, fileName);
|
|
19
|
-
if (compress) {
|
|
20
|
-
const pathGzFile = await compressFileWithGzip(pathFile);
|
|
21
|
-
// After compression, we don't need an uncompressed file
|
|
22
|
-
await removeFile(pathFile);
|
|
23
|
-
return pathGzFile;
|
|
24
|
-
}
|
|
25
|
-
return pathFile;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function removeDir(path) {
|
|
29
|
-
return fs.rmdir(path, {recursive: true});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function removeFile(path) {
|
|
33
|
-
return fs.unlink(path);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function getAbsoluteFilePath(filePath) {
|
|
37
|
-
return isAbsolute(filePath) ? filePath : join(process.cwd(), filePath); // eslint-disable-line no-undef
|
|
38
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert LOD metric from "Screen Space Error" to "Screen Threshold"
|
|
3
|
-
*
|
|
4
|
-
* @param tile - 3d-tiles tile Object
|
|
5
|
-
* @param coordinates - node converted coordinates
|
|
6
|
-
* @returns An array of LOD metrics in format compatible with i3s 3DNodeIndexDocument.lodSelection
|
|
7
|
-
* @example
|
|
8
|
-
* [
|
|
9
|
-
{
|
|
10
|
-
"metricType": "maxScreenThresholdSQ",
|
|
11
|
-
"maxError": 870638.071285568
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"metricType": "maxScreenThreshold",
|
|
15
|
-
"maxError": 1052.8679031638949
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
*/
|
|
19
|
-
export function convertGeometricErrorToScreenThreshold(
|
|
20
|
-
tile: Object,
|
|
21
|
-
coordinates: {
|
|
22
|
-
mbs?: number[];
|
|
23
|
-
}
|
|
24
|
-
): Array<{metricType: string; maxError: number}>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Convert LOD metric from "Screen Threshold" to "Screen Space Error"
|
|
28
|
-
* @param node - i3s node data
|
|
29
|
-
* @returns lod metric in 3d-tiles format
|
|
30
|
-
* @todo implement this function
|
|
31
|
-
*/
|
|
32
|
-
export function convertScreenThresholdToGeometricError(node: Object): number;
|